You need to sign in to do that
Don't have an account?
Karel Slaby
How can I call innerclass method in visualforce page?
Hello everyone,
is there any way how to call innerclass' method in visualforce page?
Thanks for answers in advance,
Karel.
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Hello everyone,
is there any way how to call innerclass' method in visualforce page?
Thanks for answers in advance,
Karel.
This is a bug that may be related to internal bug number W-1065879. This bug specifically dealt with inputText references that would fail to work on maps, but apparently other elements fail to work correctly with maps as well. (See http://boards.developerforce.com/t5/forums/forumtopicprintpage/board-id/Visualforce/message-id/41334/print-single-message/false/page/1 for an example).
To work around this bug, you have to create a wrapper class as a list that is driven from the maps contents (independently discovered by myself, but I'm sure others have, too).
Here's your code, modified to work around the bug.
You still get the benefits of using a map from a controller point of view by exposing the data to Visualforce as a list.
All Answers
Hello
You need to reference the object of your inner class and then reference the methods from there. You also must make sure that you have those innerclass methods marked as public.
Thank you jd123 very much for reply,
I have just figured out where was the problem.
I tried to call innerclass method from map of inneclasses, and that causes problem.
Here is example how it is not working for maps, but it is working well for lists:
Controller:
VF Page:
After calling Method from Map Inner class I obtain Visualforce Error:
Unknown property 'testtemp.InnerClass.Edit'
Error is in expression '{!mapProcedures[key].Edit}' in component <apex:page > in page testtemp
Is there any way how to call innerclass' method from MAP in visualforce page?
Thanks in advance for helping me,
Karel.
This is a bug that may be related to internal bug number W-1065879. This bug specifically dealt with inputText references that would fail to work on maps, but apparently other elements fail to work correctly with maps as well. (See http://boards.developerforce.com/t5/forums/forumtopicprintpage/board-id/Visualforce/message-id/41334/print-single-message/false/page/1 for an example).
To work around this bug, you have to create a wrapper class as a list that is driven from the maps contents (independently discovered by myself, but I'm sure others have, too).
Here's your code, modified to work around the bug.
You still get the benefits of using a map from a controller point of view by exposing the data to Visualforce as a list.
Thank you sfdcfox for your answer! Acually I have been using this workaround with lists of wrapper classes since I fonud this bug. I was just curious why it doesn't work and whether I make any mistake. Thanks for explanation.
Error Error: java.lang.UnsupportedOperationException
Error Error: null
You can access the inner class method if it is a list as explained above, just not a map.
Salesforce online editor gives an error during saving visualforce page:
[Error] Error: java.lang.UnsupportedOperationException
[Error] Error: null
Eclipse gives only:
Save error: null