0

I wonder if I can use the execute attribute of the a4j:commandLink component to submit a form using the form id. Here is my code:

<h:form id="myForm">
     // fields and values and stuff.....

</h:form>

<a4j:region>
    <a4j:commandLink execute="myForm" id="myLink" value="Click Here" render="someComponent" actionListener="#{myBean.myAction}"/>
</a4j:region>

If this is not doable, please suggest me some other way to achieve this.

Shahe
  • 964
  • 2
  • 13
  • 34
  • Wouldn't it be easier (and faster) to try it and see if it works? – Makhiel Mar 18 '15 at 09:01
  • @Makhiel And you thought that I didn't try it? c'mon.... I wouldn't waste my time asking in here... anyways I tried and it is not working !! – Shahe Mar 19 '15 at 07:34
  • Well sorry but there's nothing in your post to suggest you tried. What version of RichFaces do you use? It works fine with 4.5.3. – Makhiel Mar 19 '15 at 08:42
  • @Makhiel JSF 2.2 and RichFaces 4.5.0...... It works only if you try submitting in the same form.. I need to submit my form, from outside of it, like in my code, that execute="myForm" is not working. – Shahe Mar 19 '15 at 13:22
  • Ok, doesn't work with MyFaces, why do you need to have the button outside of the form? – Makhiel Mar 19 '15 at 14:51

0 Answers0