myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omaji7 <>
Subject Re: TreeTable
Date Fri, 18 Dec 2009 10:12:33 GMT


My project is build in JSF, Hibernate and Faclets. i m using trinidad
treetable tag to build a tree with multiselection nodes. Now i m facing a
problem to initially selection of the nodes when page is loaded at the first
time. i have tried alot to accomplish this task, but still unable to retain
it. There is an attribute of "selectedRowKeys" in TreeTable which takes the
object of "RowKeySet", but when i am building the tree in my bean, i don't
know the RowKeys generated, so how do i get my desired RowKeys to be
selected in the tree?

i am trying to provide the code below


<tr:treeTable id="testTreeTable"
                        <f:facet name="actions">
                            <tr:commandButton id="treeTableSelectButton"
text="Submit Sel." action="#{RoleManageBean.treeTableSelect}" />
                        <f:facet name="nodeStamp">
                            <tr:column headerText="Name">
                                <tr:outputText value="#{}"/>
                        <f:facet name="pathStamp">
                            <tr:outputText value="#{}"/>

public class RoleManageBean implements Serializable {

    private TreeModel tree;
    private RowKeySet selectedRowKeys = null;

public TreeModel getTree() throws Exception {
        Application[] applications = dbops.getAllApplications();
        List<Node1> empty1 = Collections.emptyList();
        List<Node1> root1 = new ArrayList<Node1>();
        List<Node1> apps = new ArrayList<Node1>();
        for (Application application : applications) {
            Set<ApplicationPage> appPages =
            List<Node1> pages = new ArrayList<Node1>();
            for (ApplicationPage applicationPage : appPages) {
                pages.add(new Node1(applicationPage.getPageName(),
String.valueOf(applicationPage.getPageID()), empty1));
            apps.add(new Node1(application.getApplicationName(),
String.valueOf(application.getHomePage().getPageID()), pages));

        root1.add(new Node1("Applications", "0", apps));
        tree = new ChildPropertyTreeModel(root1, "children");
        return tree;

public RowKeySet getSelectedRowKeys() {
        selectedRowKeys = new RowKeySetImpl();
        return selectedRowKeys;

    public void setSelectedRowKeys(RowKeySet selectedRowKeys) {
        this.selectedRowKeys = selectedRowKeys;

Any guideline will be appriciated. Thanks in Advance


Nuno Sousa wrote:
> Hi,
> Any place where i can find some examples of TreeTables Usage?
> Including JavaCode, i follow the example at the bottom of this page:
> and the
> only thing i can see is the root element rendered :/
> Btw can i make a TreeTable with ColumnGroups using Trinidad in the same
> table?
> Thanks
> -- 
> Ping is just a number timming is everything

View this message in context:
Sent from the MyFaces - Users mailing list archive at

View raw message