I have a visualforce page with a CommandLink that calls a controller method. In the controller method I set the properties in VF page(public with getters n setters). However, from the javascript in page, when I try to get those values, it is shown as not set.
Asked
Active
Viewed 1,079 times
-1
-
Could you please include example code of the VF page (with the JS) and the controller? – Rob Davis Mar 28 '17 at 21:28
1 Answers
0
I am assuming that there are input fields on the VF page into which the User enters data and that you have a a JS function that is trying to access those values in the Controller. I have found that the Controller isn't updated with the input values in real time. Those values only get updated when an action is taken. My solution (which may not be be the correct method) is to have a function in my controller to touch those fields so that they get pulled into the controller. Then I have an apex:action function in the VF page to call the "toucher" method. In my JS function I call that apex:action first so the controller gets updated.
![](../../users/profiles/5613603.webp)
Rob Davis
- 1,112
- 9
- 23