-
1. Re: commandButton action not firing after reenabling
healeyb Feb 29, 2012 12:04 PM (in response to tomek.f)Can you show the surrounding code? is it a a4j:commandButton? which RF version are you using? Have you
tried it with disabled="false", does it ever work?
-
2. Re: commandButton action not firing after reenabling
tomek.f Feb 29, 2012 1:46 PM (in response to healeyb)<a4j:commandButton id="saveButton" action="#{bean.save}" disabled="#{bean.saveButtonDisabled}"
execute="@form" value="Save" />
<a4j:jsFunction name="enableButton" render="saveButton" id="enableSaveButtonFunction">
<a4j:param assignTo="#{bean.saveButtonDisabled}" name="disabled" value="#{false}" />
</a4j:jsFunction>
-
3. Re: commandButton action not firing after reenabling
sunkaram Feb 29, 2012 4:33 PM (in response to tomek.f)did you check if button is enabled after rerendering?
I enable/disable button in my app based on bean property, its works perfectly fine.. I used action method to change flag not <a4j:jsFunction with param.
-
4. Re: commandButton action not firing after reenabling
healeyb Feb 29, 2012 5:34 PM (in response to sunkaram)for testing purposes why not just delete the disabled= attribute. I expect that you'l find that the action ( save() ) won't
fire anyway. This is most likely to be because the component is failing validation. Add an h:messages tag to the page.
Assuming that the commandButton is in a form...
-
5. Re: commandButton action not firing after reenabling
tomek.f Feb 29, 2012 7:05 PM (in response to sunkaram)@ Maheswara So do you enable disable with bean property? I have to enable button after input field blur.
@ Brendan Yes it works without that attribute. i have messages doesnt show anything. It is in a form.
-
6. Re: commandButton action not firing after reenabling
healeyb Feb 29, 2012 7:28 PM (in response to tomek.f)You need to post the code dude. Is the button resident within a component that uses rendered=?
-
7. Re: commandButton action not firing after reenabling
tomek.f Mar 1, 2012 4:44 AM (in response to healeyb)@ Brendan Sry but I cannot understand your question. Mycode:
<h:form id="popupForm" prependId="false" >
<rich:graphValidator value="#{flightEdit}" id="gv1">
/* ... */
<f:facet name="footer">
<rich:panel id="saveButtonPanelFooter">
<a4j:commandButton id="saveButton" action="#{bean.save}" disabled="#{bean.saveButtonDisabled}"
execute="@form" value="Save" />
</rich:panel>
</f:facet>
</h:panelGrid>
</rich:graphValidator>
<a4j:jsFunction name="enableButton" render="saveButton" id="enableSaveButtonFunction">
<a4j:param assignTo="#{bean.saveButtonDisabled}" name="disabled" value="#{false}" />
</a4j:jsFunction>
</h:form>
After clicking the button it renders and is enabled.
-
8. Re: commandButton action not firing after reenabling
sunkaram Mar 1, 2012 11:28 AM (in response to tomek.f)Yes, I enable/disable based on bean property.
instead of rendering just button (which is disabled), try rendering 'saveButtonPanelFooter' which is wrapper to save button.
-
9. Re: commandButton action not firing after reenabling
tomek.f Mar 5, 2012 3:56 AM (in response to sunkaram)Ok. Problem was somewhere else and after fixing it it of course works. Sry. Thread to delete.