This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Pipeline as Code and have Mohamed Labouardy on-line!
See this thread for details.
Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Popupwindow using commandlink

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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. h:outputlink
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.
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dwijen,
You can try the target attribute in commandLink. This will open a new window.


Hope this helps.
Ketan.
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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';">
<h:outputText id="CheckTxt"
styleClass="outputText" value="Report">
</h:outputText>
</h:commandLink>

Let me know if this meets your needs!
 
There is no "i" in denial. Tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic