The moose likes JSF and the fly likes Rich Face issue Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply 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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Rich Face issue
 
Similar Threads
Can't reRender richfaces datatable from modal panel
Dynamically deciding either to show or hide modalPanel
access f:param-value with BooleanCheckbox
Page section does not update after call of a4j:support in IE 9
ajax:support problem with rich:combobox