You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Sharath2k <sh...@yahoo.co.in> on 2009/01/21 23:34:59 UTC

Re: How to display popup using t:popup only on click of a link?

Hi Madhav,

This might be late reply,
but Im also having the same scenario.Can you pls share your solution.


Thanks and Regards,
Chandu


Madhav Bhargava-2 wrote:
> 
> 
> Hi All,
> 
>  
> 
> I have a requirement where I need to mimic the directory structure of
> windows. The tree directory structure can be changed by right clicking
> on one of the items, similar to what windows has.
> 
> What I have done is the following:
> 
>  
> 
> I have defined a tree structure using t:tree2 component. The only
> problem with that component is that it does not restore open state as
> the t:panelNavigation2 component does. Each of the facets in the tree
> encloses just a t:commandLink component. This command link component is
> wrapped with t:popup.
> 
>  
> 
> So now when the user hovers over a node in the tree (which is a link)
> then a popup is displayed. All this is fine but I have a few problems:
> 
>  
> 
> 1.	I want the popup to be displayed on click of the link and not on
> mouse over event. How can I change the behavior of t:popup so that it
> gets displayed on mouse click event and not mouse over event?
> 2.	Say if there is some way in which the first requirement can be
> met then how do I pass the value of the node back to the backing bean?
> It can be done by having a hidden variable and having an onclick event
> on the node (since each node is also a link). But I was looking at using
> t:updateActionListener and then passing back the value of the node and
> setting a property in the backing bean. How do I access another
> component's value and pass it on the click of a menu item (a command
> button) in the popup.
> 
>  
> 
> To clarify point number 2:
> 
>  
> 
> Consider the following tree layout:
> 
>  
> 
> Root
> 
>    DummyNode1
> 
>         DummySub1.1
> 
>    DummyNode2
> 
>         DummySub2.1
> 
>         DummySub2.2
> 
>         DummySub2.3
> 
>  
> 
> Now when I click DummyNode2 then a popup with the following content
> should be shown:
> 
>  
> 
> Add Sub Folder
> 
> Modify Folder Properties
> 
> Etc...
> 
>  
> 
> So now when the user clicks Add Sub Folder I need to pass DummyNode2 to
> the backing bean. What is the best way to do this?
> 
>  
> 
> Thanks,
> 
> Madhav
> 
> 
> 
> **************** CAUTION - Disclaimer *****************
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
> solely for the use of the addressee(s). If you are not the intended
> recipient, please notify the sender by e-mail and delete the original
> message. Further, you are not to copy, disclose, or distribute this e-mail
> or its contents to any other person and any such actions are unlawful.
> This e-mail may contain viruses. Infosys has taken every reasonable
> precaution to minimize this risk, but is not liable for any damage you may
> sustain as a result of any virus in this e-mail. You should carry out your
> own virus checks before opening the e-mail or attachment. Infosys reserves
> the right to monitor and review the content of all messages sent to or
> from this e-mail address. Messages sent to or from this e-mail address may
> be stored on the Infosys e-mail system.
> ***INFOSYS******** End of Disclaimer ********INFOSYS***
> 

-- 
View this message in context: http://www.nabble.com/How-to-display-popup-using-t%3Apopup-only-on-click-of-a-link--tp10194343p21593621.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


RE: How to display popup using t:popup only on click of a link?

Posted by Madhav Bhargava <Ma...@infosys.com>.
We made a custom control during that time, however I would suggest that you have a look at ContextMenu component from richfaces. It will hopefully satisfy your need.

Regards,
Madhav

-----Original Message-----
From: Sharath2k [mailto:sharathaku@yahoo.co.in] 
Sent: Thursday, January 22, 2009 4:05 AM
To: users@myfaces.apache.org
Subject: Re: How to display popup using t:popup only on click of a link?


Hi Madhav,

This might be late reply,
but Im also having the same scenario.Can you pls share your solution.


Thanks and Regards,
Chandu


Madhav Bhargava-2 wrote:
> 
> 
> Hi All,
> 
>  
> 
> I have a requirement where I need to mimic the directory structure of
> windows. The tree directory structure can be changed by right clicking
> on one of the items, similar to what windows has.
> 
> What I have done is the following:
> 
>  
> 
> I have defined a tree structure using t:tree2 component. The only
> problem with that component is that it does not restore open state as
> the t:panelNavigation2 component does. Each of the facets in the tree
> encloses just a t:commandLink component. This command link component is
> wrapped with t:popup.
> 
>  
> 
> So now when the user hovers over a node in the tree (which is a link)
> then a popup is displayed. All this is fine but I have a few problems:
> 
>  
> 
> 1.	I want the popup to be displayed on click of the link and not on
> mouse over event. How can I change the behavior of t:popup so that it
> gets displayed on mouse click event and not mouse over event?
> 2.	Say if there is some way in which the first requirement can be
> met then how do I pass the value of the node back to the backing bean?
> It can be done by having a hidden variable and having an onclick event
> on the node (since each node is also a link). But I was looking at using
> t:updateActionListener and then passing back the value of the node and
> setting a property in the backing bean. How do I access another
> component's value and pass it on the click of a menu item (a command
> button) in the popup.
> 
>  
> 
> To clarify point number 2:
> 
>  
> 
> Consider the following tree layout:
> 
>  
> 
> Root
> 
>    DummyNode1
> 
>         DummySub1.1
> 
>    DummyNode2
> 
>         DummySub2.1
> 
>         DummySub2.2
> 
>         DummySub2.3
> 
>  
> 
> Now when I click DummyNode2 then a popup with the following content
> should be shown:
> 
>  
> 
> Add Sub Folder
> 
> Modify Folder Properties
> 
> Etc...
> 
>  
> 
> So now when the user clicks Add Sub Folder I need to pass DummyNode2 to
> the backing bean. What is the best way to do this?
> 
>  
> 
> Thanks,
> 
> Madhav
> 
> 
> 
> **************** CAUTION - Disclaimer *****************
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
> solely for the use of the addressee(s). If you are not the intended
> recipient, please notify the sender by e-mail and delete the original
> message. Further, you are not to copy, disclose, or distribute this e-mail
> or its contents to any other person and any such actions are unlawful.
> This e-mail may contain viruses. Infosys has taken every reasonable
> precaution to minimize this risk, but is not liable for any damage you may
> sustain as a result of any virus in this e-mail. You should carry out your
> own virus checks before opening the e-mail or attachment. Infosys reserves
> the right to monitor and review the content of all messages sent to or
> from this e-mail address. Messages sent to or from this e-mail address may
> be stored on the Infosys e-mail system.
> ***INFOSYS******** End of Disclaimer ********INFOSYS***
> 

-- 
View this message in context: http://www.nabble.com/How-to-display-popup-using-t%3Apopup-only-on-click-of-a-link--tp10194343p21593621.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.