You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Chris Hane <ch...@gmail.com> on 2007/10/11 22:13:06 UTC

[Trinidad] TreeTable Skinning Options?

Is it possible to do any of the following with the TreeTable component.

1) Can the "Select All | Select None" be turned off and not show in
    the table header?

2) Is it possible to have a "select" checkbox appear for only SOME rows?
    I have a list of libraries and each library has a list of dvds.  I
    want only the DVDs to be selectable.

3) Is it possible to turn off the expand arrow on specific rows?
    For example, the DVDs do not have anything below them and
    do not need expand arrows

I am creating the TreeModel using

    new ChildPropertyTreeModel(root, "children");

Should I use something else to get any of the above?  A pointer in the 
right direction would be much appreciated.

Where root is:

   root = new TransferObject();

public class TransferObject{
  public String name;
  public List<TransferObject> children;
  ...and getters/setters
}

The facelet code to display the tree is:


<tr:treeTable var="foo"
               value="#{learn.admin.contact.course.lister.tree}"
               rowSelection="multiple"
               rowsByDepth="100"
               expandAllEnabled="false">
    <f:facet name="nodeStamp">
       <tr:column>
          <f:facet name="header">
            <tr:outputText value="Library/DVD"/>
          </f:facet>
          <tr:outputFormatted
                value="#{foo.name} : #{foo.type} : #{foo.id}"/>
       </tr:column>
    </f:facet>
</tr:treeTable>

Thanks,
Chris....

RE: [Trinidad] TreeTable Skinning Options?

Posted by Todd Engle <To...@trisyngroup.com>.
 Incorrect URL in last post -- here is the correct one:


-----Original Message-----
From: Todd Engle [mailto:Todd.Engle@trisyngroup.com] 
Sent: Monday, October 15, 2007 4:12 PM
To: MyFaces Discussion
Subject: RE: [Trinidad] TreeTable Skinning Options?

Chris, 

I found this posting and was able to conditionally set the visibility
for the checkboxes -- it was a great help and only took about 10 minutes
to implement:

http://mail-archives.apache.org/mod_mbox/incubator-adffaces-user/200612.
mbox/%3C885AADC3D2318E45807C702ABC2637DD133B40@MOES0037.tcc.local%3E

HTH,
Todd

-----Original Message-----
From: Chris Hane [mailto:chrishane@gmail.com]
Sent: Friday, October 12, 2007 2:30 AM
To: MyFaces Discussion
Subject: Re: [Trinidad] TreeTable Skinning Options?

Cristi - thanks for the info on setting the "children" property to null
and not just empty.  That did the trick for my question #3.

1) Can the "Select All | Select None" be turned off and not show in
    the table header?

 > 1. it's probably related to using rowSelection="multiple"
 > if you don't specify that, the links will not be rendererd

However, I want some of the selection boxes to appear.  Some defined by
my question #2.  So turning of "rowSelection" isn't an option.  Or maybe
there is another way to have selection boxes appear?

2) Is it possible to have a "select" checkbox appear for only SOME rows?
    I have a list of libraries and each library has a list of dvds.  I
    want only the DVDs to be selectable.


Thanks again - the #3 question really helps the GUI, Chris....


Cristi Toth wrote:
> Hi Chris,
> 
> 1. it's probably related to using rowSelection="multiple"
> if you don't specify that, the links will not be rendererd
> 
> 3. the model it's a tree, so the leafs don't have the expand/collapse 
> icon rendered BUT for a node to be a leaf it has to have the 
> 'children' property set to null (not an empty list)
> 
> On 10/11/07, *Chris Hane* < chrishane@gmail.com 
> <ma...@gmail.com>> wrote:
> 
>     Is it possible to do any of the following with the TreeTable
component.
> 
>     1) Can the "Select All | Select None" be turned off and not show
in
>         the table header?
> 
>     2) Is it possible to have a "select" checkbox appear for only SOME
rows?
>         I have a list of libraries and each library has a list of
dvds.  I
>         want only the DVDs to be selectable.
> 
>     3) Is it possible to turn off the expand arrow on specific rows?
>         For example, the DVDs do not have anything below them and
>         do not need expand arrows
> 
>     I am creating the TreeModel using
> 
>         new ChildPropertyTreeModel(root, "children");
> 
>     Should I use something else to get any of the above?  A pointer in
the
>     right direction would be much appreciated.
> 
>     Where root is:
> 
>        root = new TransferObject();
> 
>     public class TransferObject{
>       public String name;
>       public List<TransferObject> children;
>       ...and getters/setters
>     }
> 
>     The facelet code to display the tree is:
> 
> 
>     <tr:treeTable var="foo"
>                    value="#{learn.admin.contact.course.lister.tree}"
>                    rowSelection="multiple"
>                    rowsByDepth="100"
>                    expandAllEnabled="false">
>         <f:facet name="nodeStamp">
>            <tr:column>
>               <f:facet name="header">
>                 <tr:outputText value="Library/DVD"/>
>               </f:facet>
>               <tr:outputFormatted
>                     value="#{foo.name <http://foo.name>} : #{foo.type}
:
>     #{foo.id <http://foo.id>}"/>
>            </tr:column>
>         </f:facet>
>     </tr:treeTable>
> 
>     Thanks,
>     Chris....
> 
> 
> 
> 
> --
> Cristi Toth
> 
> -------------
> Codebeat
> www.codebeat.ro <http://www.codebeat.ro>

Re: [Trinidad] TreeTable Skinning Options?

Posted by Chris Hane <ch...@gmail.com>.
Todd,

Thanks for the link.   I usually check the incubation lists and forgot this 
time.  Figures....

I noticed that this solution is using a component "binding".  Hopefully I 
can figure out a similar hack without the binding.  I'm using Seam and 
component bindings do not work.

Thanks again for the pointer, I appreciate your help.

Chris....

Todd Engle wrote:
> OK, hopefully the 3rd time is the charm -- here is the correct URL:
> 
> http://mail-archives.apache.org/mod_mbox/incubator-adffaces-user/200612.
> mbox/%3C885AADC3D2318E45807C702ABC2637DD133B40@MOES0037.tcc.local%3E 
> 
> 
> -----Original Message-----
> From: Todd Engle [mailto:Todd.Engle@trisyngroup.com] 
> Sent: Monday, October 15, 2007 4:12 PM
> To: MyFaces Discussion
> Subject: RE: [Trinidad] TreeTable Skinning Options?
> 
> Chris, 
> 
> I found this posting and was able to conditionally set the visibility
> for the checkboxes -- it was a great help and only took about 10 minutes
> to implement:
> 
> http://mail-archives.apache.org/mod_mbox/incubator-adffaces-user/200612.
> mbox/%3C885AADC3D2318E45807C702ABC2637DD133B40@MOES0037.tcc.local%3E
> 
> HTH,
> Todd
> 
> -----Original Message-----
> From: Chris Hane [mailto:chrishane@gmail.com]
> Sent: Friday, October 12, 2007 2:30 AM
> To: MyFaces Discussion
> Subject: Re: [Trinidad] TreeTable Skinning Options?
> 
> Cristi - thanks for the info on setting the "children" property to null
> and not just empty.  That did the trick for my question #3.
> 
> 1) Can the "Select All | Select None" be turned off and not show in
>     the table header?
> 
>  > 1. it's probably related to using rowSelection="multiple"
>  > if you don't specify that, the links will not be rendererd
> 
> However, I want some of the selection boxes to appear.  Some defined by
> my question #2.  So turning of "rowSelection" isn't an option.  Or maybe
> there is another way to have selection boxes appear?
> 
> 2) Is it possible to have a "select" checkbox appear for only SOME rows?
>     I have a list of libraries and each library has a list of dvds.  I
>     want only the DVDs to be selectable.
> 
> 
> Thanks again - the #3 question really helps the GUI, Chris....
> 
> 
> Cristi Toth wrote:
>> Hi Chris,
>>
>> 1. it's probably related to using rowSelection="multiple"
>> if you don't specify that, the links will not be rendererd
>>
>> 3. the model it's a tree, so the leafs don't have the expand/collapse 
>> icon rendered BUT for a node to be a leaf it has to have the 
>> 'children' property set to null (not an empty list)
>>
>> On 10/11/07, *Chris Hane* < chrishane@gmail.com 
>> <ma...@gmail.com>> wrote:
>>
>>     Is it possible to do any of the following with the TreeTable
> component.
>>     1) Can the "Select All | Select None" be turned off and not show
> in
>>         the table header?
>>
>>     2) Is it possible to have a "select" checkbox appear for only SOME
> rows?
>>         I have a list of libraries and each library has a list of
> dvds.  I
>>         want only the DVDs to be selectable.
>>
>>     3) Is it possible to turn off the expand arrow on specific rows?
>>         For example, the DVDs do not have anything below them and
>>         do not need expand arrows
>>
>>     I am creating the TreeModel using
>>
>>         new ChildPropertyTreeModel(root, "children");
>>
>>     Should I use something else to get any of the above?  A pointer in
> the
>>     right direction would be much appreciated.
>>
>>     Where root is:
>>
>>        root = new TransferObject();
>>
>>     public class TransferObject{
>>       public String name;
>>       public List<TransferObject> children;
>>       ...and getters/setters
>>     }
>>
>>     The facelet code to display the tree is:
>>
>>
>>     <tr:treeTable var="foo"
>>                    value="#{learn.admin.contact.course.lister.tree}"
>>                    rowSelection="multiple"
>>                    rowsByDepth="100"
>>                    expandAllEnabled="false">
>>         <f:facet name="nodeStamp">
>>            <tr:column>
>>               <f:facet name="header">
>>                 <tr:outputText value="Library/DVD"/>
>>               </f:facet>
>>               <tr:outputFormatted
>>                     value="#{foo.name <http://foo.name>} : #{foo.type}
> :
>>     #{foo.id <http://foo.id>}"/>
>>            </tr:column>
>>         </f:facet>
>>     </tr:treeTable>
>>
>>     Thanks,
>>     Chris....
>>
>>
>>
>>
>> --
>> Cristi Toth
>>
>> -------------
>> Codebeat
>> www.codebeat.ro <http://www.codebeat.ro>
> 

RE: [Trinidad] TreeTable Skinning Options?

Posted by Todd Engle <To...@trisyngroup.com>.
OK, hopefully the 3rd time is the charm -- here is the correct URL:

http://mail-archives.apache.org/mod_mbox/incubator-adffaces-user/200612.
mbox/%3C885AADC3D2318E45807C702ABC2637DD133B40@MOES0037.tcc.local%3E 


-----Original Message-----
From: Todd Engle [mailto:Todd.Engle@trisyngroup.com] 
Sent: Monday, October 15, 2007 4:12 PM
To: MyFaces Discussion
Subject: RE: [Trinidad] TreeTable Skinning Options?

Chris, 

I found this posting and was able to conditionally set the visibility
for the checkboxes -- it was a great help and only took about 10 minutes
to implement:

http://mail-archives.apache.org/mod_mbox/incubator-adffaces-user/200612.
mbox/%3C885AADC3D2318E45807C702ABC2637DD133B40@MOES0037.tcc.local%3E

HTH,
Todd

-----Original Message-----
From: Chris Hane [mailto:chrishane@gmail.com]
Sent: Friday, October 12, 2007 2:30 AM
To: MyFaces Discussion
Subject: Re: [Trinidad] TreeTable Skinning Options?

Cristi - thanks for the info on setting the "children" property to null
and not just empty.  That did the trick for my question #3.

1) Can the "Select All | Select None" be turned off and not show in
    the table header?

 > 1. it's probably related to using rowSelection="multiple"
 > if you don't specify that, the links will not be rendererd

However, I want some of the selection boxes to appear.  Some defined by
my question #2.  So turning of "rowSelection" isn't an option.  Or maybe
there is another way to have selection boxes appear?

2) Is it possible to have a "select" checkbox appear for only SOME rows?
    I have a list of libraries and each library has a list of dvds.  I
    want only the DVDs to be selectable.


Thanks again - the #3 question really helps the GUI, Chris....


Cristi Toth wrote:
> Hi Chris,
> 
> 1. it's probably related to using rowSelection="multiple"
> if you don't specify that, the links will not be rendererd
> 
> 3. the model it's a tree, so the leafs don't have the expand/collapse 
> icon rendered BUT for a node to be a leaf it has to have the 
> 'children' property set to null (not an empty list)
> 
> On 10/11/07, *Chris Hane* < chrishane@gmail.com 
> <ma...@gmail.com>> wrote:
> 
>     Is it possible to do any of the following with the TreeTable
component.
> 
>     1) Can the "Select All | Select None" be turned off and not show
in
>         the table header?
> 
>     2) Is it possible to have a "select" checkbox appear for only SOME
rows?
>         I have a list of libraries and each library has a list of
dvds.  I
>         want only the DVDs to be selectable.
> 
>     3) Is it possible to turn off the expand arrow on specific rows?
>         For example, the DVDs do not have anything below them and
>         do not need expand arrows
> 
>     I am creating the TreeModel using
> 
>         new ChildPropertyTreeModel(root, "children");
> 
>     Should I use something else to get any of the above?  A pointer in
the
>     right direction would be much appreciated.
> 
>     Where root is:
> 
>        root = new TransferObject();
> 
>     public class TransferObject{
>       public String name;
>       public List<TransferObject> children;
>       ...and getters/setters
>     }
> 
>     The facelet code to display the tree is:
> 
> 
>     <tr:treeTable var="foo"
>                    value="#{learn.admin.contact.course.lister.tree}"
>                    rowSelection="multiple"
>                    rowsByDepth="100"
>                    expandAllEnabled="false">
>         <f:facet name="nodeStamp">
>            <tr:column>
>               <f:facet name="header">
>                 <tr:outputText value="Library/DVD"/>
>               </f:facet>
>               <tr:outputFormatted
>                     value="#{foo.name <http://foo.name>} : #{foo.type}
:
>     #{foo.id <http://foo.id>}"/>
>            </tr:column>
>         </f:facet>
>     </tr:treeTable>
> 
>     Thanks,
>     Chris....
> 
> 
> 
> 
> --
> Cristi Toth
> 
> -------------
> Codebeat
> www.codebeat.ro <http://www.codebeat.ro>

RE: [Trinidad] TreeTable Skinning Options?

Posted by Todd Engle <To...@trisyngroup.com>.
Chris, 

I found this posting and was able to conditionally set the visibility
for the checkboxes -- it was a great help and only took about 10 minutes
to implement:

http://mail-archives.apache.org/mod_mbox/incubator-adffaces-user/200612.
mbox/%3C885AADC3D2318E45807C702ABC2637DD133B40@MOES0037.tcc.local%3E

HTH,
Todd

-----Original Message-----
From: Chris Hane [mailto:chrishane@gmail.com] 
Sent: Friday, October 12, 2007 2:30 AM
To: MyFaces Discussion
Subject: Re: [Trinidad] TreeTable Skinning Options?

Cristi - thanks for the info on setting the "children" property to null
and not just empty.  That did the trick for my question #3.

1) Can the "Select All | Select None" be turned off and not show in
    the table header?

 > 1. it's probably related to using rowSelection="multiple"
 > if you don't specify that, the links will not be rendererd

However, I want some of the selection boxes to appear.  Some defined by
my question #2.  So turning of "rowSelection" isn't an option.  Or maybe
there is another way to have selection boxes appear?

2) Is it possible to have a "select" checkbox appear for only SOME rows?
    I have a list of libraries and each library has a list of dvds.  I
    want only the DVDs to be selectable.


Thanks again - the #3 question really helps the GUI, Chris....


Cristi Toth wrote:
> Hi Chris,
> 
> 1. it's probably related to using rowSelection="multiple"
> if you don't specify that, the links will not be rendererd
> 
> 3. the model it's a tree, so the leafs don't have the expand/collapse 
> icon rendered BUT for a node to be a leaf it has to have the 
> 'children' property set to null (not an empty list)
> 
> On 10/11/07, *Chris Hane* < chrishane@gmail.com 
> <ma...@gmail.com>> wrote:
> 
>     Is it possible to do any of the following with the TreeTable
component.
> 
>     1) Can the "Select All | Select None" be turned off and not show
in
>         the table header?
> 
>     2) Is it possible to have a "select" checkbox appear for only SOME
rows?
>         I have a list of libraries and each library has a list of
dvds.  I
>         want only the DVDs to be selectable.
> 
>     3) Is it possible to turn off the expand arrow on specific rows?
>         For example, the DVDs do not have anything below them and
>         do not need expand arrows
> 
>     I am creating the TreeModel using
> 
>         new ChildPropertyTreeModel(root, "children");
> 
>     Should I use something else to get any of the above?  A pointer in
the
>     right direction would be much appreciated.
> 
>     Where root is:
> 
>        root = new TransferObject();
> 
>     public class TransferObject{
>       public String name;
>       public List<TransferObject> children;
>       ...and getters/setters
>     }
> 
>     The facelet code to display the tree is:
> 
> 
>     <tr:treeTable var="foo"
>                    value="#{learn.admin.contact.course.lister.tree}"
>                    rowSelection="multiple"
>                    rowsByDepth="100"
>                    expandAllEnabled="false">
>         <f:facet name="nodeStamp">
>            <tr:column>
>               <f:facet name="header">
>                 <tr:outputText value="Library/DVD"/>
>               </f:facet>
>               <tr:outputFormatted
>                     value="#{foo.name <http://foo.name>} : #{foo.type}
:
>     #{foo.id <http://foo.id>}"/>
>            </tr:column>
>         </f:facet>
>     </tr:treeTable>
> 
>     Thanks,
>     Chris....
> 
> 
> 
> 
> --
> Cristi Toth
> 
> -------------
> Codebeat
> www.codebeat.ro <http://www.codebeat.ro>

Re: [Trinidad] TreeTable Skinning Options?

Posted by Tobias Kilian <To...@gmx.de>.
Chris Hane schrieb:
> Cristi - thanks for the info on setting the "children" property to 
> null and not just empty.  That did the trick for my question #3.
>
> 1) Can the "Select All | Select None" be turned off and not show in
>    the table header?
Hi chris!

maybe you could use style.display="none" to hide it on the client side.
i used
        <script>
            // Supress the "Show All" Option
            rangeNavigator = 
document.getElementById('subForm:table-nb__xc_c');
            if (rangeNavigator) 
rangeNavigator.options[0].style.display="none";       
        </script>

to hide the show all option on the client side. you could do a similiar 
trick with Select All | Select None. You have to look at the generated 
source to find which postfix like nb__xc_c it is, maybe *&%$ :-)

Greetings,
Tobias kilian

Re: [Trinidad] TreeTable Skinning Options?

Posted by Chris Hane <ch...@gmail.com>.
Cristi - thanks for the info on setting the "children" property to null and 
not just empty.  That did the trick for my question #3.

1) Can the "Select All | Select None" be turned off and not show in
    the table header?

 > 1. it's probably related to using rowSelection="multiple"
 > if you don't specify that, the links will not be rendererd

However, I want some of the selection boxes to appear.  Some defined by my 
question #2.  So turning of "rowSelection" isn't an option.  Or maybe there 
is another way to have selection boxes appear?

2) Is it possible to have a "select" checkbox appear for only SOME rows?
    I have a list of libraries and each library has a list of dvds.  I
    want only the DVDs to be selectable.


Thanks again - the #3 question really helps the GUI,
Chris....


Cristi Toth wrote:
> Hi Chris,
> 
> 1. it's probably related to using rowSelection="multiple"
> if you don't specify that, the links will not be rendererd
> 
> 3. the model it's a tree, so the leafs don't have the expand/collapse 
> icon rendered
> BUT for a node to be a leaf it has to have the 'children' property set 
> to null (not an empty list)
> 
> On 10/11/07, *Chris Hane* < chrishane@gmail.com 
> <ma...@gmail.com>> wrote:
> 
>     Is it possible to do any of the following with the TreeTable component.
> 
>     1) Can the "Select All | Select None" be turned off and not show in
>         the table header?
> 
>     2) Is it possible to have a "select" checkbox appear for only SOME rows?
>         I have a list of libraries and each library has a list of dvds.  I
>         want only the DVDs to be selectable.
> 
>     3) Is it possible to turn off the expand arrow on specific rows?
>         For example, the DVDs do not have anything below them and
>         do not need expand arrows
> 
>     I am creating the TreeModel using
> 
>         new ChildPropertyTreeModel(root, "children");
> 
>     Should I use something else to get any of the above?  A pointer in the
>     right direction would be much appreciated.
> 
>     Where root is:
> 
>        root = new TransferObject();
> 
>     public class TransferObject{
>       public String name;
>       public List<TransferObject> children;
>       ...and getters/setters
>     }
> 
>     The facelet code to display the tree is:
> 
> 
>     <tr:treeTable var="foo"
>                    value="#{learn.admin.contact.course.lister.tree}"
>                    rowSelection="multiple"
>                    rowsByDepth="100"
>                    expandAllEnabled="false">
>         <f:facet name="nodeStamp">
>            <tr:column>
>               <f:facet name="header">
>                 <tr:outputText value="Library/DVD"/>
>               </f:facet>
>               <tr:outputFormatted
>                     value="#{foo.name <http://foo.name>} : #{foo.type} :
>     #{foo.id <http://foo.id>}"/>
>            </tr:column>
>         </f:facet>
>     </tr:treeTable>
> 
>     Thanks,
>     Chris....
> 
> 
> 
> 
> -- 
> Cristi Toth
> 
> -------------
> Codebeat
> www.codebeat.ro <http://www.codebeat.ro>

Re: [Trinidad] TreeTable Skinning Options?

Posted by Cristi Toth <cr...@gmail.com>.
Hi Chris,

1. it's probably related to using rowSelection="multiple"
if you don't specify that, the links will not be rendererd

3. the model it's a tree, so the leafs don't have the expand/collapse icon
rendered
BUT for a node to be a leaf it has to have the 'children' property set to
null (not an empty list)

On 10/11/07, Chris Hane <ch...@gmail.com> wrote:
>
> Is it possible to do any of the following with the TreeTable component.
>
> 1) Can the "Select All | Select None" be turned off and not show in
>     the table header?
>
> 2) Is it possible to have a "select" checkbox appear for only SOME rows?
>     I have a list of libraries and each library has a list of dvds.  I
>     want only the DVDs to be selectable.
>
> 3) Is it possible to turn off the expand arrow on specific rows?
>     For example, the DVDs do not have anything below them and
>     do not need expand arrows
>
> I am creating the TreeModel using
>
>     new ChildPropertyTreeModel(root, "children");
>
> Should I use something else to get any of the above?  A pointer in the
> right direction would be much appreciated.
>
> Where root is:
>
>    root = new TransferObject();
>
> public class TransferObject{
>   public String name;
>   public List<TransferObject> children;
>   ...and getters/setters
> }
>
> The facelet code to display the tree is:
>
>
> <tr:treeTable var="foo"
>                value="#{learn.admin.contact.course.lister.tree}"
>                rowSelection="multiple"
>                rowsByDepth="100"
>                expandAllEnabled="false">
>     <f:facet name="nodeStamp">
>        <tr:column>
>           <f:facet name="header">
>             <tr:outputText value="Library/DVD"/>
>           </f:facet>
>           <tr:outputFormatted
>                 value="#{foo.name} : #{foo.type} : #{foo.id}"/>
>        </tr:column>
>     </f:facet>
> </tr:treeTable>
>
> Thanks,
> Chris....
>



-- 
Cristi Toth

-------------
Codebeat
www.codebeat.ro