I’m using a RichFaces commandbutton and I need it to execute two functions on click, one after the other. Right now, I have the code like so:
<a4j:commandButton styleClass="btn-hide"
onl
id="btnId"
type="submit"
value="addNew"
rendered="true"
reRender="panel"
eventsQueue="eventQueue"
status="eventQueue"
actionListener="#{(someMethod.something)}"
oncomplete="javascript:something;this.disabled=false"
onclick="Bean.setDesc(document.getElementById('inputArea').value);this.disable=false"
ignoreDupResponses="true"
immediate= "true">
<s:conversationId></s:conversationId>
</a4j:commandButton>
If you look at the onclick portion, I need the Bean.setDesc to run first and then this.disabled=false. How would I go about doing this chronologically?
Thanks
Here’s a code stub to get you started. You’ll want to use a4j:jsFunction if you are looking to grab values directly from the client and pass them to a server method with javascript.
and the managed bean: