Hi All,

does nobody encounter this usecase ?

The wierd things are:
- why childs elements do not call the setSelected method at all ?
- why main elements (folder1, folder2) call several times the setSelected
method ?

does anyone encounter the same problem ? is there something wrong in my
implementation ?

note that the use of selectBooleanCheckbox inside dataTable without tree2
works correctly.

Thanx for any comment.

Sebastien

On 3/9/07, Sébastien LEVER <[EMAIL PROTECTED]> wrote:

My usecase is a dataTable contaning checkedNodes trees.

The checkBoxes events are managed correctly when there is 1 row.

From two rows, problems happened:

for this 2 rows structure:
-[]folder1
 -[]file1
 -[]file2
---------------------------------------------------
-[]folder2
 -[]file3
 -[]file4

If I check folder1 node, folder 1 is unchecked by backend actions (if
folder1 is expanded, it expands folder2).
 log:
 folder2.selectedValueChange(), oldValue: false, newValue: true
 folder2.setSelected(true) HAS CHANGED !
 folder2.setSelected(true)
 folder2.setSelected(false) HAS CHANGED !

If I check folder2 node (all folder collapsed), folder 2 is checked by
backend actions.
 log:
 folder2.selectedValueChange(), oldValue: false, newValue: true
 folder2.setSelected(true) HAS CHANGED !
 folder2.setSelected(false) HAS CHANGED !
 folder2.setSelected(true) HAS CHANGED !

Here is the page structure:

<h:dataTable var="tableItem" id="table" value="#{table.data}"
       preserveDataModel="false" preserveSort="false" sortable="false"
       styleClass="standardTable" headerClass="standardTable_Header"
       footerClass="standardTable_Header"
       rowClasses="standardTable_Row1,standardTable_Row2"
       columnClasses="standardTable_Column, standardTable_ColumnCentered,
standardTable_Column">
       <ui:param name="sortedCol" value="#{table.sortedColumn}" />
       <t:column defaultSorted="true" >
               <f:facet name="header">
                       <h:outputText value="#{ bundle.tableColumnName}" />
               </f:facet>
               <h:panelGroup rendered="#{tableItem.type=='folder'
&amp;&amp; tableItem.node.childs}">
                       <t:tree2 value="#{ tableItem.node}"
                               var="subnode"
                               showLines="false" >
                               <f:facet name="folder">
                                       <h:panelGroup>
                                               <h:selectBooleanCheckbox
                                                       id="_check"
                                                       value="#{
subnode.infoBean.selected}"

 valueChangeListener="#{subnode.infoBean.selectedValueChange }"
                                                       onclick="
this.form.submit()"/>
                                               <h:outputText value="#{
subnode.description}" />
                                       </h:panelGroup>
                               </f:facet>
                               <f:facet name="file">
                                       <h:panelGroup>
                                               <h:selectBooleanCheckbox
                                                       id="_check"
                                                       value="#{
subnode.infoBean.selected}"

 valueChangeListener="#{subnode.infoBean.selectedValueChange}"
                                                       onclick="
this.form.submit()"/>
                                               <h:outputText value="#{
subnode.description}" />
                                       </h:panelGroup>
                               </f:facet>
                       </t:tree2>
               </h:panelGroup>
       </t:column>
</h:dataTable>


issue exists for this problem:
https://issues.apache.org/jira/browse/TOMAHAWK-926<https://issues.apache.org/jira/browse/TOMAHAWK-926>

Many thanx for your reply

Sébastien

Reply via email to