You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by gvp <bl...@gmail.com> on 2005/06/06 17:47:48 UTC
tacos:tree treeState problem
Hello Tapestry,
I faced a problem with strange behavior of tacos:tree treeState.
I put directLink inside of tree node with folliwng custom action:
<property-specification name="treeState" type="java.util.Set" persistent="yes" initial-value="new java.util.HashSet()" />
<span jwcid="tree@tacos:Tree" contentProvider="ognl:contentProvider" value="ognl:node" state="ognl:treeState" keyProvider="ognl:keyProvider">
<a jwcid="@DirectLink" listener="ognl:listeners.nodeClick" parameters="ognl:node.UID" id='ognl:node.UID' style="display:none"><span jwcid="@Insert" value="ognl:node.name"/></a>
</span>
public void nodeClick(IRequestCycle cycle)
{
Object[] parameters = cycle.getServiceParameters();
if (null != _parameters && _parameters.length > 0)
{
String uid = (String) _parameters[0];
Node targetNode = findNode(getContentProvider().getElements(), _uid);
if(null == targetNode.getParent() && !targetNode.isSelected())
{
ITreeManager _treeManager = getTreeManager();
_treeManager.collapseAll();
_treeManager.setExpanded(targetNode, true);
}
}
}
The purpose of method is collapse all previously expanded nodes and
have target expanded. In debug mode if've found that after execution
of nodeClick() my persistent property treeState contains target node key but in
the pageBeginRender() method treeState was empty. This caused target
node to be collapsed.
Another strange behavior is when I try using ITreeManager to set the root element to be initially
expanded. And it is really expanded, but after next click at any
root's chlid "expand" button causes the root to callapse.
Does anybody know a workaround of this problem?
--
Best regards,
gvp mailto:blindvit@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: count how many open sessions on tapestry application
Posted by Bryan Lewis <br...@maine.rr.com>.
Try this:
http://marc.theaimsgroup.com/?l=tapestry-user&w=2&r=1&s=httpsessionlistener&q=b
----- Original Message -----
From: "Ariel Pablo Klein" <ap...@eml.cc>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Tuesday, June 07, 2005 1:07 PM
Subject: count how many open sessions on tapestry application
> Anyone have already implemented code to count how many open sessions
exists
> using a specified tapestry application? Please post code or send to me
> personally. Thanks
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
count how many open sessions on tapestry application
Posted by Ariel Pablo Klein <ap...@eml.cc>.
Anyone have already implemented code to count how many open sessions exists
using a specified tapestry application? Please post code or send to me
personally. Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re[2]: tacos:tree treeState problem
Posted by gvp <bl...@gmail.com>.
Hello Viktor,
Thanks Victor, your solution helped a lot. I chose 2nd one because
when I try preexpand tree via TreeManager in pageBeginRender() method
I get IllegalArgumentException() from Manger costructor. I checked
the source and found that the reason could be null treeState object.
> 1) let the tacos:Tree initialize your persistent state property (it
> will make a new HashSet and fire the right events at the right time).
> Basically you just remove initial-value:
> <property-specification name="treeState" type="java.util.Set" persistent="yes"/>
> 2) Keep the initial-value, but make sure you do a
> setTreeState(getTreeState()); whenever you have affected that Set
> (either directly or via a TreeManager).
> Hope this helps,
> Viktor
--
Best regards,
gvp
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: tacos:tree treeState problem
Posted by Viktor Szathmary <ph...@gmail.com>.
On 6/6/05, gvp <bl...@gmail.com> wrote:
>
> I faced a problem with strange behavior of tacos:tree treeState.
> I put directLink inside of tree node with folliwng custom action:
>
> <property-specification name="treeState" type="java.util.Set" persistent="yes" initial-value="new java.util.HashSet()" />
Tapestry has an odd behavior when it comes to persistent properties
with initial-values: it does not persist the value if you don't
explictly call the setter (thus firing a change notification event),
instead it keeps recreating it with initial-value next time around.
Based on the problem you described, I think that's the issue here.
There are two ways around this:
1) let the tacos:Tree initialize your persistent state property (it
will make a new HashSet and fire the right events at the right time).
Basically you just remove initial-value:
<property-specification name="treeState" type="java.util.Set" persistent="yes"/>
2) Keep the initial-value, but make sure you do a
setTreeState(getTreeState()); whenever you have affected that Set
(either directly or via a TreeManager).
Hope this helps,
Viktor
ps. I'm cc-ing this on the tacos-devel list, just so at least it gets
archived there as well.. i will of course keep answering questions
raised on tapestry-user as well.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org