You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Claudio Tasso (JIRA)" <de...@myfaces.apache.org> on 2006/01/07 18:16:21 UTC

[jira] Created: (MYFACES-1010) Extended Data Table: Action Event delivered more than one time

Extended Data Table: Action Event delivered more than one time
--------------------------------------------------------------

         Key: MYFACES-1010
         URL: http://issues.apache.org/jira/browse/MYFACES-1010
     Project: MyFaces
        Type: Bug
  Components: Tomahawk (RI Compatability)  
    Versions: 1.1.1    
 Environment: Apache Tomcat 5.5.12 or OC4j 10.1.3 DP4, Win Xp, Sun  RI 1.1.01 , JDK 1.5

    Reporter: Claudio Tasso


Hi,
I'm trying using Tomahawk t:dataTable and it seems to me that its behaviour is very different from the standard  JSF h:dataTable.
Consider a column which contains a command button and a table with two rows. When the user clicks on the button of the first row, two action events are generated!

For example, look at this very simple code:

<f:view>
   <h:form>
       <h:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.uiData}">
           <h:column>
               <h:commandButton value="Test" action="#{testBean.test}"></h:commandButton>
           </h:column>
           <h:column>
               <h:outputText value="#{item.name}"></h:outputText>
           </h:column>
           <h:column>
               <h:outputText value="#{item.surname}"></h:outputText>
           </h:column>
       </h:dataTable>
             <t:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.htmlDataTable}" preserveDataModel="false">
           <t:column>
               <h:commandButton value="Test" action="#{testBean.test2}"></h:commandButton>
           </t:column>
           <t:column>
               <h:outputText value="#{item.name}"></h:outputText>
           </t:column>
           <t:column>
               <h:outputText value="#{item.surname}"></h:outputText>
           </t:column>
       </t:dataTable>
   </h:form>
</f:view>

When the user clicks the "Test" button of the h:dataTable, the "testBean.test" method is executed just one time.
But when the user clicks the "Test" button of the t:dataTable the "testBean.test2" method is executed twice ( or three times if the table has 3 rows, and so on...).

I suppose  that the problem is that the elements of  t:dataTable which belongs to differnt rows have the same ID, and during the processDecode phase the same event is broadcasted more than one time.
In fact, this is the html code which is generated by Tomahawk extended datatable:

<table>
<tbody id="_id0:_id8:tbody_element">
<tr>
<td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
<td>John</td>
<td>Smith</td>
</tr>
<tr><td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
<td>Mark</td>
<td>Greene</td>
</tr></tbody>
</table>


and this is the html code which is generated by RI h:dataTable:

<table>
<tbody>
<tr>
<td><input type="submit" name="_id0:_id1:0:_id3" value="Test" /></td>
<td>John</td>
<td>Smith</td>
</tr>
<tr>
<td><input type="submit" name="_id0:_id1:1:_id3" value="Test" /></td>
<td>Mark</td>
<td>Greene</td>
</tr>
</tbody>
</table>






-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (MYFACES-1010) Extended Data Table: Action Event delivered more than one time

Posted by Martin Marinschek <ma...@gmail.com>.
The RI doesn't it just uses the private accessor "rowIndex" - and not
getRowIndex(). See below. I think Mathias is absolutely right in that
this whole problem boils down to the fact that it shouldn't.

Plus, I'm moving this over to the jira-issue, so that we can keep
track of the issue there.

http://issues.apache.org/jira/browse/MYFACES-1010?page=comments#action_12362262

    public String getClientId(FacesContext context) {

        if (context == null) {
            throw new NullPointerException();
        }
	String baseClientId = super.getClientId(context);
        if (rowIndex >= 0) {
            return (baseClientId + NamingContainer.SEPARATOR_CHAR + rowIndex);
        } else {
            return (baseClientId);
        }

    }

regards,

Martin

On 1/10/06, Adam Winer <aw...@gmail.com> wrote:
> As Claudio noted above, the RI does call getRowIndex() in UIData.getClientId().
>
> Generally speaking, it's very important to call setRowIndex() during iteration,
> for getting the state of the subcomponents in sync, for getting client IDs
> correct, and for establishing the "var" of the table correctly when calling
> through to event listeners on children.
>
> -- Adam
>
>
> On 1/9/06, Mathias Broekelmann (JIRA) <de...@myfaces.apache.org> wrote:
> >     [ http://issues.apache.org/jira/browse/MYFACES-1010?page=comments#action_12362262 ]
> >
> > Mathias Broekelmann commented on MYFACES-1010:
> > ----------------------------------------------
> >
> > I took a closer look into the sources. I now think that we should not call super.setRowIndex(..) at all.
> > The problem is that this method implements the most tricky part of the UIData class. It stores and restores the state of the nested components to iterate through the rows. If we do it we would at least get the state saving/restoring done 3 times (HtmlDataTableHack will do this a 3rd. time). I will not say that this is not possible to do. It´s probably more a problem where we should call the super method in setRowIndex. But after all it´s still a workaround.
> >
> > The best solution would be to change the code in RI. Why do they not call getRowIndex() in getClientId()?
> >
> > > Extended Data Table: Action Event delivered more than one time
> > > --------------------------------------------------------------
> > >
> > >          Key: MYFACES-1010
> > >          URL: http://issues.apache.org/jira/browse/MYFACES-1010
> > >      Project: MyFaces
> > >         Type: Bug
> > >   Components: Tomahawk (RI Compatability)
> > >     Versions: 1.1.1
> > >  Environment: Apache Tomcat 5.5.12 or OC4j 10.1.3 DP4, Win Xp, Sun  RI 1.1.01 , JDK 1.5
> > >     Reporter: Claudio Tasso
> >
> > >
> > > Hi,
> > > I'm trying using Tomahawk t:dataTable and it seems to me that its behaviour is very different from the standard  JSF h:dataTable.
> > > Consider a column which contains a command button and a table with two rows. When the user clicks on the button of the first row, two action events are generated!
> > > For example, look at this very simple code:
> > > <f:view>
> > >    <h:form>
> > >        <h:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.uiData}">
> > >            <h:column>
> > >                <h:commandButton value="Test" action="#{testBean.test}"></h:commandButton>
> > >            </h:column>
> > >            <h:column>
> > >                <h:outputText value="#{item.name}"></h:outputText>
> > >            </h:column>
> > >            <h:column>
> > >                <h:outputText value="#{item.surname}"></h:outputText>
> > >            </h:column>
> > >        </h:dataTable>
> > >              <t:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.htmlDataTable}" preserveDataModel="false">
> > >            <t:column>
> > >                <h:commandButton value="Test" action="#{testBean.test2}"></h:commandButton>
> > >            </t:column>
> > >            <t:column>
> > >                <h:outputText value="#{item.name}"></h:outputText>
> > >            </t:column>
> > >            <t:column>
> > >                <h:outputText value="#{item.surname}"></h:outputText>
> > >            </t:column>
> > >        </t:dataTable>
> > >    </h:form>
> > > </f:view>
> > > When the user clicks the "Test" button of the h:dataTable, the "testBean.test" method is executed just one time.
> > > But when the user clicks the "Test" button of the t:dataTable the "testBean.test2" method is executed twice ( or three times if the table has 3 rows, and so on...).
> > > I suppose  that the problem is that the elements of  t:dataTable which belongs to differnt rows have the same ID, and during the processDecode phase the same event is broadcasted more than one time.
> > > In fact, this is the html code which is generated by Tomahawk extended datatable:
> > > <table>
> > > <tbody id="_id0:_id8:tbody_element">
> > > <tr>
> > > <td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> > > <td>John</td>
> > > <td>Smith</td>
> > > </tr>
> > > <tr><td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> > > <td>Mark</td>
> > > <td>Greene</td>
> > > </tr></tbody>
> > > </table>
> > > and this is the html code which is generated by RI h:dataTable:
> > > <table>
> > > <tbody>
> > > <tr>
> > > <td><input type="submit" name="_id0:_id1:0:_id3" value="Test" /></td>
> > > <td>John</td>
> > > <td>Smith</td>
> > > </tr>
> > > <tr>
> > > <td><input type="submit" name="_id0:_id1:1:_id3" value="Test" /></td>
> > > <td>Mark</td>
> > > <td>Greene</td>
> > > </tr>
> > > </tbody>
> > > </table>
> >
> > --
> > This message is automatically generated by JIRA.
> > -
> > If you think it was sent incorrectly contact one of the administrators:
> >    http://issues.apache.org/jira/secure/Administrators.jspa
> > -
> > For more information on JIRA, see:
> >    http://www.atlassian.com/software/jira
> >
> >
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: [jira] Commented: (MYFACES-1010) Extended Data Table: Action Event delivered more than one time

Posted by Adam Winer <aw...@gmail.com>.
As Claudio noted above, the RI does call getRowIndex() in UIData.getClientId().

Generally speaking, it's very important to call setRowIndex() during iteration,
for getting the state of the subcomponents in sync, for getting client IDs
correct, and for establishing the "var" of the table correctly when calling
through to event listeners on children.

-- Adam


On 1/9/06, Mathias Broekelmann (JIRA) <de...@myfaces.apache.org> wrote:
>     [ http://issues.apache.org/jira/browse/MYFACES-1010?page=comments#action_12362262 ]
>
> Mathias Broekelmann commented on MYFACES-1010:
> ----------------------------------------------
>
> I took a closer look into the sources. I now think that we should not call super.setRowIndex(..) at all.
> The problem is that this method implements the most tricky part of the UIData class. It stores and restores the state of the nested components to iterate through the rows. If we do it we would at least get the state saving/restoring done 3 times (HtmlDataTableHack will do this a 3rd. time). I will not say that this is not possible to do. It´s probably more a problem where we should call the super method in setRowIndex. But after all it´s still a workaround.
>
> The best solution would be to change the code in RI. Why do they not call getRowIndex() in getClientId()?
>
> > Extended Data Table: Action Event delivered more than one time
> > --------------------------------------------------------------
> >
> >          Key: MYFACES-1010
> >          URL: http://issues.apache.org/jira/browse/MYFACES-1010
> >      Project: MyFaces
> >         Type: Bug
> >   Components: Tomahawk (RI Compatability)
> >     Versions: 1.1.1
> >  Environment: Apache Tomcat 5.5.12 or OC4j 10.1.3 DP4, Win Xp, Sun  RI 1.1.01 , JDK 1.5
> >     Reporter: Claudio Tasso
>
> >
> > Hi,
> > I'm trying using Tomahawk t:dataTable and it seems to me that its behaviour is very different from the standard  JSF h:dataTable.
> > Consider a column which contains a command button and a table with two rows. When the user clicks on the button of the first row, two action events are generated!
> > For example, look at this very simple code:
> > <f:view>
> >    <h:form>
> >        <h:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.uiData}">
> >            <h:column>
> >                <h:commandButton value="Test" action="#{testBean.test}"></h:commandButton>
> >            </h:column>
> >            <h:column>
> >                <h:outputText value="#{item.name}"></h:outputText>
> >            </h:column>
> >            <h:column>
> >                <h:outputText value="#{item.surname}"></h:outputText>
> >            </h:column>
> >        </h:dataTable>
> >              <t:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.htmlDataTable}" preserveDataModel="false">
> >            <t:column>
> >                <h:commandButton value="Test" action="#{testBean.test2}"></h:commandButton>
> >            </t:column>
> >            <t:column>
> >                <h:outputText value="#{item.name}"></h:outputText>
> >            </t:column>
> >            <t:column>
> >                <h:outputText value="#{item.surname}"></h:outputText>
> >            </t:column>
> >        </t:dataTable>
> >    </h:form>
> > </f:view>
> > When the user clicks the "Test" button of the h:dataTable, the "testBean.test" method is executed just one time.
> > But when the user clicks the "Test" button of the t:dataTable the "testBean.test2" method is executed twice ( or three times if the table has 3 rows, and so on...).
> > I suppose  that the problem is that the elements of  t:dataTable which belongs to differnt rows have the same ID, and during the processDecode phase the same event is broadcasted more than one time.
> > In fact, this is the html code which is generated by Tomahawk extended datatable:
> > <table>
> > <tbody id="_id0:_id8:tbody_element">
> > <tr>
> > <td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> > <td>John</td>
> > <td>Smith</td>
> > </tr>
> > <tr><td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> > <td>Mark</td>
> > <td>Greene</td>
> > </tr></tbody>
> > </table>
> > and this is the html code which is generated by RI h:dataTable:
> > <table>
> > <tbody>
> > <tr>
> > <td><input type="submit" name="_id0:_id1:0:_id3" value="Test" /></td>
> > <td>John</td>
> > <td>Smith</td>
> > </tr>
> > <tr>
> > <td><input type="submit" name="_id0:_id1:1:_id3" value="Test" /></td>
> > <td>Mark</td>
> > <td>Greene</td>
> > </tr>
> > </tbody>
> > </table>
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
>    http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
>    http://www.atlassian.com/software/jira
>
>

[jira] Commented: (MYFACES-1010) Extended Data Table: Action Event delivered more than one time

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1010?page=comments#action_12362306 ] 

Martin Marinschek commented on MYFACES-1010:
--------------------------------------------

As Claudio noted above, the RI does call getRowIndex() in UIData.getClientId().

Generally speaking, it's very important to call setRowIndex() during iteration,
for getting the state of the subcomponents in sync, for getting client IDs
correct, and for establishing the "var" of the table correctly when calling
through to event listeners on children.

-- Adam

> Extended Data Table: Action Event delivered more than one time
> --------------------------------------------------------------
>
>          Key: MYFACES-1010
>          URL: http://issues.apache.org/jira/browse/MYFACES-1010
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk (RI Compatability)
>     Versions: 1.1.1
>  Environment: Apache Tomcat 5.5.12 or OC4j 10.1.3 DP4, Win Xp, Sun  RI 1.1.01 , JDK 1.5
>     Reporter: Claudio Tasso

>
> Hi,
> I'm trying using Tomahawk t:dataTable and it seems to me that its behaviour is very different from the standard  JSF h:dataTable.
> Consider a column which contains a command button and a table with two rows. When the user clicks on the button of the first row, two action events are generated!
> For example, look at this very simple code:
> <f:view>
>    <h:form>
>        <h:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.uiData}">
>            <h:column>
>                <h:commandButton value="Test" action="#{testBean.test}"></h:commandButton>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </h:column>
>        </h:dataTable>
>              <t:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.htmlDataTable}" preserveDataModel="false">
>            <t:column>
>                <h:commandButton value="Test" action="#{testBean.test2}"></h:commandButton>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </t:column>
>        </t:dataTable>
>    </h:form>
> </f:view>
> When the user clicks the "Test" button of the h:dataTable, the "testBean.test" method is executed just one time.
> But when the user clicks the "Test" button of the t:dataTable the "testBean.test2" method is executed twice ( or three times if the table has 3 rows, and so on...).
> I suppose  that the problem is that the elements of  t:dataTable which belongs to differnt rows have the same ID, and during the processDecode phase the same event is broadcasted more than one time.
> In fact, this is the html code which is generated by Tomahawk extended datatable:
> <table>
> <tbody id="_id0:_id8:tbody_element">
> <tr>
> <td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr><td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr></tbody>
> </table>
> and this is the html code which is generated by RI h:dataTable:
> <table>
> <tbody>
> <tr>
> <td><input type="submit" name="_id0:_id1:0:_id3" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr>
> <td><input type="submit" name="_id0:_id1:1:_id3" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr>
> </tbody>
> </table>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (MYFACES-1010) Extended Data Table: Action Event delivered more than one time

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-1010?page=all ]
     
Martin Marinschek closed MYFACES-1010:
--------------------------------------

    Fix Version: Nightly
     Resolution: Won't Fix
      Assign To: Mathias Broekelmann

Will be fixed in RI, not with us.

This bug has a similar outcome, but not the same reasons as MYFACES-853 and MYFACES-1009, so please make sure you indicate if you are using the RI if you post information about this fix on the list.

regards,

Martin

> Extended Data Table: Action Event delivered more than one time
> --------------------------------------------------------------
>
>          Key: MYFACES-1010
>          URL: http://issues.apache.org/jira/browse/MYFACES-1010
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk (RI Compatability)
>     Versions: 1.1.1
>  Environment: Apache Tomcat 5.5.12 or OC4j 10.1.3 DP4, Win Xp, Sun  RI 1.1.01 , JDK 1.5
>     Reporter: Claudio Tasso
>     Assignee: Mathias Broekelmann
>      Fix For: Nightly

>
> Hi,
> I'm trying using Tomahawk t:dataTable and it seems to me that its behaviour is very different from the standard  JSF h:dataTable.
> Consider a column which contains a command button and a table with two rows. When the user clicks on the button of the first row, two action events are generated!
> For example, look at this very simple code:
> <f:view>
>    <h:form>
>        <h:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.uiData}">
>            <h:column>
>                <h:commandButton value="Test" action="#{testBean.test}"></h:commandButton>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </h:column>
>        </h:dataTable>
>              <t:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.htmlDataTable}" preserveDataModel="false">
>            <t:column>
>                <h:commandButton value="Test" action="#{testBean.test2}"></h:commandButton>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </t:column>
>        </t:dataTable>
>    </h:form>
> </f:view>
> When the user clicks the "Test" button of the h:dataTable, the "testBean.test" method is executed just one time.
> But when the user clicks the "Test" button of the t:dataTable the "testBean.test2" method is executed twice ( or three times if the table has 3 rows, and so on...).
> I suppose  that the problem is that the elements of  t:dataTable which belongs to differnt rows have the same ID, and during the processDecode phase the same event is broadcasted more than one time.
> In fact, this is the html code which is generated by Tomahawk extended datatable:
> <table>
> <tbody id="_id0:_id8:tbody_element">
> <tr>
> <td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr><td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr></tbody>
> </table>
> and this is the html code which is generated by RI h:dataTable:
> <table>
> <tbody>
> <tr>
> <td><input type="submit" name="_id0:_id1:0:_id3" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr>
> <td><input type="submit" name="_id0:_id1:1:_id3" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr>
> </tbody>
> </table>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1010) Extended Data Table: Action Event delivered more than one time

Posted by "Claudio Tasso (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1010?page=comments#action_12362368 ] 

Claudio Tasso commented on MYFACES-1010:
----------------------------------------

Do you think that the solution presented  by Mathias will be integrated in the source code?

> Extended Data Table: Action Event delivered more than one time
> --------------------------------------------------------------
>
>          Key: MYFACES-1010
>          URL: http://issues.apache.org/jira/browse/MYFACES-1010
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk (RI Compatability)
>     Versions: 1.1.1
>  Environment: Apache Tomcat 5.5.12 or OC4j 10.1.3 DP4, Win Xp, Sun  RI 1.1.01 , JDK 1.5
>     Reporter: Claudio Tasso

>
> Hi,
> I'm trying using Tomahawk t:dataTable and it seems to me that its behaviour is very different from the standard  JSF h:dataTable.
> Consider a column which contains a command button and a table with two rows. When the user clicks on the button of the first row, two action events are generated!
> For example, look at this very simple code:
> <f:view>
>    <h:form>
>        <h:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.uiData}">
>            <h:column>
>                <h:commandButton value="Test" action="#{testBean.test}"></h:commandButton>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </h:column>
>        </h:dataTable>
>              <t:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.htmlDataTable}" preserveDataModel="false">
>            <t:column>
>                <h:commandButton value="Test" action="#{testBean.test2}"></h:commandButton>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </t:column>
>        </t:dataTable>
>    </h:form>
> </f:view>
> When the user clicks the "Test" button of the h:dataTable, the "testBean.test" method is executed just one time.
> But when the user clicks the "Test" button of the t:dataTable the "testBean.test2" method is executed twice ( or three times if the table has 3 rows, and so on...).
> I suppose  that the problem is that the elements of  t:dataTable which belongs to differnt rows have the same ID, and during the processDecode phase the same event is broadcasted more than one time.
> In fact, this is the html code which is generated by Tomahawk extended datatable:
> <table>
> <tbody id="_id0:_id8:tbody_element">
> <tr>
> <td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr><td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr></tbody>
> </table>
> and this is the html code which is generated by RI h:dataTable:
> <table>
> <tbody>
> <tr>
> <td><input type="submit" name="_id0:_id1:0:_id3" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr>
> <td><input type="submit" name="_id0:_id1:1:_id3" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr>
> </tbody>
> </table>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1010) Extended Data Table: Action Event delivered more than one time

Posted by "Mathias Broekelmann (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1010?page=comments#action_12362610 ] 

Mathias Broekelmann commented on MYFACES-1010:
----------------------------------------------

I will add the implementation for getClientId. But it takes some time for me to test it with the RI.

> Extended Data Table: Action Event delivered more than one time
> --------------------------------------------------------------
>
>          Key: MYFACES-1010
>          URL: http://issues.apache.org/jira/browse/MYFACES-1010
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk (RI Compatability)
>     Versions: 1.1.1
>  Environment: Apache Tomcat 5.5.12 or OC4j 10.1.3 DP4, Win Xp, Sun  RI 1.1.01 , JDK 1.5
>     Reporter: Claudio Tasso

>
> Hi,
> I'm trying using Tomahawk t:dataTable and it seems to me that its behaviour is very different from the standard  JSF h:dataTable.
> Consider a column which contains a command button and a table with two rows. When the user clicks on the button of the first row, two action events are generated!
> For example, look at this very simple code:
> <f:view>
>    <h:form>
>        <h:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.uiData}">
>            <h:column>
>                <h:commandButton value="Test" action="#{testBean.test}"></h:commandButton>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </h:column>
>        </h:dataTable>
>              <t:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.htmlDataTable}" preserveDataModel="false">
>            <t:column>
>                <h:commandButton value="Test" action="#{testBean.test2}"></h:commandButton>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </t:column>
>        </t:dataTable>
>    </h:form>
> </f:view>
> When the user clicks the "Test" button of the h:dataTable, the "testBean.test" method is executed just one time.
> But when the user clicks the "Test" button of the t:dataTable the "testBean.test2" method is executed twice ( or three times if the table has 3 rows, and so on...).
> I suppose  that the problem is that the elements of  t:dataTable which belongs to differnt rows have the same ID, and during the processDecode phase the same event is broadcasted more than one time.
> In fact, this is the html code which is generated by Tomahawk extended datatable:
> <table>
> <tbody id="_id0:_id8:tbody_element">
> <tr>
> <td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr><td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr></tbody>
> </table>
> and this is the html code which is generated by RI h:dataTable:
> <table>
> <tbody>
> <tr>
> <td><input type="submit" name="_id0:_id1:0:_id3" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr>
> <td><input type="submit" name="_id0:_id1:1:_id3" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr>
> </tbody>
> </table>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1010) Extended Data Table: Action Event delivered more than one time

Posted by "Mathias Broekelmann (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1010?page=comments#action_12362252 ] 

Mathias Broekelmann commented on MYFACES-1010:
----------------------------------------------

I think we should only call super.setRowIndex(..) if not myfaces impl is used.

> Extended Data Table: Action Event delivered more than one time
> --------------------------------------------------------------
>
>          Key: MYFACES-1010
>          URL: http://issues.apache.org/jira/browse/MYFACES-1010
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk (RI Compatability)
>     Versions: 1.1.1
>  Environment: Apache Tomcat 5.5.12 or OC4j 10.1.3 DP4, Win Xp, Sun  RI 1.1.01 , JDK 1.5
>     Reporter: Claudio Tasso

>
> Hi,
> I'm trying using Tomahawk t:dataTable and it seems to me that its behaviour is very different from the standard  JSF h:dataTable.
> Consider a column which contains a command button and a table with two rows. When the user clicks on the button of the first row, two action events are generated!
> For example, look at this very simple code:
> <f:view>
>    <h:form>
>        <h:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.uiData}">
>            <h:column>
>                <h:commandButton value="Test" action="#{testBean.test}"></h:commandButton>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </h:column>
>        </h:dataTable>
>              <t:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.htmlDataTable}" preserveDataModel="false">
>            <t:column>
>                <h:commandButton value="Test" action="#{testBean.test2}"></h:commandButton>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </t:column>
>        </t:dataTable>
>    </h:form>
> </f:view>
> When the user clicks the "Test" button of the h:dataTable, the "testBean.test" method is executed just one time.
> But when the user clicks the "Test" button of the t:dataTable the "testBean.test2" method is executed twice ( or three times if the table has 3 rows, and so on...).
> I suppose  that the problem is that the elements of  t:dataTable which belongs to differnt rows have the same ID, and during the processDecode phase the same event is broadcasted more than one time.
> In fact, this is the html code which is generated by Tomahawk extended datatable:
> <table>
> <tbody id="_id0:_id8:tbody_element">
> <tr>
> <td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr><td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr></tbody>
> </table>
> and this is the html code which is generated by RI h:dataTable:
> <table>
> <tbody>
> <tr>
> <td><input type="submit" name="_id0:_id1:0:_id3" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr>
> <td><input type="submit" name="_id0:_id1:1:_id3" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr>
> </tbody>
> </table>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1010) Extended Data Table: Action Event delivered more than one time

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1010?page=comments#action_12362307 ] 

Martin Marinschek commented on MYFACES-1010:
--------------------------------------------

Adam,

The RI doesn't it just uses the private accessor "rowIndex" - and not
getRowIndex(). See below. I think Mathias is absolutely right in that
this whole problem boils down to the fact that it shouldn't.

Plus, I'm moving this over to the jira-issue, so that we can keep
track of the issue there.

http://issues.apache.org/jira/browse/MYFACES-1010?page=comments#action_12362262

   public String getClientId(FacesContext context) {

       if (context == null) {
           throw new NullPointerException();
       }
       String baseClientId = super.getClientId(context);
       if (rowIndex >= 0) {
           return (baseClientId + NamingContainer.SEPARATOR_CHAR + rowIndex);
       } else {
           return (baseClientId);
       }

   }

regards,

Martin

> Extended Data Table: Action Event delivered more than one time
> --------------------------------------------------------------
>
>          Key: MYFACES-1010
>          URL: http://issues.apache.org/jira/browse/MYFACES-1010
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk (RI Compatability)
>     Versions: 1.1.1
>  Environment: Apache Tomcat 5.5.12 or OC4j 10.1.3 DP4, Win Xp, Sun  RI 1.1.01 , JDK 1.5
>     Reporter: Claudio Tasso

>
> Hi,
> I'm trying using Tomahawk t:dataTable and it seems to me that its behaviour is very different from the standard  JSF h:dataTable.
> Consider a column which contains a command button and a table with two rows. When the user clicks on the button of the first row, two action events are generated!
> For example, look at this very simple code:
> <f:view>
>    <h:form>
>        <h:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.uiData}">
>            <h:column>
>                <h:commandButton value="Test" action="#{testBean.test}"></h:commandButton>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </h:column>
>        </h:dataTable>
>              <t:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.htmlDataTable}" preserveDataModel="false">
>            <t:column>
>                <h:commandButton value="Test" action="#{testBean.test2}"></h:commandButton>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </t:column>
>        </t:dataTable>
>    </h:form>
> </f:view>
> When the user clicks the "Test" button of the h:dataTable, the "testBean.test" method is executed just one time.
> But when the user clicks the "Test" button of the t:dataTable the "testBean.test2" method is executed twice ( or three times if the table has 3 rows, and so on...).
> I suppose  that the problem is that the elements of  t:dataTable which belongs to differnt rows have the same ID, and during the processDecode phase the same event is broadcasted more than one time.
> In fact, this is the html code which is generated by Tomahawk extended datatable:
> <table>
> <tbody id="_id0:_id8:tbody_element">
> <tr>
> <td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr><td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr></tbody>
> </table>
> and this is the html code which is generated by RI h:dataTable:
> <table>
> <tbody>
> <tr>
> <td><input type="submit" name="_id0:_id1:0:_id3" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr>
> <td><input type="submit" name="_id0:_id1:1:_id3" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr>
> </tbody>
> </table>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1010) Extended Data Table: Action Event delivered more than one time

Posted by "Dennis Byrne (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1010?page=comments#action_12362091 ] 

Dennis Byrne commented on MYFACES-1010:
---------------------------------------

... not an isolated incident.

http://www.mail-archive.com/users%40myfaces.apache.org/msg14304.html

> Extended Data Table: Action Event delivered more than one time
> --------------------------------------------------------------
>
>          Key: MYFACES-1010
>          URL: http://issues.apache.org/jira/browse/MYFACES-1010
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk (RI Compatability)
>     Versions: 1.1.1
>  Environment: Apache Tomcat 5.5.12 or OC4j 10.1.3 DP4, Win Xp, Sun  RI 1.1.01 , JDK 1.5
>     Reporter: Claudio Tasso

>
> Hi,
> I'm trying using Tomahawk t:dataTable and it seems to me that its behaviour is very different from the standard  JSF h:dataTable.
> Consider a column which contains a command button and a table with two rows. When the user clicks on the button of the first row, two action events are generated!
> For example, look at this very simple code:
> <f:view>
>    <h:form>
>        <h:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.uiData}">
>            <h:column>
>                <h:commandButton value="Test" action="#{testBean.test}"></h:commandButton>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </h:column>
>        </h:dataTable>
>              <t:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.htmlDataTable}" preserveDataModel="false">
>            <t:column>
>                <h:commandButton value="Test" action="#{testBean.test2}"></h:commandButton>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </t:column>
>        </t:dataTable>
>    </h:form>
> </f:view>
> When the user clicks the "Test" button of the h:dataTable, the "testBean.test" method is executed just one time.
> But when the user clicks the "Test" button of the t:dataTable the "testBean.test2" method is executed twice ( or three times if the table has 3 rows, and so on...).
> I suppose  that the problem is that the elements of  t:dataTable which belongs to differnt rows have the same ID, and during the processDecode phase the same event is broadcasted more than one time.
> In fact, this is the html code which is generated by Tomahawk extended datatable:
> <table>
> <tbody id="_id0:_id8:tbody_element">
> <tr>
> <td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr><td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr></tbody>
> </table>
> and this is the html code which is generated by RI h:dataTable:
> <table>
> <tbody>
> <tr>
> <td><input type="submit" name="_id0:_id1:0:_id3" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr>
> <td><input type="submit" name="_id0:_id1:1:_id3" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr>
> </tbody>
> </table>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1010) Extended Data Table: Action Event delivered more than one time

Posted by "David Donn (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1010?page=comments#action_12364433 ] 

David Donn commented on MYFACES-1010:
-------------------------------------

Any news on the progress of this issue? I suppose it's pretty obvious but technque such as http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters scenario 2 won't work because of this issue.

> Extended Data Table: Action Event delivered more than one time
> --------------------------------------------------------------
>
>          Key: MYFACES-1010
>          URL: http://issues.apache.org/jira/browse/MYFACES-1010
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk (RI Compatability)
>     Versions: 1.1.1
>  Environment: Apache Tomcat 5.5.12 or OC4j 10.1.3 DP4, Win Xp, Sun  RI 1.1.01 , JDK 1.5
>     Reporter: Claudio Tasso

>
> Hi,
> I'm trying using Tomahawk t:dataTable and it seems to me that its behaviour is very different from the standard  JSF h:dataTable.
> Consider a column which contains a command button and a table with two rows. When the user clicks on the button of the first row, two action events are generated!
> For example, look at this very simple code:
> <f:view>
>    <h:form>
>        <h:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.uiData}">
>            <h:column>
>                <h:commandButton value="Test" action="#{testBean.test}"></h:commandButton>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </h:column>
>        </h:dataTable>
>              <t:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.htmlDataTable}" preserveDataModel="false">
>            <t:column>
>                <h:commandButton value="Test" action="#{testBean.test2}"></h:commandButton>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </t:column>
>        </t:dataTable>
>    </h:form>
> </f:view>
> When the user clicks the "Test" button of the h:dataTable, the "testBean.test" method is executed just one time.
> But when the user clicks the "Test" button of the t:dataTable the "testBean.test2" method is executed twice ( or three times if the table has 3 rows, and so on...).
> I suppose  that the problem is that the elements of  t:dataTable which belongs to differnt rows have the same ID, and during the processDecode phase the same event is broadcasted more than one time.
> In fact, this is the html code which is generated by Tomahawk extended datatable:
> <table>
> <tbody id="_id0:_id8:tbody_element">
> <tr>
> <td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr><td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr></tbody>
> </table>
> and this is the html code which is generated by RI h:dataTable:
> <table>
> <tbody>
> <tr>
> <td><input type="submit" name="_id0:_id1:0:_id3" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr>
> <td><input type="submit" name="_id0:_id1:1:_id3" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr>
> </tbody>
> </table>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1010) Extended Data Table: Action Event delivered more than one time

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1010?page=comments#action_12364488 ] 

Martin Marinschek commented on MYFACES-1010:
--------------------------------------------

Ed Burns has already responded - in record time, that's his answer:

https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=230



User edburns changed the following:

               What    |Old value                 |New value
================================================================================
            Assigned to|javaserverfowner          |edburns
--------------------------------------------------------------------------------




------- Additional comments from edburns@dev.java.net Mon Jan 30 17:24:22 +0000 2006 -------
Please look at
<https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=58> for
related details.

I have confirmed this exists in the latest Sun JSF 1.1 series and will produce a
fix.

> Extended Data Table: Action Event delivered more than one time
> --------------------------------------------------------------
>
>          Key: MYFACES-1010
>          URL: http://issues.apache.org/jira/browse/MYFACES-1010
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk (RI Compatability)
>     Versions: 1.1.1
>  Environment: Apache Tomcat 5.5.12 or OC4j 10.1.3 DP4, Win Xp, Sun  RI 1.1.01 , JDK 1.5
>     Reporter: Claudio Tasso

>
> Hi,
> I'm trying using Tomahawk t:dataTable and it seems to me that its behaviour is very different from the standard  JSF h:dataTable.
> Consider a column which contains a command button and a table with two rows. When the user clicks on the button of the first row, two action events are generated!
> For example, look at this very simple code:
> <f:view>
>    <h:form>
>        <h:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.uiData}">
>            <h:column>
>                <h:commandButton value="Test" action="#{testBean.test}"></h:commandButton>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </h:column>
>        </h:dataTable>
>              <t:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.htmlDataTable}" preserveDataModel="false">
>            <t:column>
>                <h:commandButton value="Test" action="#{testBean.test2}"></h:commandButton>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </t:column>
>        </t:dataTable>
>    </h:form>
> </f:view>
> When the user clicks the "Test" button of the h:dataTable, the "testBean.test" method is executed just one time.
> But when the user clicks the "Test" button of the t:dataTable the "testBean.test2" method is executed twice ( or three times if the table has 3 rows, and so on...).
> I suppose  that the problem is that the elements of  t:dataTable which belongs to differnt rows have the same ID, and during the processDecode phase the same event is broadcasted more than one time.
> In fact, this is the html code which is generated by Tomahawk extended datatable:
> <table>
> <tbody id="_id0:_id8:tbody_element">
> <tr>
> <td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr><td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr></tbody>
> </table>
> and this is the html code which is generated by RI h:dataTable:
> <table>
> <tbody>
> <tr>
> <td><input type="submit" name="_id0:_id1:0:_id3" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr>
> <td><input type="submit" name="_id0:_id1:1:_id3" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr>
> </tbody>
> </table>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1010) Extended Data Table: Action Event delivered more than one time

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1010?page=comments#action_12362312 ] 

Martin Marinschek commented on MYFACES-1010:
--------------------------------------------

Yes, that's a solution.

But still, the RI is doing something not entirely good here.

regards,

Martin

> Extended Data Table: Action Event delivered more than one time
> --------------------------------------------------------------
>
>          Key: MYFACES-1010
>          URL: http://issues.apache.org/jira/browse/MYFACES-1010
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk (RI Compatability)
>     Versions: 1.1.1
>  Environment: Apache Tomcat 5.5.12 or OC4j 10.1.3 DP4, Win Xp, Sun  RI 1.1.01 , JDK 1.5
>     Reporter: Claudio Tasso

>
> Hi,
> I'm trying using Tomahawk t:dataTable and it seems to me that its behaviour is very different from the standard  JSF h:dataTable.
> Consider a column which contains a command button and a table with two rows. When the user clicks on the button of the first row, two action events are generated!
> For example, look at this very simple code:
> <f:view>
>    <h:form>
>        <h:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.uiData}">
>            <h:column>
>                <h:commandButton value="Test" action="#{testBean.test}"></h:commandButton>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </h:column>
>        </h:dataTable>
>              <t:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.htmlDataTable}" preserveDataModel="false">
>            <t:column>
>                <h:commandButton value="Test" action="#{testBean.test2}"></h:commandButton>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </t:column>
>        </t:dataTable>
>    </h:form>
> </f:view>
> When the user clicks the "Test" button of the h:dataTable, the "testBean.test" method is executed just one time.
> But when the user clicks the "Test" button of the t:dataTable the "testBean.test2" method is executed twice ( or three times if the table has 3 rows, and so on...).
> I suppose  that the problem is that the elements of  t:dataTable which belongs to differnt rows have the same ID, and during the processDecode phase the same event is broadcasted more than one time.
> In fact, this is the html code which is generated by Tomahawk extended datatable:
> <table>
> <tbody id="_id0:_id8:tbody_element">
> <tr>
> <td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr><td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr></tbody>
> </table>
> and this is the html code which is generated by RI h:dataTable:
> <table>
> <tbody>
> <tr>
> <td><input type="submit" name="_id0:_id1:0:_id3" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr>
> <td><input type="submit" name="_id0:_id1:1:_id3" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr>
> </tbody>
> </table>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1010) Extended Data Table: Action Event delivered more than one time

Posted by "Mathias Broekelmann (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1010?page=comments#action_12362262 ] 

Mathias Broekelmann commented on MYFACES-1010:
----------------------------------------------

I took a closer look into the sources. I now think that we should not call super.setRowIndex(..) at all.
The problem is that this method implements the most tricky part of the UIData class. It stores and restores the state of the nested components to iterate through the rows. If we do it we would at least get the state saving/restoring done 3 times (HtmlDataTableHack will do this a 3rd. time). I will not say that this is not possible to do. It´s probably more a problem where we should call the super method in setRowIndex. But after all it´s still a workaround.

The best solution would be to change the code in RI. Why do they not call getRowIndex() in getClientId()?

> Extended Data Table: Action Event delivered more than one time
> --------------------------------------------------------------
>
>          Key: MYFACES-1010
>          URL: http://issues.apache.org/jira/browse/MYFACES-1010
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk (RI Compatability)
>     Versions: 1.1.1
>  Environment: Apache Tomcat 5.5.12 or OC4j 10.1.3 DP4, Win Xp, Sun  RI 1.1.01 , JDK 1.5
>     Reporter: Claudio Tasso

>
> Hi,
> I'm trying using Tomahawk t:dataTable and it seems to me that its behaviour is very different from the standard  JSF h:dataTable.
> Consider a column which contains a command button and a table with two rows. When the user clicks on the button of the first row, two action events are generated!
> For example, look at this very simple code:
> <f:view>
>    <h:form>
>        <h:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.uiData}">
>            <h:column>
>                <h:commandButton value="Test" action="#{testBean.test}"></h:commandButton>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </h:column>
>        </h:dataTable>
>              <t:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.htmlDataTable}" preserveDataModel="false">
>            <t:column>
>                <h:commandButton value="Test" action="#{testBean.test2}"></h:commandButton>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </t:column>
>        </t:dataTable>
>    </h:form>
> </f:view>
> When the user clicks the "Test" button of the h:dataTable, the "testBean.test" method is executed just one time.
> But when the user clicks the "Test" button of the t:dataTable the "testBean.test2" method is executed twice ( or three times if the table has 3 rows, and so on...).
> I suppose  that the problem is that the elements of  t:dataTable which belongs to differnt rows have the same ID, and during the processDecode phase the same event is broadcasted more than one time.
> In fact, this is the html code which is generated by Tomahawk extended datatable:
> <table>
> <tbody id="_id0:_id8:tbody_element">
> <tr>
> <td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr><td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr></tbody>
> </table>
> and this is the html code which is generated by RI h:dataTable:
> <table>
> <tbody>
> <tr>
> <td><input type="submit" name="_id0:_id1:0:_id3" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr>
> <td><input type="submit" name="_id0:_id1:1:_id3" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr>
> </tbody>
> </table>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1010) Extended Data Table: Action Event delivered more than one time

Posted by "Mathias Broekelmann (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1010?page=comments#action_12362311 ] 

Mathias Broekelmann commented on MYFACES-1010:
----------------------------------------------

how about implementing the getClientId method in myfaces t:datatable which would then call getRowIndex()?

> Extended Data Table: Action Event delivered more than one time
> --------------------------------------------------------------
>
>          Key: MYFACES-1010
>          URL: http://issues.apache.org/jira/browse/MYFACES-1010
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk (RI Compatability)
>     Versions: 1.1.1
>  Environment: Apache Tomcat 5.5.12 or OC4j 10.1.3 DP4, Win Xp, Sun  RI 1.1.01 , JDK 1.5
>     Reporter: Claudio Tasso

>
> Hi,
> I'm trying using Tomahawk t:dataTable and it seems to me that its behaviour is very different from the standard  JSF h:dataTable.
> Consider a column which contains a command button and a table with two rows. When the user clicks on the button of the first row, two action events are generated!
> For example, look at this very simple code:
> <f:view>
>    <h:form>
>        <h:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.uiData}">
>            <h:column>
>                <h:commandButton value="Test" action="#{testBean.test}"></h:commandButton>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </h:column>
>        </h:dataTable>
>              <t:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.htmlDataTable}" preserveDataModel="false">
>            <t:column>
>                <h:commandButton value="Test" action="#{testBean.test2}"></h:commandButton>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </t:column>
>        </t:dataTable>
>    </h:form>
> </f:view>
> When the user clicks the "Test" button of the h:dataTable, the "testBean.test" method is executed just one time.
> But when the user clicks the "Test" button of the t:dataTable the "testBean.test2" method is executed twice ( or three times if the table has 3 rows, and so on...).
> I suppose  that the problem is that the elements of  t:dataTable which belongs to differnt rows have the same ID, and during the processDecode phase the same event is broadcasted more than one time.
> In fact, this is the html code which is generated by Tomahawk extended datatable:
> <table>
> <tbody id="_id0:_id8:tbody_element">
> <tr>
> <td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr><td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr></tbody>
> </table>
> and this is the html code which is generated by RI h:dataTable:
> <table>
> <tbody>
> <tr>
> <td><input type="submit" name="_id0:_id1:0:_id3" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr>
> <td><input type="submit" name="_id0:_id1:1:_id3" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr>
> </tbody>
> </table>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1010) Extended Data Table: Action Event delivered more than one time

Posted by "Claudio Tasso (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1010?page=comments#action_12362253 ] 

Claudio Tasso commented on MYFACES-1010:
----------------------------------------

Why do you think that super.setRowIndex() should be called only when myfaces impl is not used?
What problems can occur if super.setRowIndex() is called always (without caring about which impl is used)? 

> Extended Data Table: Action Event delivered more than one time
> --------------------------------------------------------------
>
>          Key: MYFACES-1010
>          URL: http://issues.apache.org/jira/browse/MYFACES-1010
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk (RI Compatability)
>     Versions: 1.1.1
>  Environment: Apache Tomcat 5.5.12 or OC4j 10.1.3 DP4, Win Xp, Sun  RI 1.1.01 , JDK 1.5
>     Reporter: Claudio Tasso

>
> Hi,
> I'm trying using Tomahawk t:dataTable and it seems to me that its behaviour is very different from the standard  JSF h:dataTable.
> Consider a column which contains a command button and a table with two rows. When the user clicks on the button of the first row, two action events are generated!
> For example, look at this very simple code:
> <f:view>
>    <h:form>
>        <h:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.uiData}">
>            <h:column>
>                <h:commandButton value="Test" action="#{testBean.test}"></h:commandButton>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </h:column>
>        </h:dataTable>
>              <t:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.htmlDataTable}" preserveDataModel="false">
>            <t:column>
>                <h:commandButton value="Test" action="#{testBean.test2}"></h:commandButton>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </t:column>
>        </t:dataTable>
>    </h:form>
> </f:view>
> When the user clicks the "Test" button of the h:dataTable, the "testBean.test" method is executed just one time.
> But when the user clicks the "Test" button of the t:dataTable the "testBean.test2" method is executed twice ( or three times if the table has 3 rows, and so on...).
> I suppose  that the problem is that the elements of  t:dataTable which belongs to differnt rows have the same ID, and during the processDecode phase the same event is broadcasted more than one time.
> In fact, this is the html code which is generated by Tomahawk extended datatable:
> <table>
> <tbody id="_id0:_id8:tbody_element">
> <tr>
> <td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr><td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr></tbody>
> </table>
> and this is the html code which is generated by RI h:dataTable:
> <table>
> <tbody>
> <tr>
> <td><input type="submit" name="_id0:_id1:0:_id3" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr>
> <td><input type="submit" name="_id0:_id1:1:_id3" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr>
> </tbody>
> </table>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1010) Extended Data Table: Action Event delivered more than one time

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1010?page=comments#action_12364443 ] 

Martin Marinschek commented on MYFACES-1010:
--------------------------------------------

I've looked up what we would have to do due to this problem in MyFaces - and I don't like what I've seen.

Instead, I've filed a bug with the JSF-RI (javaserverfaces-sources). That's really something that should be fixed over there.

regards,

Martin

> Extended Data Table: Action Event delivered more than one time
> --------------------------------------------------------------
>
>          Key: MYFACES-1010
>          URL: http://issues.apache.org/jira/browse/MYFACES-1010
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk (RI Compatability)
>     Versions: 1.1.1
>  Environment: Apache Tomcat 5.5.12 or OC4j 10.1.3 DP4, Win Xp, Sun  RI 1.1.01 , JDK 1.5
>     Reporter: Claudio Tasso

>
> Hi,
> I'm trying using Tomahawk t:dataTable and it seems to me that its behaviour is very different from the standard  JSF h:dataTable.
> Consider a column which contains a command button and a table with two rows. When the user clicks on the button of the first row, two action events are generated!
> For example, look at this very simple code:
> <f:view>
>    <h:form>
>        <h:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.uiData}">
>            <h:column>
>                <h:commandButton value="Test" action="#{testBean.test}"></h:commandButton>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </h:column>
>        </h:dataTable>
>              <t:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.htmlDataTable}" preserveDataModel="false">
>            <t:column>
>                <h:commandButton value="Test" action="#{testBean.test2}"></h:commandButton>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </t:column>
>        </t:dataTable>
>    </h:form>
> </f:view>
> When the user clicks the "Test" button of the h:dataTable, the "testBean.test" method is executed just one time.
> But when the user clicks the "Test" button of the t:dataTable the "testBean.test2" method is executed twice ( or three times if the table has 3 rows, and so on...).
> I suppose  that the problem is that the elements of  t:dataTable which belongs to differnt rows have the same ID, and during the processDecode phase the same event is broadcasted more than one time.
> In fact, this is the html code which is generated by Tomahawk extended datatable:
> <table>
> <tbody id="_id0:_id8:tbody_element">
> <tr>
> <td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr><td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr></tbody>
> </table>
> and this is the html code which is generated by RI h:dataTable:
> <table>
> <tbody>
> <tr>
> <td><input type="submit" name="_id0:_id1:0:_id3" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr>
> <td><input type="submit" name="_id0:_id1:1:_id3" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr>
> </tbody>
> </table>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-1010) Extended Data Table: Action Event delivered more than one time

Posted by "Claudio Tasso (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1010?page=comments#action_12362127 ] 

Claudio Tasso commented on MYFACES-1010:
----------------------------------------

Ok, I suppose that I found the problem.
This is the SUN RI  UIData.getClientId() method:

public String getClientId(FacesContext context) {

        if (context == null) {
            throw new NullPointerException();
        }
	String baseClientId = super.getClientId(context);
        if (rowIndex >= 0) {
            return (baseClientId + NamingContainer.SEPARATOR_CHAR + rowIndex);
        } else {
            return (baseClientId);
        }
    }

As you can see, the rowIndex is checked. 
But  org.apache.myfaces.component.html.ext.HtmlDataTableHack.setRowIndex(int rowIndex) does NOT call

super.setRowIndex(rowIndex)

so the rowIndex property of UIData is always -1 and the client ID is not calculated according to the current row.
As a final result, the generated  html page does not contain the proper ids.

Adding "super.setRowIndex(rowIndex)" at the beginning of HtmlDataTableHack.setRowIndex() solve this problem.



> Extended Data Table: Action Event delivered more than one time
> --------------------------------------------------------------
>
>          Key: MYFACES-1010
>          URL: http://issues.apache.org/jira/browse/MYFACES-1010
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk (RI Compatability)
>     Versions: 1.1.1
>  Environment: Apache Tomcat 5.5.12 or OC4j 10.1.3 DP4, Win Xp, Sun  RI 1.1.01 , JDK 1.5
>     Reporter: Claudio Tasso

>
> Hi,
> I'm trying using Tomahawk t:dataTable and it seems to me that its behaviour is very different from the standard  JSF h:dataTable.
> Consider a column which contains a command button and a table with two rows. When the user clicks on the button of the first row, two action events are generated!
> For example, look at this very simple code:
> <f:view>
>    <h:form>
>        <h:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.uiData}">
>            <h:column>
>                <h:commandButton value="Test" action="#{testBean.test}"></h:commandButton>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </h:column>
>            <h:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </h:column>
>        </h:dataTable>
>              <t:dataTable value="#{testBean.persons}" var="item" binding="#{testBean.htmlDataTable}" preserveDataModel="false">
>            <t:column>
>                <h:commandButton value="Test" action="#{testBean.test2}"></h:commandButton>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.name}"></h:outputText>
>            </t:column>
>            <t:column>
>                <h:outputText value="#{item.surname}"></h:outputText>
>            </t:column>
>        </t:dataTable>
>    </h:form>
> </f:view>
> When the user clicks the "Test" button of the h:dataTable, the "testBean.test" method is executed just one time.
> But when the user clicks the "Test" button of the t:dataTable the "testBean.test2" method is executed twice ( or three times if the table has 3 rows, and so on...).
> I suppose  that the problem is that the elements of  t:dataTable which belongs to differnt rows have the same ID, and during the processDecode phase the same event is broadcasted more than one time.
> In fact, this is the html code which is generated by Tomahawk extended datatable:
> <table>
> <tbody id="_id0:_id8:tbody_element">
> <tr>
> <td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr><td><input type="submit" name="_id0:_id8:_id10" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr></tbody>
> </table>
> and this is the html code which is generated by RI h:dataTable:
> <table>
> <tbody>
> <tr>
> <td><input type="submit" name="_id0:_id1:0:_id3" value="Test" /></td>
> <td>John</td>
> <td>Smith</td>
> </tr>
> <tr>
> <td><input type="submit" name="_id0:_id1:1:_id3" value="Test" /></td>
> <td>Mark</td>
> <td>Greene</td>
> </tr>
> </tbody>
> </table>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira