I have a togglepanel and a a4j commandButton, I would like to submit the form and next page on complete.
But It is not working, it won't next page but submit only. Here is the code.
<a4j:commandButton action="#{inputData.inputId}" value="Next">
<f:param name="id" value="#{userBean.id}" />
<rich:toggleControl targetIt开发者_高级运维em="@next" event="complete"/>
</a4j:commandButton>
I tried oncomplete="#{rich:component('tooglepanelid')}.next();" too, not working too.. where can i find the togglepanel api doc ?
You can find the API here: http://docs.jboss.org/richfaces/latest_4_X/vdldoc/
togglepanel: http://docs.jboss.org/richfaces/latest_4_X/vdldoc/rich/togglePanel.html
Although be warned it is still work in progress.
If you change the event to a click does it work? I don't think complete is a valid value as oncomplete is not a valid JS event for the 'parent' component. But not sure...
Also try putting in a messages tag to see if there are any errors.
As for this:
I tried oncomplete="#{rich:component('tooglepanelid')}.next();"
I don't think next() is valid JS function for that toggle panel, based on the RF component reference documentation these functions look to be the ones you need to use:
The <rich:togglePanel> component can be controlled through the JavaScript API. The JavaScript API provides the following functions, which are common to all switchable panels:
- getItems() Return an array of the items contained in the toggle panel.
- getItemsNames() Return an array of the names of the items contained in the toggle panel.
- switchToItem(itemName) Switch to and display the item identified by the itemName string passed as a parameter.
- firstItem(), prevItem(), nextItem(), lastItem() Switch to and display the first item, the previous item, the next item, or the last item.
精彩评论