Bryan,

Nice looking interface BTW.  It looks as though you are using the tree
to expand and collapse rows in the table according to the node
hiearchy.  Is that accurate to say?  I guess that has its uses.

Anyways, I am willing to work with you guys on it.  As a starting
point, you should familiarize yourself with Tree2 so we have a common
reference point.  I don't really need this myself so I am not going to
spend a lot of time developing something that someone else may or may
not decide to use.

I don't think there will be a lot of extra work to get the tree table
version of tree2 working.  Also, keep in mind that tree2 supports
javascript opening of nodes (as an option) which is much faster.  I
would think that would be something of interest to you folks.

Let me know once you are up to speed on tree2 and we can get started.

sean



On Thu, 24 Feb 2005 10:14:01 -0700, Bryan Dickey
<[EMAIL PROTECTED]> wrote:
> Sean and David,
> 
> Attached is a gif showing a real-world example of the usefulness of the
> Tree Table component.  I'm working for Young Living, a multi-level
> marketing company.  Tree structure and display is of central importance
> to us and our distributors.  The attached image is our downline viewer,
> with a treeColumn showing names and supporting columns with information
> such as level, member ID, purchases/business-building stats, and action
> buttons (email current member, view detailed personal info, view bonuses
> earned, etc.).  Support for a Tree2 Table comp would be greatly
> appreciated!  I'll take a look at the Tree2 functionality/source, too.
> 
> The image is also available here:
> http://bryandickey.com/images/downline_viewer.gif
> 
> Thanks,
> Bryan
> 
> >>> [EMAIL PROTECTED] 02/24/05 06:34AM >>>
> David,
> 
> I took a look at your document.  I think we can probably pull
> something like this off.  Perhaps you can help me modify the tree2 to
> do this?
> 
> It looks like you have an entire tree as the basis for the tree with
> various aspects of the node for the columns.  In the second column you
> have chosen to display the actual tree.  I suppose when you click on
> the nodes you also expand/collapse the rows in the table.  Is this
> right?
> 
> Personally, I can't imagine a use for this type of display, but as you
> point out, there are a lot users using it ;-)  I will do my best to
> support it but as I said, it would be nice if you could take a look at
> what I've done so far and maybe give me some help in doing it.
> 
> sean
> 
> On Thu, 24 Feb 2005 04:05:28 -0800 (PST), David Le Strat
> <[EMAIL PROTECTED]> wrote:
> > Sean,
> >
> > I have not had a chance to look at your new component,
> > but if you are going to drop the old component, can
> > you make sure that the new one supports the
> > functionality described in the enclosed document.  I
> > implemented that functionality and it seems that quite
> > a few users have found usage for such an extension of
> > the tree component.
> >
> > Regards,
> >
> > David Le Strat.
> >
> > --- Sean Schofield <[EMAIL PROTECTED]> wrote:
> >
> > > Bryan,
> > >
> > > I don't know much about TreeTable but there are
> > > plans to eventually
> > > drop support for the old tree component in favor of
> > > a new one that has
> > > been developed.  My advice to you is to check out
> > > the new tree2 in the
> > > CVS.  Also, you can download a WAR file with a built
> > > in example if you
> > > search this list you will find Matthias' post of
> > > that.
> > >
> > > If you find that the new tree component cannot do
> > > something that you
> > > need, then please let us know so we can address
> > > that.
> > >
> > > sean
> > >
> > >
> > > On Wed, 23 Feb 2005 15:17:13 -0700, Bryan Dickey
> > > <[EMAIL PROTECTED]> wrote:
> > > > I found a solution to my problem... I was almost
> > > there.
> > > >
> > > > *In my jsp I have something similar to:
> > > >
> > > > ....
> > > > <h:column>
> > > > <h:commandLink
> > > action="#{action.viewDetailedUserInfo}">
> > > > <h:graphicImage
> > > value="images/detailed_user_info.gif" border="0"/>
> > > > <f:param name="selectedid"
> > > value="#{userObject.ID}"/>
> > > > </h:commandLink>
> > > > </h:column>
> > > > ....
> > > >
> > > > *And the action method:
> > > >
> > > > public String viewDetailedUserInfo() {
> > > >
> > > > String selectedID = (String)
> > >
> >
> app.createValueBinding("#{param.selectedid}").getValue(facesContext);
> > > >
> > > > //do something with selected id
> > > >
> > > >  return "viewDetailedUserInfo";
> > > >  }
> > > >
> > > > In viewDetailedUserInfo() I could have instead
> > > retrieved the param using
> > >
> >
> FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().
> > > >
> > > > I still would like to know why the two approaches
> > > described in my first email don't work... if anyone
> > > cares to comment.
> > > >
> > > > Thanks,
> > > > Bryan
> > > >
> > > > >>> Bryan Dickey 02/23/05 01:10PM >>>
> > > > How can I access the selected/current row/node in
> > > an action method using the Tree TABLE component?
> > > >
> > > > *I've tried the following with no success:
> > > >
> > >
> >
> ______________________________________________________________________________________
> > > >
> > > > <h:form>
> > > > <x:tree var="userObject" ... >
> > > > <x:treeColumn><h:outputText
> > > value="#{userObject.name}"/></x:treeColumn>
> > > > <h:column><h:outputText
> > > value="#{userObject.ID}"/></h:column>
> > > > <h:column><h:commandButton
> > > image="images/detailed_user_info.gif"
> > > action="#{action.viewDetailedUserInfo}"/></h:column>
> > > > <x:treeSelectionListener
> > > type="backing.ActionBean"/>
> > > > </x:tree>
> > > > </h:form>
> > > >
> > > >
> > >
> >
> .....................................................................................................................................
> > > >
> > > > public class ActionBean implements
> > > TreeSelectionListener {
> > > > ....
> > > > public void valueChanged(TreeSelectionEvent event)
> > > {
> > > > DefaultMutableTreeNode selectedNode =
> > > (DefaultMutableTreeNode)
> > > event.getNewSelectionPath().getLastPathComponent();
> > > > }
> > > > }
> > > >
> > >
> >
> ______________________________________________________________________________________
> > > >
> > > > In this case, method "valueChanged" never seems to
> > > be called when the commandButton is clicked.
> > > >
> > > > *I also tried the standard approach used with
> > > datatables (with no success):
> > > >
> > >
> >
> ______________________________________________________________________________________
> > > >
> > > > public class ActionBean {
> > > > ....
> > > > public String viewDetailedUserInfo() {
> > > > FacesContext facesContext =
> > > FacesContext.getCurrentInstance();
> > > > Application app = facesContext.getApplication();
> > > >
> > > > Integer selectedID = (Integer)
> > >
> > app.createValueBinding("#{userObject.ID}")..getValue(facesContext);
> > > >
> > > > return "viewDetailedUserInfo";
> > > > }
> > > > }
> > > >
> > >
> >
> ______________________________________________________________________________________
> > > >
> > > > In this case, the var object (userObject) is not
> > > associated with the selected row in the action.
> > > Instead, it returns the last row/userObject.  The
> > > same occurs if I put viewDetailedUserInfo() in the
> > > userObject class (to access id field directly while
> > > in action method).
> > > >
> > > > The only two possible solutions I can think of are
> > > not desirable in my case.  One would involve using a
> > > commandLink instead of commandButton and passing the
> > > current id as a parameter (child of commandLink tag:
> > > <f:param name="selectedID"
> > > value="#{userObject.ID}"/>) and getting it from the
> > > request map in action method.  This is undesirable
> > > because we need a clickable image.  The other would
> > > involve using a separate form for each row and
> > > including <h:inputHidden id="selectedID"
> > > value="#{userObject.ID}"/>, then getting it from the
> > > request map.  This is undesirable because the
> > > javascript MyFaces generates per form creates
> > > significant overhead when displaying a large tree.
> > > >
> > > > I hope I have done enough homework to warrant a
> > > response from the community.  Thanks for any
> > > suggestions you may have!
> > > >
> > > > Best regards,
> > > > Bryan Dickey
> > > >
> > > >
> > >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Sports - Sign up for Fantasy Baseball.
> > http://baseball.fantasysports.yahoo.com/
> >
> >
> 
> 
>

Reply via email to