You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Andrew Richards <An...@focus-solutions.co.uk> on 2007/10/02 12:08:31 UTC

[Trinidad] request backed TreeTable

Hi, I have a Trinidad TreeTable displaying my hierarchy of selectable data which works fine.

The problem I having is that when I user selects a row in the table and then navigates away from the page and the returns to the page, the treeTable selection is persisted and the row is expanded and selected? My backing bean is request scoped, which confuses me?

Does anyone know how I can force the TreeTable to return to its original state on every new request?

Many thanks,

Andy


RE: [Trinidad] request backed TreeTable

Posted by Todd Engle <To...@trisyngroup.com>.
Hi Andrew, 
 
Is the binding attribute set in the <tr:treeTable> tag?  If so, and if
you do not want to persist state across requests, you should clear this
attribute -- especially if the bean in the binding attribute is session
scoped.
 
Take a look at this article for more information:
 
http://one-size-doesnt-fit-all.blogspot.com/2007/06/follow-up-programmat
ic-adf-faces-tree.html
 
Hope this helps,
Todd

________________________________

From: Andrew Richards [mailto:Andrew.Richards@focus-solutions.co.uk] 
Sent: Thursday, October 04, 2007 3:44 AM
To: MyFaces Discussion
Subject: RE: [Trinidad] request backed TreeTable



Thanks Venktra,

 

My colleague tells me they have tried progmatically clearing the
selectedRowKeys and disclosedRowKeys in the backing bean with no
success, the selected state is persisted and the tree remains expanded.
Removing the context-pararm has had the desired effect I just cant find
any decent documentation around
org.apache.myfaces.trinidad.CHANGE_PERSISTENCE.

 

Regards

 

Andy

 

________________________________

From: venkata guddanti [mailto:ven.guddanti@gmail.com] 
Sent: 03 October 2007 17:38
To: MyFaces Discussion
Subject: Re: [Trinidad] request backed TreeTable

 

Hi Andrew,

I believe this may not have anything to do with change persistence. The
selection and the expansion state is part for the component state
(SaveState, RestoreState). 

One possibility is that you use a request scoped bean to bind the
selectedRowKeys and disclosedRowKeys attributes via EL. 

Regards,
Venkata

On 10/2/07, Andrew Richards <Andrew.Richards@focus-solutions.co.uk >
wrote:

Ive found the answer,

The following context param was set in the web.xml

<context-param>
 
<param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
  <param-value>session</param-value>
</context-param>

I cant find org.apache.myfaces.trinidad.CHANGE_PERSISTENCE in the
documentation, there is nothing under web.xml in the dev
guide(http://myfaces.apache.org/trinidad/devguide/configuration.html#web
.xml )

Does anyone know here this is documented so I can determine the effect
of removing this will have on my application? I guess this has been set
for a reason :-)

Thanks,

Andy

-----Original Message----- 
From: Andrew Richards [mailto:Andrew.Richards@focus-solutions.co.uk]
Sent: 02 October 2007 11:09
To: MyFaces Discussion
Subject: [Trinidad] request backed TreeTable 

Hi, I have a Trinidad TreeTable displaying my hierarchy of selectable
data which works fine.

The problem I having is that when I user selects a row in the table and
then navigates away from the page and the returns to the page, the
treeTable selection is persisted and the row is expanded and selected?
My backing bean is request scoped, which confuses me? 

Does anyone know how I can force the TreeTable to return to its original
state on every new request?

Many thanks,

Andy

 


RE: [Trinidad] request backed TreeTable

Posted by Andrew Richards <An...@focus-solutions.co.uk>.
Thanks Venktra,

My colleague tells me they have tried progmatically clearing the selectedRowKeys and disclosedRowKeys in the backing bean with no success, the selected state is persisted and the tree remains expanded. Removing the context-pararm has had the desired effect I just cant find any decent documentation around org.apache.myfaces.trinidad.CHANGE_PERSISTENCE.

Regards

Andy

________________________________
From: venkata guddanti [mailto:ven.guddanti@gmail.com]
Sent: 03 October 2007 17:38
To: MyFaces Discussion
Subject: Re: [Trinidad] request backed TreeTable

Hi Andrew,

I believe this may not have anything to do with change persistence. The selection and the expansion state is part for the component state (SaveState, RestoreState).

One possibility is that you use a request scoped bean to bind the selectedRowKeys and disclosedRowKeys attributes via EL.

Regards,
Venkata
On 10/2/07, Andrew Richards <Andrew.Richards@focus-solutions.co.uk <ma...@focus-solutions.co.uk> > wrote:
Ive found the answer,

The following context param was set in the web.xml

<context-param>
  <param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
  <param-value>session</param-value>
</context-param>

I cant find org.apache.myfaces.trinidad.CHANGE_PERSISTENCE in the documentation, there is nothing under web.xml in the dev guide(http://myfaces.apache.org/trinidad/devguide/configuration.html#web.xml )

Does anyone know here this is documented so I can determine the effect of removing this will have on my application? I guess this has been set for a reason :-)

Thanks,

Andy

-----Original Message-----
From: Andrew Richards [mailto:Andrew.Richards@focus-solutions.co.uk<ma...@focus-solutions.co.uk>]
Sent: 02 October 2007 11:09
To: MyFaces Discussion
Subject: [Trinidad] request backed TreeTable

Hi, I have a Trinidad TreeTable displaying my hierarchy of selectable data which works fine.

The problem I having is that when I user selects a row in the table and then navigates away from the page and the returns to the page, the treeTable selection is persisted and the row is expanded and selected? My backing bean is request scoped, which confuses me?

Does anyone know how I can force the TreeTable to return to its original state on every new request?

Many thanks,

Andy


Re: [Trinidad] request backed TreeTable

Posted by venkata guddanti <ve...@gmail.com>.
Hi Andrew,

I believe this may not have anything to do with change persistence. The
selection and the expansion state is part for the component state
(SaveState, RestoreState).

One possibility is that you use a request scoped bean to bind the
selectedRowKeys and disclosedRowKeys attributes via EL.

Regards,
Venkata

On 10/2/07, Andrew Richards <An...@focus-solutions.co.uk> wrote:
>
> Ive found the answer,
>
> The following context param was set in the web.xml
>
> <context-param>
>   <param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
>   <param-value>session</param-value>
> </context-param>
>
> I cant find org.apache.myfaces.trinidad.CHANGE_PERSISTENCE in the
> documentation, there is nothing under web.xml in the dev guide(
> http://myfaces.apache.org/trinidad/devguide/configuration.html#web.xml)
>
> Does anyone know here this is documented so I can determine the effect of
> removing this will have on my application? I guess this has been set for a
> reason :-)
>
> Thanks,
>
> Andy
>
> -----Original Message-----
> From: Andrew Richards [mailto:Andrew.Richards@focus-solutions.co.uk]
> Sent: 02 October 2007 11:09
> To: MyFaces Discussion
> Subject: [Trinidad] request backed TreeTable
>
> Hi, I have a Trinidad TreeTable displaying my hierarchy of selectable data
> which works fine.
>
> The problem I having is that when I user selects a row in the table and
> then navigates away from the page and the returns to the page, the treeTable
> selection is persisted and the row is expanded and selected? My backing bean
> is request scoped, which confuses me?
>
> Does anyone know how I can force the TreeTable to return to its original
> state on every new request?
>
> Many thanks,
>
> Andy
>
>

Re: [Trinidad] Help or Links to documentation on Trinidads's conversation and context mechanism

Posted by Adam Winer <aw...@gmail.com>.
The doc we've got is:

http://myfaces.apache.org/trinidad/devguide/communicatingBetweenPages.html


-- Adam


On 10/2/07, wolfgang.toepfer@pta.de <wo...@pta.de> wrote:
>
> Hi,
>
> Regarding a couple of issues with Seam 2.0 RC 1  , possibly because of the
> combination with Trinidad and other tag libraries, we
> are looking for some information on the way Trinidad's conversation and
> context mechanism works,
> some links on documentation or also some hints on the mechanism would be
> helpful.
>
> Many thanks,
> Wolfgang.

[Trinidad] Help or Links to documentation on Trinidads's conversation and context mechanism

Posted by wo...@pta.de.
Hi,

Regarding a couple of issues with Seam 2.0 RC 1  , possibly because of the 
combination with Trinidad and other tag libraries, we
are looking for some information on the way Trinidad's conversation and 
context mechanism works,
some links on documentation or also some hints on the mechanism would be 
helpful.

Many thanks,
Wolfgang.

RE: [Trinidad] request backed TreeTable

Posted by Andrew Richards <An...@focus-solutions.co.uk>.
Ive found the answer,

The following context param was set in the web.xml

<context-param>
  <param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
  <param-value>session</param-value>
</context-param>

I cant find org.apache.myfaces.trinidad.CHANGE_PERSISTENCE in the documentation, there is nothing under web.xml in the dev guide(http://myfaces.apache.org/trinidad/devguide/configuration.html#web.xml)

Does anyone know here this is documented so I can determine the effect of removing this will have on my application? I guess this has been set for a reason :-)

Thanks,

Andy

-----Original Message-----
From: Andrew Richards [mailto:Andrew.Richards@focus-solutions.co.uk]
Sent: 02 October 2007 11:09
To: MyFaces Discussion
Subject: [Trinidad] request backed TreeTable

Hi, I have a Trinidad TreeTable displaying my hierarchy of selectable data which works fine.

The problem I having is that when I user selects a row in the table and then navigates away from the page and the returns to the page, the treeTable selection is persisted and the row is expanded and selected? My backing bean is request scoped, which confuses me?

Does anyone know how I can force the TreeTable to return to its original state on every new request?

Many thanks,

Andy


Re: [Trinidad] request backed TreeTable

Posted by omaji7 <om...@gmail.com>.
Hi,

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

myTree.xhtml

<tr:treeTable id="testTreeTable"
                                  value="#{RoleManageBean.tree}"
                                  var="node"
                                  rowSelection="multiple"
                                  initiallyExpanded="true"
                                  rowBandingInterval="1"
                                  horizontalGridVisible="true"
                                  verticalGridVisible="true"
                                 
selectedRowKeys="#{RoleManageBean.selectedRowKeys}">
                        <f:facet name="actions">
                            <tr:commandButton id="treeTableSelectButton"
text="Submit Sel." action="#{RoleManageBean.treeTableSelect}" />
                        </f:facet>
                        <f:facet name="nodeStamp">
                            <tr:column headerText="Name">
                                <tr:outputText value="#{node.name}"/>
                            </tr:column>
                        </f:facet>
                        <f:facet name="pathStamp">
                            <tr:outputText value="#{node.name}"/>
                        </f:facet>
                    </tr:treeTable>


MyBean.java

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 =
application.getApplicationPage();
            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();
        selectedRowKeys.add(String.valueOf("1,0"));
        System.out.println("called");
        return selectedRowKeys;
    }

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


Any guideline will be appriciated. Thanks in Advance

Majid. 

Andrew Richards-2 wrote:
> 
> Hi, I have a Trinidad TreeTable displaying my hierarchy of selectable data
> which works fine.
> 
> The problem I having is that when I user selects a row in the table and
> then navigates away from the page and the returns to the page, the
> treeTable selection is persisted and the row is expanded and selected? My
> backing bean is request scoped, which confuses me?
> 
> Does anyone know how I can force the TreeTable to return to its original
> state on every new request?
> 
> Many thanks,
> 
> Andy
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/-Trinidad--request-backed-TreeTable-tp12996112p26841534.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.