0

i have a JSF inside a JSF page. and the <h:form> is in the principal JSF .

<p:tabView id="tabView">

                <p:tab id="tab1" title="Gestion des Utilisateur" titleStyle="titre">

                   <ui:include src="/admin/usergestion.xhtml" />
                </p:tab>

            </p:tabView>

so when i click in the button thats insise the integrated JSF "usergestion.xhtml" it need 2 clicks to get the action .

i already tryed to add <f:ajax render=":form" /> to fixe the problem but didnt work .

how can i fixe this problem ?

osselosse
  • 149
  • 1
  • 3
  • 13

1 Answers1

0

It is a bug of JSF,JAVASERVERFACES_SPEC_PUBLIC-790 , and will be fixed in version 2.3. (thanks to BalusC for correcting my post.)

You can use this script to solve the issue.

Here is a good answer about the invokation of commandLink and commandButton. I also suggest you to design your page accordingly.

However, there is a PrimeFaces solution which works for me. It works if you give the button which form will be proceed and which will be rendered after ajax request.

    <h:form id="page1">

    <p:commandButton value="" action="#{some_action}">
   <f:ajax execute="@form" render=":page2" />
    </p:commandButton>    
    </h:form>

your action returns to page2

<h:form id="page2">

Some Components

</h:form>
Community
  • 1
  • 1
erencan
  • 3,725
  • 5
  • 32
  • 50
  • 2
    Have you read issue 559? This isn't remotely related. It's spec issue 790 (which as of now turns out to not have made into JSF 2.2 :/ ) – BalusC May 08 '13 at 11:18
  • Yes, you are right issue 559 was for double submit problem. Thanks again. – erencan May 08 '13 at 11:29
  • quote of @balusc replay "Indeed, PrimeFaces has solved it internally in its own JSF ajax engine (check the core.js file). So if you use PrimeFaces ajax components, you will not face this JSF API specific problem. The difference in HTML is not relevant. It's all about ajax response handling. – BalusC Jul 11 '12 at 12:26" but i am using p:commandbutton with primefaces 3.5 and i still have this problem . – osselosse May 08 '13 at 12:15
  • @osselosse i remember my solution for this issue using primefaces. I edited my post. – erencan May 08 '13 at 12:51
  • When i give the form id to be proceed and the id to be rendered, it worked for me. However, i added "?faces-redirect=true" to return string of action before this solution. It works with one click for me if the page is redirected. – erencan May 08 '13 at 16:17