[prev in list] [next in list] [prev in thread] [next in thread] 

List:       myfaces-user
Subject:    Re: submitting tree2 node to a serlvet
From:       "Rob Decker" <rob () objectsource ! org>
Date:       2005-04-28 12:41:58
Message-ID: 013601c54bef$abaa0340$1400a8c0 () source
[Download RAW message or body]

The target attribute would acclomplish that too. I'm not sure if commandLink
has it but it should.


----- Original Message ----- 
From: "Mihir Solanki" <mihir.solanki@patni.com>
To: "'Rob Decker'" <rob@objectsource.org>
Sent: Thursday, April 28, 2005 1:54 AM
Subject: RE: submitting tree2 node to a serlvet


Thanks Rob...
Using outputLink I got my things working here...
Now I am able to open the document in the right frame when I click on tree
node.

One more thing I would like to ask is,
I am using "commandLink" in some type of nodes in my tree. Now what I want
to have is whenever such type of node is clicked I want to have an action
event fire and also I want to refresh the right frame with some new data.

So is it possible?

Mihir

-----Original Message-----
From: Rob Decker [mailto:rob@objectsource.org]
Sent: Wednesday, April 27, 2005 6:40 PM
To: MyFaces Discussion; mihir.solanki@patni.com
Subject: Re: submitting tree2 node to a serlvet

Have you tried using a plain old outputLink that targets the frame? I've
been thinking about trying to just use the tree in a struts app and if I
could put it in  a frame and link to my jsp from it I'd probably save alot
of time.


----- Original Message ----- 
From: "Mihir Solanki" <mihir.solanki@patni.com>
To: "'MyFaces Discussion'" <users@myfaces.apache.org>; "'Sean Schofield'"
<sean.schofield@gmail.com>; "'Enrique Medina'" <e.medina.m@gmail.com>
Sent: Wednesday, April 27, 2005 4:32 AM
Subject: RE: submitting tree2 node to a serlvet


Sean / Enrique

Actually in my case I have two html frames. In left frame I have a tree and
I right side frame I need to open the selected document (from tree).

Now my only concern is how to call a servlet when I click on document type
node
and hence I can open the document in right frame (I know the code of
streaming the document content).

If possible please guide me with some code snippest...

Below is my code snippet of JSF

<f:facet name="folder">
<h:panelGroup>
<h:commandLink immediate="true" style="text-decoration:
none;" action="#{t.toggleExpanded}"
actionListener="#{CabinetTree.processAction}">

<h:graphicImage value="/images/blue-folder-open.gif"
align="middle" rendered="#{t.nodeExpanded}"
border="0"/>
<h:graphicImage
value="/images/blue-folder-closed.gif"
align="middle" rendered="#{!t.nodeExpanded}"
border="0"/>
<h:outputText value="#{node.description}"
styleClass="nodeTree"/>
<h:outputText value=" (#{node.childCount})"
styleClass="childCount" rendered="#{!empty
node.children}"/>
</h:commandLink>
</h:panelGroup>
</f:facet>
<f:facet name="document">
<h:panelGroup>
<h:commandLink immediate="true" style="text-decoration:
none;" target="contents" action="test.jsp">

<h:graphicImage value="/images/document.gif"
align="middle" border="0"/>

<h:outputText value="#{node.description}"
styleClass="nodeTree"/>

</h:commandLink>
</h:panelGroup>
</f:facet>

-----Original Message-----
From: Sean Schofield [mailto:sean.schofield@gmail.com]
Sent: Monday, April 25, 2005 9:37 PM
To: MyFaces Discussion; Enrique Medina
Subject: Re: submitting tree2 node to a serlvet

You can also have a param whose value is the node identifier.   That
is one of the uses I had envisioned for the identifier property (use
the documnet number as the node identifier.)  Then just have your
command link point you to the servlet.

I think this is one of the cool parts of tree2.  It is very
open-ended.  You just use the standard approaches that work in other
situations.  So there is nothing special about tree2 that you need to
know here.  Take the same approach that you would with h:dataTable.

sean


On 4/25/05, Enrique Medina <e.medina.m@gmail.com> wrote:
> Hi,
>
> First you have to create the tree data (see getTreeData() method from
> the examples) passing an extra parameter to the TreeNodeBase
> constructor, in order to give each node an identifier (I have given
> the page to navigate to, for example).
>
> Then, indicate in the action of the commandLink component the following:
>
>         <f:facet name="document">
>                 <x:panelGroup>
>                         <x:commandLink immediate="true"
action="#{myBean.menuAction}">
>                                 <h:graphicImage
value="images/document.png" border="0" />
>                                 <x:outputText value="#{node.description}"
/>
>                                 <f:param name="action"
value="#{node.identifier}" />
>                         </x:commandLink>
>                 </x:panelGroup>
>         </f:facet>
>
> As you can see, you will have to define a method in your "myBean" bean
> in order to be able to execute the action:
>
> public String menuAction()
> {
>                 return (String)
FacesContext.getCurrentInstance().getExternalContext()
>                                 .getRequestParameterMap().get("action");
> }
>
> Notice that you ask for a request parameter named "action", which must
> match the name of the param you provided in the JSP view.
>
> In my case, this method returns the identifier of the node clicked,
> which is the page to go in the navigation model.
>
> You will only have to provide different logic to that method.
>
> Hope it helps,
> Enrique Medina.
>
> On 4/25/05, Mihir Solanki <mihir.solanki@patni.com> wrote:
> >
> >
> >
> > Hi,
> >
> >
> >
> > I am using tree2 component.
> >
> >
> >
> > I have a kind of windows explorer UI, where in my tree nodes are formed
with
> > folders, sub-folders and files.
> >
> > For the same I have three different facets like "folder", "sub-folder"
and
> > "document" in my tree2 component.
> >
> >
> >
> > Now what I want to have is, whenever "document" type node is clicked I
have
> > to open that particular document in my browser window.
> >
> > For that I guess I need to submit my action to the HttpServlet which
reads
> > the file data and opens in the browser window (by putting file data in
the
> > Servlet stream).
> >
> >
> >
> > Can anybody tell me how can I submit the click action of any tree node
to
> > HttpServlet?
> >
> > Or is there any other way to achieve the above kind of functionality?
> >
> >
> >
> > Thanks
> >
> > Mihir Solanki
> >  ________________________________
> >
> >
> >
> > Patni Computer Systems Ltd.
> >
> >
> > Tel : 91 79 23240905 Ext : 413
> >
> >
> > http://www.patni.com
> >  World-Wide Partnerships. World-Class Solutions.
> > _____________________________________________________________________
> >
> >  This e-mail message may contain proprietary, confidential or legally
> > privileged information for the sole use of the person or entity to whom
this
> > message was originally addressed. Any review, e-transmission
dissemination
> > or other use of or taking of any action in reliance upon this
information by
> > persons or entities other than the intended recipient is prohibited. If
you
> > have received this e-mail in error kindly delete this e-mail from your
> > records. If it appears that this mail has been forwarded to you without
> > proper authority, please notify us immediately at netadmin@patni.com and
> > delete this mail.
> > _____________________________________________________________________
>



http://www.patni.com
World-Wide Partnerships. World-Class Solutions.
_____________________________________________________________________

This e-mail message may contain proprietary, confidential or legally
privileged information for the sole use of the person or entity to
whom this message was originally addressed. Any review, e-transmission
dissemination or other use of or taking of any action in reliance upon
this information by persons or entities other than the intended
recipient is prohibited. If you have received this e-mail in error
kindly delete  this e-mail from your records. If it appears that this
mail has been forwarded to you without proper authority, please notify
us immediately at netadmin@patni.com and delete this mail.
_____________________________________________________________________



http://www.patni.com
World-Wide Partnerships. World-Class Solutions.
_____________________________________________________________________

This e-mail message may contain proprietary, confidential or legally
privileged information for the sole use of the person or entity to
whom this message was originally addressed. Any review, e-transmission
dissemination or other use of or taking of any action in reliance upon
this information by persons or entities other than the intended
recipient is prohibited. If you have received this e-mail in error
kindly delete  this e-mail from your records. If it appears that this
mail has been forwarded to you without proper authority, please notify
us immediately at netadmin@patni.com and delete this mail.
_____________________________________________________________________

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic