You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Jakob Korherr (JIRA)" <de...@myfaces.apache.org> on 2010/07/06 18:46:50 UTC

[jira] Reopened: (MYFACES-2744) UIData.getClientId() should not append rowIndex, instead use UIData.getContainerClientId()

     [ https://issues.apache.org/jira/browse/MYFACES-2744?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jakob Korherr reopened MYFACES-2744:
------------------------------------


Reopening this one, because getClientId() has to be changed to getContainerClientId() in some places (like MYFACES-2788)

> UIData.getClientId() should not append rowIndex, instead use UIData.getContainerClientId()
> ------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-2744
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2744
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.0
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.1-SNAPSHOT
>
>
> from: [jsr-314-open] Ajax inside a DataTable
> Cagatay Civici
> I've faced with an issue in our app I'd like to share when trying to update the datatable itself from a command element located inside a column. Case is to select a row, execute logic and update the datatable. Basic code:
> <h:dataTable id="cars" var="car" value="#{tableBean.carsSmall}">
> <h:column>
> <f:facet name="header">
> Model
> </f:facet>
> <h:outputText value="#{car.model}" />
> </h:column>
> <h:column>
> <f:facet name="header">
> Action
> </f:facet>
> <h:commandButton value="Some Action" actionListener="#{tableBean.handleRowAction(car)}">
> <f:ajax render="cars" />
> </h:commandButton>
> </h:column>
> </h:dataTable>
> As datatable has a rowIndex >= 0 during rendering of commandButton f:ajax defines the component id to render as cars:{rowIndex} where I should expect "cars" only. This is due to UIData.getClientId implementation as UIData
> adds rowIndex for unique row ids. This causes an issue with a nested f:ajax case.
> Martin Marinschek
> We should never include the row-index in the client-id of the table
> itself. For this, we need to revise the client-id generation
> algorithm.
> Without actually having tried it, I think that it is easy to do so, as
> we have a UIComponentBase.getContainerClientId() to create the
> client-id of the children - when this method is called, we append the
> row-index, if getClientId() itself is called, we donĀ“t. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.