Page 1 of 1

p:ajax inside a DataTable

Posted: 25 Feb 2010, 01:44
by pmartin8
Hello

Look at this Code

Code: Select all

<p:growl id="growl"  showDetail="true" />
<p:dataTable id="tbl" value="#{carBean.cars}" var="car" selection="#{carBean.myCar}" selectionMode="single" rows="15">
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Kind"/>
                            </f:facet>

                            <p:inplace label="#{car.name}" >
                                <h:selectOneMenu id="type" value="#{car.myCar}" >
                                    <p:ajax  event="blur" actionListener="#{carBean.updateMyCar}" update="growl"/>
                                    <f:selectItems value="#{carBean.allCars}"/>
                                </h:selectOneMenu>
                            </p:inplace>

                        </p:column>
                    </p:dataTable>


When there is a Blur on the first Row, the actionListener is called once...
When there is a Blur on the second row, the actionListerner is called twice...
And guess what... When there is a Blur on the third row, the actionListener is called three times!

Bug?

Re: p:ajax inside a DataTable

Posted: 25 Feb 2010, 11:51
by Oleg
Hi,

Why do you use "blur" and not "change" event? Did you try with f:ajax (JSF 2 standard)?

Re: p:ajax inside a DataTable

Posted: 25 Feb 2010, 15:33
by pmartin8
Well, I alos tried with event=change but its the same behavior.


I don't have the tag "ajax" inside the core JSF jar (http://java.sun.com/jsf/core)... A guess the ajax tag must be in the dynaface bundle... But I would prefer to stay with that Primefaces component! Of course!!

Is there any way to solve this problem?