potential bug: update attribute when inside dataTable

UI Components for JSF
Post Reply
tonico
Posts: 51
Joined: 22 Aug 2010, 00:15

11 Sep 2010, 00:38

Primefaces 2.2 M1, Glassfish 3.1, Mojarra 2.0.3

Potential bug:

CommandLinks or CommandButtons that reside inside a dataTable component's column and have an update attribute defined to refresh another component, are causing no refresh at all. Notice below the following update attribute:

Code: Select all

            <p:commandLink  actionListener="#{myBean.myListener}" update="tabGroup" oncomplete="alert(123)" >
                            <p:graphicImage style="border-width:0px;vertical-align: bottom;" url="/resources/images/buttons/application_view_detail.png"/>
                            <f:param name="id" value="#{item.id}" />
            </p:commandLink>
With the above, as I click on it, I see the alert's 123 dialog, meaning it returns from the listener. I also see on firebug that no validation issues exist. What I do not see is that the "tabGroup" widget ( which is a TabView component ) does not change. As soon as I refresh the browser page I see the changes fine, therefore the state of the content has indeed changed by was not aligned on the client side. Also, if I add an "action" attribute to the commandLink the update takes effect as the page refreshes, but the concept here is to use ajax updates and not page refreshes.

Please notice that if the commandLink is outside of the dataTable, everything works. My scenario requires it to be inside the dataTable as these are links that perform some logic and activate state that renders other tabs in the parent tabView. It seems to me that this is a bug.

Here is the complete dataTable code:

Code: Select all

   
......
<p:dataTable  value="#{myController.items}"
                   var="item"
                   rows="10"
                   height="300"
                   dynamic="true"
                   styleClass="tableStyle"
                   paginator="true"
                   selectionMode="single"
        <p:column>
            <f:facet name="header" >
                <h:outputText value="edit" />
            </f:facet>
            <p:commandLink  actionListener="#{actionBean.itemEditListener}" update="tabGroup">
                            <p:graphicImage style="border-width:0px;vertical-align: bottom;" url="/resources/images/buttons/application_view_detail.png"/>
                            <f:param name="id" value="#{item.id}" />
            </p:commandLink>
        </p:column>
        ......
        ......
Please help. Thanks in advance
- Tonico
Primefaces 2.2.1 - Glassfish 3.1 - Mac OS X Lion

callahan
Posts: 768
Joined: 27 May 2010, 22:52

12 Sep 2010, 13:32

Hi,

This may be a Mojarra issue. If it is, the information here may help http://primefaces.prime.com.tr/forum/vi ... 311#p16178

tonico
Posts: 51
Joined: 22 Aug 2010, 00:15

12 Sep 2010, 17:15

Callahan, that seems very related. I sense all dataTable issues are somehow related to the same thing. What I have noticed and may be of relevance for resolving this issue is that when I had the issue I was observing the firebug response and noticed the ViewState id in there. After looking at the HTML page code I noticed that each of my forms ( I have 2 forms ) had the same ViewState id on the hidden input fields after the form. If the ViewState id has to be unique per form, then the issue might be in this direction. When I used a single form rather than two, I had some other sorts of issues.
- Tonico
Primefaces 2.2.1 - Glassfish 3.1 - Mac OS X Lion

callahan
Posts: 768
Joined: 27 May 2010, 22:52

13 Sep 2010, 02:13

I don't think you're having an issue with the view state here. I think you're having a problem updating a DataTable from a component nested within that DataTable as described in the above link. It's an indirect update in this case as you're updating a TabView that contains a DataTable from a component within that DataTable.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 50 guests