wood burning stoves 2.0*
The moose likes JSF and the fly likes Popupwindow using  commandlink Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Popupwindow using  commandlink" Watch "Popupwindow using  commandlink" New topic
Author

Popupwindow using commandlink

Dwijen Bhattacharjee
Greenhorn

Joined: Mar 31, 2008
Posts: 26
Hi ,
I need to open a popup from a jsf page.
I tried with 2 options-

1. h:commandlink
Problem- It doesnot have onclick event so not able to show popup

2. hutputlink
problem- it doesn't have action or actionListener.

Actually what i am doing is that--
My application has a datatable and one column has h:commandlink (Store Number)
on click on that i need to interacted with database and open a popup which will show the details of the particular store.
so for that one i need to on bean methos and pass the store number to that method.

How can i implement these in JSf.

Please help.
Ketan Jambhekar
Ranch Hand

Joined: Mar 26, 2007
Posts: 37
Hi Dwijen,
You can try the target attribute in commandLink. This will open a new window.


Hope this helps.
Ketan.
Denise Smith
Ranch Hand

Joined: Jul 26, 2005
Posts: 36
The target attribute of <h:commanLink> has never worked for me-maybe it has to do with the version of jsf that I'm using. Either way...Try this it works for me...
On the command link itself... add an onmousedown like so-->
<h:commandLink styleClass="commandLink" id="CheckLnk"
action="#{pc_ADet.doCheckLnkAction}"
onmousedown="document.forms['YOUR_FORM_NAME_GOES_HERE'].target='_blank';">
<hutputText id="CheckTxt"
styleClass="outputText" value="Report">
</hutputText>
</h:commandLink>

Let me know if this meets your needs!


Surround yourself with learners...They will educate you!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Popupwindow using commandlink
 
Similar Threads
Opening popUp window in JSF
I need to open a popup from a jsf page.
Closing windows in JavaScript
Checking if main page has changed
Syntax for the h:commandLink param functionality