| Author |
How to display richPopupPanel wondow from javascript
|
Jaik Singh
Greenhorn
Joined: Sep 22, 2010
Posts: 20
|
|
Hello All,
I have one code like below of Rich PopupPanel.
Code:-
===============
<rich:popupPanel id="simplePopup1" autosized="true" width="300"
height="60" moveable="true" resizeable="false" zindex="100"
onmaskclick="#{rich:component('simplePopup1')}.hide()">
<f:facet name="header">
<h: outputText value="Popup" />
</f:facet>
<f:facet name="controls">
<h: outputLink value="#"
onclick="#{rich:component('simplePopup1')}.hide(); return false;">
X
</h: outputLink>
</f:facet>
<a4j:region>
<a4j: outputPanel ajaxRendered="true">
<h:form ajaxSubmit="true">
<h:panelGrid columns="1">
<a4j:commandLink action="#{popupBean.eventHandler.onClose}"
value="close" immediate="true" />
</h:panelGrid>
</h:form>
</a4j: outputPanel>
</a4j:region>
</rich:popupPanel>
I am able to make this popup visible using the a4j:commandbutton. But instead of that, I want to show this popup window using the javascript code.
Anyone have any idea, how to achieve that.
I have been trying with below code but its not working.
<a4j: outputPanel>
<script type="text/javascript">
javascript:document.getElementById('simplePopup1').style.display = 'none'; //or javascript:rich:component('simplePopup1')}.show();
</script>
</a4j: outputPanel>
Thanks
Jaikrat Singh
|
 |
Kumaravadivel Subramani
Ranch Hand
Joined: Jul 05, 2008
Posts: 159
|
|
By defining display style "none" an element will be displayed in a HTML form. Have refer the following link for more clarification.
webpage
|
No pain, No gain.
OCJP 1.6
|
 |
Kumaravadivel Subramani
Ranch Hand
Joined: Jul 05, 2008
Posts: 159
|
|
|
"will not be displayed". sorry type mistake ...
|
 |
Jaik Singh
Greenhorn
Joined: Sep 22, 2010
Posts: 20
|
|
Sorry, my mistake. But even if I use
document.getElementById('popupContainer:popupView1:simplePopup1').style.display='block';
it does not work.
Thanks
Jaikrat
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 12513
|
|
I wouldn't attempt to use dynamic CSS to show/hide a RichFaces popup panel. They wouldn't be aware of the internal functionality of the panel.
Actually, I can't find "rich:popupPanel" in the live documentation. I don't know if that's because you're using the newer RichFaces that isn't in production or if you simply created a RichFaces tag that doesn't exist.
I've been using the rich:modalPanel and it works just fine with the show and hide javascript functions.
|
One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
|
 |
Jaik Singh
Greenhorn
Joined: Sep 22, 2010
Posts: 20
|
|
Agree Tim. Even earlier I was using modalPanel and doing this hide/show with javascript:Richfaces.showModalPanel(...) method. But I think this modalPanel component is no more available since RichFaces4.x.
Please correct my understanding if I am wrong.
Thanks
Jaikrat Singh
|
 |
Jaik Singh
Greenhorn
Joined: Sep 22, 2010
Posts: 20
|
|
Any thought, Tim???
Thanks
Jaik
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 12513
|
|
Sorry. I haven't had the luxury of attempting RichFaces 4 yet. But it's still fairly unstable, if what I hear from a distance is any indication.
I'll be glad when it goes live, though, since there are significant advantages in its design.
As far as losing support for the modalDialog, I hope not. That's supposed to be one of the big advantages of using Java. Unlike a certain other drafty platform, Java deprecates instead of simply yanking old stuff out from underneath you.
|
 |
 |
|
|
subject: How to display richPopupPanel wondow from javascript
|
|
|