File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Spring in Action this week in the Spring 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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Rich Face issue