f:ajax + prime:commandButton bug?

UI Components for JSF
Post Reply
malejpavouk
Posts: 8
Joined: 25 Sep 2011, 11:05

14 Oct 2011, 19:46

Hi,

I have the following code. The idea is simple, user selects a value from a menu and another form gets visible, tha user selects an item from a tree (i the dialog displayed)...

BUT: when I rerender the queryPanel, the action after the first click is NEVER called, only the postJS calls (oncomplete). Everything works fine outside the rerendered area of with the second click...

is it a bug or am I doing something wrong, is there some workaround?

Primefaces 2.2.1, Tomcat 7, Mojarra 2.1.3-b02

Thanks



Code: Select all

<prime:panel header="#{msgs.queryHeading}" id="queryPanel">
                    <h:form>
                        #{msgs.queryHeading}: 
                        <h:selectOneMenu value="#{queryBean.selectedQuery}" >
                            <f:selectItem itemLabel="#{msgs.query1}" itemValue="1" />
                            <f:selectItem itemLabel="#{msgs.query2}" itemValue="2" />
                            <f:selectItem itemLabel="#{msgs.query3}" itemValue="3" />

                            <f:ajax event="change" execute="@form" render=":queryPanel"/>
                        </h:selectOneMenu>                   
                    </h:form>
                    <h:panelGroup id="queries" layout="block">
                        <h:form prependId="queryForm">
                            <h:outputText value="#{msgs.query1template}" />
                            <prime:commandButton value="#{translationBean.translate(queryBean.getQueryParam(0), facesContext.externalContext.requestLocale.language)}"
                                                 id="queryItemButton1"
                                                 update=":treeForm:tree" 
                                                 action="#{queryBean.setQueryParam('http://krizik.felk.cvut.cz/ontologies/2011/mondis-example-data.owl#ManifestationOfDamage', 0)}" 
                                                 oncomplete="adjustPositionning(jQuery('#queryItemButton1'), jQuery('#treeDialog')); treeDialog.show()" 
                                                 styleClass="inlineButton"/>
                        </h:form>

malejpavouk
Posts: 8
Joined: 25 Sep 2011, 11:05

14 Oct 2011, 20:18

Ahhh...I have found primefaces p:ajax component, which works in this usecase. But this problematic behaviour of f:ajax with primefaces should be somewhere documented if it is known...

cagatay.civici
Prime
Posts: 17987
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

14 Oct 2011, 20:50

CommandButton does not support client behaviors as ajax is built-in. Seems like a nice enhancement though, feel free to create a request in our tracker.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 17 guests