On 11/12/06, Mittal Bhoigade <[EMAIL PROTECTED]> wrote:
Andy,
collection currentTrans is persisted in session - and treeState is present in collection - do I still have to persist treeState ?
Thanks
MittalOn 11/12/06, andyhot <[EMAIL PROTECTED]> wrote:Well, the state must also be persisted somewhere...
in the session perhaps...
If you aren't persisting it, it'll always be an empty HashSet,
so no nodes will be expanded
Mittal Bhoigade wrote:
> well is it really hard to implement trees using tacos - or I am
> missing something
>
> On 11/12/06, *Mittal Bhoigade* <[EMAIL PROTECTED]
> <mailto: [EMAIL PROTECTED]>> wrote:
>
> Hey Andy,
>
> Well some update - source is null exception was resulting b'cos
> currentTrans was not a ASO - after I did that there were no
> exceptions.
>
> Now the issue is tree does not expand when plus sign is clicked.
>
> I added treeState as suggested in your previous message, but tree
> still does not expand - i.e when user click on plus sign page gets
> refreshed but getChildren on Item does not get invoked
>
> It invokes setTreeState and getTreeState methods It also invokes
> other methods such as hasChildren but it never invokes getChildren
>
> one more thing - all of my code starts from pageBeginRender >>
> this method collects all the data and is setting currentTrans
>
> Any more clues shall be of great help
>
> Thanks
> Mittal
>
>
> On 11/11/06, *andyhot* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED] >> wrote:
>
> Mittal, I tried to research your issue a bit...
>
> First of all, there's no problem putting multiple trees in a page.
> For instance, i grabbed the SimpleTreeExample page from the
> tacos-demo and
> added a For in it...no problem....
>
> But i did notice that when i open a node in the first tree, it
> gets open
> in all other
> trees... this is the correct behavior actually, and it
> probably explains
> your problem..
>
> Check out the docs at
> http://tacos.sourceforge.net/components/Tree.html
>
> There's a state parameter (which can be a simple HashSet)
> that's used
> for remembering
> which nodes are open and which closed...
> Now, when you have a component in a loop, it's actually only one
> instance...So, even though you
> provide different contentProviders and values for each
> iteration, they
> all use the same hashset and thus have
> the same state.
>
> Because each tree has different nodes but tries to apply the
> same state,
> a mismatch is created somewhere
> resulting to your exception...
>
> For a solution, also provide a state to the trees:
> <binding name="state" value="currentTrans[tranIndex].state"/>
>
> Hope that helps!
>
>
> Mittal Bhoigade wrote:
> >
> > well anyone on forum has any clue of this error message
> >
> >
> > On 11/10/06, *Mittal Bhoigade* < [EMAIL PROTECTED]
> <mailto: [EMAIL PROTECTED]>
> > <mailto:[EMAIL PROTECTED] <mailto: [EMAIL PROTECTED]>>> wrote:
> >
> > Andy,
> >
> > Some more info, I updated my html ognl property (see
> html).
> >
> > ******* page *********
> > <component id="transaction" type="For">
> > <binding name="source" value="currentTrans"/>
> > <binding name="element" value="literal:tr"/>
> > <binding name="index" value="tranIndex"/>
> > <binding name="class" value=" beans.evenOdd.next "/>
> > </component>
> >
> > <component id="tree" type="tacos:Tree">
> > <binding name="contentProvider"
> > value="currentTrans[tranIndex].contentProvider"/>
> > <binding name="value"
> value="currentTrans[tranIndex].item"/>
> > <binding name="nodeLinkAjax" value="ognl:false" />
> > </component>
> >
> > ******* page *********
> >
> > ******* html *********
> >
> > <tr class="odd" jwcid="transaction">
> > <td align="left">
> > <div class="cData" jwcid="tree"
> > style="overflow: auto; width: auto; height: auto;">
> > <span jwcid="@Insert"
> > value="ognl:currentTrans[tranIndex].item.name"/>
> > </div>
> > </td>
> > </tr>
> >
> > ******* html *********
> >
> >
> > General Info >>
> > 1) currentTrans is collection of VO called Transaction
> > 2) Each Transaction has member a)
> ITreeContentProvider b) Item
> > 3) This is how Folder's are added to ContentProvider
> >
> > public TransactionTreeContentProvider(String
> > strParent,String strTransDetailsURL){
> > Folder folder = new
> > Folder(strParent,strTransDetailsURL);
> > ROOTS.add(folder);
> > }
> > 4) ROOTS is a List of Folder's
> > 5) Folder extends Item
> >
> > Issue I am hitting at,
> > 1) I am able to display tree with root
> > 2) When I click on plus sign - I get following exception.
> >
> > source is null for getProperty(null, "0")
> >
> > I have checked for,
> > 1) ContentProvider is not null
> > 2) Item is not null
> > 3) I am able to print name property of Item in logs
> >
> > Any help shall be appraciated.
> >
> >
> > Thanks
> > Mittal
> >
> >
> >
> > Thanks
> > Mittal
> >
> >
> > On 11/10/06, *Mittal Bhoigade* < [EMAIL PROTECTED]
> <mailto: [EMAIL PROTECTED]>
> > <mailto:[EMAIL PROTECTED]
> <mailto: [EMAIL PROTECTED]>>> wrote:
> >
> > Andy
> >
> > See my answer in ur message below..
> >
> > additionally, Transaction has property Item,
> >
> > public Item getItem() {
> > return item;
> > }
> >
> > public void setItem(Item item) {
> >
> > this.item = item;
> > }
> >
> > So, If I am on right path,
> >
> > - tree reads contentProvider and set's it to
> > currentTrans[tranIndex].item
> > - and then I am trying to display it using
> > >> <span jwcid="@Insert" value="ognl: item.name
> < http://item.name>
> > < http://item.name>"/>
> >
> > Should I paste html/page/java here.....if that
> helps you
> > see the problem
> >
> > Thanks
> > Mittal
> >
> > On 11/10/06, * andyhot* <[EMAIL PROTECTED]
> <mailto: [EMAIL PROTECTED] >
> > <mailto: [EMAIL PROTECTED]
> <mailto: [EMAIL PROTECTED]>>> wrote:
> >
> > You have
> > <binding name="value"
> > value="currentTrans[tranIndex].item"/>
> >
> > So what the tree actually does is ask the
> > contentprovider for the current
> > entry and store it in
> currentTrans[tranIndex].item
> >
> > Is that what you want? Mittal >> Yes
> >
> > Also, when you show each node, you do
> > <span jwcid="@Insert" value="ognl: item.name
> < http://item.name>
> > < http://item.name> < http://item.name>"/>
> >
> > but how is item set? The tree doesn't set it,
> the tree
> > only sets
> > currentTrans[tranIndex].item
> >
> >
> > Mittal >> They are set from constructor
> of class
> > that implements ITreeContentProvider
> > Mittal >> Folder folder = new
> > Folder(strParent,strTransDetailsURL); //
> where parent
> > is root
> > Mittal >> ROOTS.add(folder); // ROOTS is a
> List
> > Mittal >> Folder extends Item
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Tacos-devel mailing list
Tacos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tacos-devel
--
Jesse Kuhnert
Tapestry/Dojo/(and a dash of TestNG), team member/developer
Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Tacos-devel mailing list Tacos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tacos-devel