You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vjeran Marcinko <vj...@tis.hr> on 2004/04/13 13:32:58 UTC

HELP! Re: About contrib:Tree

Hi again.

I stumbled upon one big problem, and dunno if contrib:Tree supports at all
this use case -
Lots of times are Tree components used in *framed* web pages since it is
convinient to place them in some "left" frame to present hierarchical
structure of some kind, and "right" frame is for details/attributes of the
selected tree node. Frame is good for tree because scrollbars will be shown
if tree becomes too "deep" to present.

Problem is that when some node is selected in contrib:Tree, then "left"
frame gets reloaded to show child nodes, but I would like also to somehow
update "right" frame to display attributes of that selected parent node (not
only leaf nodes have attributes).
Can web/http request update at all more than one page - left and right frame
in same time ? I guess not, or maybe I'm dumb :-(
If not, that means that I would have to have some way to separate :
1. expanding parent node which reloads tree frame
2. trigger parent node selection which updates right "attributes" frame to
show me details about it

Any sugestions ?? Is any of this possible to achieve by contrib:Tree ?

Regards,
Vjeran

----- Original Message ----- 
From: "Erik Hatcher" <er...@ehatchersolutions.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Tuesday, April 13, 2004 12:35 PM
Subject: Re: About contrib:Tree


> I'm not changing the tree component - simply using it based on the
> Workbench examples and what I can deduce from the source code of it.
> I'm building (a prototype) menu component which encapsulates a
> contrib:Tree.
>
> It lacks docs, but I'm in no position currently to assist in that
> situation.
>
> Erik
>
> On Apr 13, 2004, at 4:24 AM, Vjeran Marcinko wrote:
>
> > Hi folks.
> >
> > Is contrib:Tree currently being restructured/changed, or it just lacks
> > docs
> > ?
> > I'm asking this because I started using it by examining sources from
> > Workbench tree example, but I would stop that if it's gonna change soon
> > (Erik said he's working with it something, some days ago), thus will
> > require
> > maybe some new way of using it ?
> >
> > Regards,
> > Vjeran


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: HELP! Re: About contrib:Tree

Posted by Nikla Ratinen <ni...@dnainternet.net>.
Hi,

I faced a similar problem a while ago, and solved
it by reverting to Tigra Tree Menu from SoftComplex
http://www.softcomplex.com/products/tigra_tree_menu/

Its a pure javascript menu system where the tree 
structure is presented in a separate javascript
array file. Its relatively easy to wireframe this
file to be dynamically rendered from within
tapestry, I did it by POJO item tree structure 
which could render itself in tigra format. 

Now for the bads: this one has a reverse problem,
the collapse/expand is handled within JS and 
thus one gets notifications only upon selecting
an item. In my case the tree grew to contain 
thousands of items and prerendering all
hidden nodes became a burden.

Anyhow, if you know your tree is not going
to grow a lot and you dont need to do expensive
operations per leaf in the tree rendering phase 
you might want to take a look.

Sorry, unable to share the code :(

-- Nikla


On Wed, 2004-04-14 at 17:17, Vjeran Marcinko wrote:
> ----- Original Message ----- 
> From: "Erik Hatcher" <er...@ehatchersolutions.com>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Wednesday, April 14, 2004 2:46 PM
> Subject: Re: HELP! Re: About contrib:Tree
> 
> 
> > I think the combination of custom ITreeStateListener and
> > ITreeStateModel give you enough to do what you want.  Maybe I'm missing
> > something, though.
> 
> Yes you do ;)
> Any tree node must offer 2 actions - expanding/collapsing and just
> selecting, and if you take a look at TreeNodeView component's template
> you'll see there's just one direct link, doing just expanding/collpasing and
> there's no way of just selecting and notifying listener of selection.
> 
> Let's say your whole tree is expanded, and you would like to see attributes
> (not children) of some node. You click it, and suddenly this node collapses.
> But you didn't want collapsing, just selecting it and displaying it's
> attributes on some other page/frame ..
> 
> Cheers,
> Vjeran
> 
> 
> ---------------------------------------------------------------------
> 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


Re: HELP! Re: About contrib:Tree

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Apr 14, 2004, at 10:17 AM, Vjeran Marcinko wrote:
> Let's say your whole tree is expanded, and you would like to see 
> attributes
> (not children) of some node. You click it, and suddenly this node 
> collapses.
> But you didn't want collapsing, just selecting it and displaying it's
> attributes on some other page/frame ..

My point is that I believe you can control it by being clever in your 
state and listener combo.  Maybe I'm wrong... but you don't have to 
collapse something.

I see your point though, and I agree that the more fine-grained events 
there are the better.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: HELP! Re: About contrib:Tree

Posted by Vjeran Marcinko <vj...@tis.hr>.
----- Original Message ----- 
From: "Erik Hatcher" <er...@ehatchersolutions.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Wednesday, April 14, 2004 2:46 PM
Subject: Re: HELP! Re: About contrib:Tree


> I think the combination of custom ITreeStateListener and
> ITreeStateModel give you enough to do what you want.  Maybe I'm missing
> something, though.

Yes you do ;)
Any tree node must offer 2 actions - expanding/collapsing and just
selecting, and if you take a look at TreeNodeView component's template
you'll see there's just one direct link, doing just expanding/collpasing and
there's no way of just selecting and notifying listener of selection.

Let's say your whole tree is expanded, and you would like to see attributes
(not children) of some node. You click it, and suddenly this node collapses.
But you didn't want collapsing, just selecting it and displaying it's
attributes on some other page/frame ..

Cheers,
Vjeran


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: HELP! Re: About contrib:Tree

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Apr 14, 2004, at 1:35 AM, Vjeran Marcinko wrote:
>> I'm not following what you want different.  So you want the tree 
>> events
>> separated in some way they are not now?
>
> Yes. For example, take a look at windows explorer. You can do 2 
> actions with
> tree - one action is expanding/collpasing (+/- images), and the other 
> one is
> selecting some node (which triggers showing directory in the right 
> panel).
> These 2 actions should be separated.
> In case of contrib:Tree that means that TreeNodeView component should 
> have 2
> DirectLinks inside - one wrapping +/- images for collapsing/expanding, 
> and
> the other one wrapping node name, allowing to trigger some action. 
> Later one
> should allow passing taget="..." parameter so user could also specify 
> target
> frame.

In a way, I believe, you can have fine-grained control over these 
events separately.  Yes, TreeNodeView does "collapse" and "expand" the 
nodes prior to firing the tree event listener.  It calls your state 
model collapse/expandPath methods (why expandPath and not just 
expand?).

I think the combination of custom ITreeStateListener and 
ITreeStateModel give you enough to do what you want.  Maybe I'm missing 
something, though.  It seems pretty flexible though.  For example, I 
wanted to display a tree with all nodes *always* expanded.... a custom 
ITreeStateModel let me do that and essentially ignore the collapse and 
expandPath events.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: HELP! Re: About contrib:Tree

Posted by tsvetelin <ts...@rushmore-digital.com>.
Hi Vjeran,

>Anyway, can someone explain me what is the prupose of ITreeNode interface
>when ITreeDataModel can contain any object, and not only ITreeNode objects
>(at least looking at interface methods) ?

Well the interface ITreeDataModel doesn't required to work with specific
type of object. In this case you aren't obliged to extend/implement some
interfaces from the tree package in your tree data structure. In this way
the tree model is more flexible. ITreeNode is a default/suggested interface
for building a tree data structure (but it isn't required). The
SimpleTreeDataModel use data objects from ITreeNode type.

So if you have a specific tree data structure you should to write a
implementation of ITreeDataModel and the contrib.Tree will work with your
node data objects.


Tsvetelin



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: HELP! Re: About contrib:Tree

Posted by Vjeran Marcinko <vj...@tis.hr>.
----- Original Message ----- 
From: "tsvetelin" <ts...@rushmore-digital.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Wednesday, April 14, 2004 8:49 AM
Subject: RE: HELP! Re: About contrib:Tree


> Hi Vjeran,
>
> This is one of my ideas of about the contrib.Tree(2 separate events).
> Unfortunately I don't have enough time for tree development so if you have
a
> time you can supply a patch with changes in TreeNodeView.

Ugh, I started working with Tapestry just one month ago, and dunno much
about it, thus not considering myself ready for such task. When I read
Howard's book (soon) then maybe I will be capable for such things.

Anyway, can someone explain me what is the prupose of ITreeNode interface
when ITreeDataModel can contain any object, and not only ITreeNode objects
(at least looking at interface methods) ?

Cheers,
Vjeran


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: HELP! Re: About contrib:Tree

Posted by tsvetelin <ts...@rushmore-digital.com>.
Hi Vjeran,

This is one of my ideas of about the contrib.Tree(2 separate events).
Unfortunately I don't have enough time for tree development so if you have a
time you can supply a patch with changes in TreeNodeView.

Thank you in advance.

Tsvetelin.

-----Original Message-----
From: Vjeran Marcinko [mailto:vjeran@tis.hr]
Sent: Wednesday, April 14, 2004 8:36 AM
To: Tapestry users
Subject: Re: HELP! Re: About contrib:Tree


----- Original Message -----
From: "Erik Hatcher" <er...@ehatchersolutions.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Tuesday, April 13, 2004 11:00 PM
Subject: Re: HELP! Re: About contrib:Tree


> On Apr 13, 2004, at 4:26 PM, Vjeran Marcinko wrote:

> > Anyway, I think the problem is that contrib:Tree component doesn't
> > have all
> > the functionality needed usualy - way to extend/collapse a node
> > (usualy when
> > + or - images are clicked), and to execute some action when node is
> > selected
> > (when node name clicked). Something like the tree in Tomcat Admin Tool
> > webapp. contrib:Tree combines these 2 things together - node name
> > expands or
> > colapses when clicked *and* also notifyies listener thus enabling some
> > action execution.
>
> I'm not following what you want different.  So you want the tree events
> separated in some way they are not now?

Yes. For example, take a look at windows explorer. You can do 2 actions with
tree - one action is expanding/collpasing (+/- images), and the other one is
selecting some node (which triggers showing directory in the right panel).
These 2 actions should be separated.
In case of contrib:Tree that means that TreeNodeView component should have 2
DirectLinks inside - one wrapping +/- images for collapsing/expanding, and
the other one wrapping node name, allowing to trigger some action. Later one
should allow passing taget="..." parameter so user could also specify target
frame.

Regards,
Vjeran


---------------------------------------------------------------------
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


Re: HELP! Re: About contrib:Tree

Posted by Vjeran Marcinko <vj...@tis.hr>.
----- Original Message ----- 
From: "Erik Hatcher" <er...@ehatchersolutions.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Tuesday, April 13, 2004 11:00 PM
Subject: Re: HELP! Re: About contrib:Tree


> On Apr 13, 2004, at 4:26 PM, Vjeran Marcinko wrote:

> > Anyway, I think the problem is that contrib:Tree component doesn't
> > have all
> > the functionality needed usualy - way to extend/collapse a node
> > (usualy when
> > + or - images are clicked), and to execute some action when node is
> > selected
> > (when node name clicked). Something like the tree in Tomcat Admin Tool
> > webapp. contrib:Tree combines these 2 things together - node name
> > expands or
> > colapses when clicked *and* also notifyies listener thus enabling some
> > action execution.
>
> I'm not following what you want different.  So you want the tree events
> separated in some way they are not now?

Yes. For example, take a look at windows explorer. You can do 2 actions with
tree - one action is expanding/collpasing (+/- images), and the other one is
selecting some node (which triggers showing directory in the right panel).
These 2 actions should be separated.
In case of contrib:Tree that means that TreeNodeView component should have 2
DirectLinks inside - one wrapping +/- images for collapsing/expanding, and
the other one wrapping node name, allowing to trigger some action. Later one
should allow passing taget="..." parameter so user could also specify target
frame.

Regards,
Vjeran


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: [Suggestion]Programmable CSS file.

Posted by Programozás <pr...@hotmail.com>.
You could use the style HTML attribute in this case.
The HTML source would be larger but you have absolute freedom for defining
the styles of your component instances.
And the style can be specified in the HTML template, so you can still
cooperate with designers.

Norbi

----- Original Message ----- 
From: "Alex Kwan" <er...@hotmail.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Wednesday, April 14, 2004 8:10 AM
Subject: [Suggestion]Programmable CSS file.


> Hi, All dear Tapestry developers
>     When doing some page authoring in some project, we found the static
CSS
> file is too limit for the dynamic tapestry application. For example, if I
> had a page which has two table using the same table component, I want to
two
> table has different style. but the style of  table can only be specified
by
> the CSS class name. so the stylesheet of the second table will overwrite
the
> first one.
>     If we can support dynamic css file just like the script specification,
> we can solve this problem gracefully.
>     Have you ever meet this situtation?
>
> Alex
>
> ---------------------------------------------------------------------
> 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


[Suggestion]Programmable CSS file.

Posted by Alex Kwan <er...@hotmail.com>.
Hi, All dear Tapestry developers
    When doing some page authoring in some project, we found the static CSS
file is too limit for the dynamic tapestry application. For example, if I
had a page which has two table using the same table component, I want to two
table has different style. but the style of  table can only be specified by
the CSS class name. so the stylesheet of the second table will overwrite the
first one.
    If we can support dynamic css file just like the script specification,
we can solve this problem gracefully.
    Have you ever meet this situtation?

Alex

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Table problem

Posted by Jonny Wray <jo...@yahoo.com>.
HI,

I have an extended version of Table that I use that I've just
discovered a problem with and I'm stumped on where it's going wrong.
The component is configurable via an xml file to allow the definition
of table columns and which columns contain links. The resultant
ITableColumnModel is lazy initialized and stored in the Global object.
My table gets the column model via:

public ITableColumnModel getTableColumnModel(){
   Global global = (Global)getPage().getGlobal();
   return global.getTableColumnModel(getTableSpecificationFilename());
}

where getTableSpecificationFilename() is the abstract method for a
component parameter.

My problem occurs when I press sort on a particular column and while
the sort is happening I press another sort link. I then get a null
pointer exception on tableColumnModel as well as a 

WARN [org.apache.tapestry.engine.AbstractEngine] - Exception during
post-request cleanup.
ClientAbortException:  java.net.SocketException: Connection reset by
peer: socket write error

in my console.

Any ideas what might be wrong here or how to go about fixing it?

Jonny


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: HELP! Re: About contrib:Tree

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Apr 13, 2004, at 4:26 PM, Vjeran Marcinko wrote:
> I'll try to substitute frames with some table Border component, though 
> it's
> tricky to force table to extend all the way to the bottom of the page 
> (along
> with it's background image/color) without text inside.
>
> Anyway, I think the problem is that contrib:Tree component doesn't 
> have all
> the functionality needed usualy - way to extend/collapse a node 
> (usualy when
> + or - images are clicked), and to execute some action when node is 
> selected
> (when node name clicked). Something like the tree in Tomcat Admin Tool
> webapp. contrib:Tree combines these 2 things together - node name 
> expands or
> colapses when clicked *and* also notifyies listener thus enabling some
> action execution.

I'm not following what you want different.  So you want the tree events 
separated in some way they are not now?

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: HELP! Re: About contrib:Tree

Posted by Vjeran Marcinko <vj...@tis.hr>.
I'll try to substitute frames with some table Border component, though it's
tricky to force table to extend all the way to the bottom of the page (along
with it's background image/color) without text inside.

Anyway, I think the problem is that contrib:Tree component doesn't have all
the functionality needed usualy - way to extend/collapse a node (usualy when
+ or - images are clicked), and to execute some action when node is selected
(when node name clicked). Something like the tree in Tomcat Admin Tool
webapp. contrib:Tree combines these 2 things together - node name expands or
colapses when clicked *and* also notifyies listener thus enabling some
action execution.

Regards,
Vjeran

----- Original Message ----- 
From: "Erik Hatcher" <er...@ehatchersolutions.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Tuesday, April 13, 2004 2:57 PM
Subject: Re: HELP! Re: About contrib:Tree


> You're going to find this very hard to do.  See a previous thread,
> search for "frames suck" :)
>
> To use frames (and we did this in a past nightmare Struts project), and
> have multiple frames update at the same time, you need a smart frameset
> that can direct things.  You'd want the tree frame to update and the
> "detail" frame also.
>
> IMHO, its just not worth it.  You can get frame-like appearances by
> using a nice Border component and keep life much much simpler.


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: HELP! Re: About contrib:Tree

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
You're going to find this very hard to do.  See a previous thread, 
search for "frames suck" :)

To use frames (and we did this in a past nightmare Struts project), and 
have multiple frames update at the same time, you need a smart frameset 
that can direct things.  You'd want the tree frame to update and the 
"detail" frame also.

IMHO, its just not worth it.  You can get frame-like appearances by 
using a nice Border component and keep life much much simpler.

	Erik


On Apr 13, 2004, at 7:32 AM, Vjeran Marcinko wrote:

> Hi again.
>
> I stumbled upon one big problem, and dunno if contrib:Tree supports at 
> all
> this use case -
> Lots of times are Tree components used in *framed* web pages since it 
> is
> convinient to place them in some "left" frame to present hierarchical
> structure of some kind, and "right" frame is for details/attributes of 
> the
> selected tree node. Frame is good for tree because scrollbars will be 
> shown
> if tree becomes too "deep" to present.
>
> Problem is that when some node is selected in contrib:Tree, then "left"
> frame gets reloaded to show child nodes, but I would like also to 
> somehow
> update "right" frame to display attributes of that selected parent 
> node (not
> only leaf nodes have attributes).
> Can web/http request update at all more than one page - left and right 
> frame
> in same time ? I guess not, or maybe I'm dumb :-(
> If not, that means that I would have to have some way to separate :
> 1. expanding parent node which reloads tree frame
> 2. trigger parent node selection which updates right "attributes" 
> frame to
> show me details about it
>
> Any sugestions ?? Is any of this possible to achieve by contrib:Tree ?
>
> Regards,
> Vjeran
>
> ----- Original Message -----
> From: "Erik Hatcher" <er...@ehatchersolutions.com>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Tuesday, April 13, 2004 12:35 PM
> Subject: Re: About contrib:Tree
>
>
>> I'm not changing the tree component - simply using it based on the
>> Workbench examples and what I can deduce from the source code of it.
>> I'm building (a prototype) menu component which encapsulates a
>> contrib:Tree.
>>
>> It lacks docs, but I'm in no position currently to assist in that
>> situation.
>>
>> Erik
>>
>> On Apr 13, 2004, at 4:24 AM, Vjeran Marcinko wrote:
>>
>>> Hi folks.
>>>
>>> Is contrib:Tree currently being restructured/changed, or it just 
>>> lacks
>>> docs
>>> ?
>>> I'm asking this because I started using it by examining sources from
>>> Workbench tree example, but I would stop that if it's gonna change 
>>> soon
>>> (Erik said he's working with it something, some days ago), thus will
>>> require
>>> maybe some new way of using it ?
>>>
>>> Regards,
>>> Vjeran
>
>
> ---------------------------------------------------------------------
> 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