This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes Rich Face issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Rich Face issue" Watch "Rich Face issue" New topic
Author

Rich Face issue

Abhi Singh
Greenhorn

Joined: Feb 02, 2010
Posts: 13
<h:selectBooleanCheckbox id="chkPanelPackage" value="#{packageDataMo.selected}" >
<a4j:support action="toggleServices" event="onclick" oncomplete="chkPackList(#{appointment.appStautsId})" Render="dtServicesDetails,scrServiceDetails,appointmentBookBtnsPanel,chkPanelPackage" ajaxSingle="true">
<f:param name="treatInd" value="-1"/>
<f:param name="packInd" value="#{packInd}"/>
</a4j:support>

</h:selectBooleanCheckbox>


In the above code I have called a javascript function on oncomplete tag named chkPackList and trying to pass a value that is returned from the action called. However I am not getting the exact value in the javascript. default value of appointment.appStautsId is 0 and in action it is set to -1. For the first time I am getting the zero value in place of -1 but on the second action completion I am getting -1 value. Can someone suggest me what is the exact problem.
B Nirvan
Ranch Hand

Joined: Oct 20, 2010
Posts: 82
The oncomplete attribute may be generating javascript code before the ajax request is made, which means the old value is passed(although it may be executing the function after the ajax request is complete). If your appStatusId is rendered somewhere in your page, you can use the getElementById to get its value in the chkPackList() function.

regards,
Nirvan.

Abhi Singh
Greenhorn

Joined: Feb 02, 2010
Posts: 13
Nirvan Buddha wrote:The oncomplete attribute may be generating javascript code before the ajax request is made, which means the old value is passed(although it may be executing the function after the ajax request is complete). If your appStatusId is rendered somewhere in your page, you can use the getElementById to get its value in the chkPackList() function.

regards,
Nirvan.


Thanks Nirvan. I hope that javascript is getting called earlier before the ajax request. Anyways that issue has been resolved. Thanks a lot
 
Don't get me started about those stupid light bulbs.
 
subject: Rich Face issue
 
Similar Threads
access f:param-value with BooleanCheckbox
Can't reRender richfaces datatable from modal panel
Dynamically deciding either to show or hide modalPanel
Page section does not update after call of a4j:support in IE 9
ajax:support problem with rich:combobox