Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to display richPopupPanel wondow from javascript

 
Jaik Singh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 171
Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By defining display style "none" an element will be displayed in a HTML form. Have refer the following link for more clarification.

webpage
 
Kumaravadivel Subramani
Ranch Hand
Posts: 171
Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"will not be displayed". sorry type mistake ...
 
Jaik Singh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18020
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jaik Singh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any thought, Tim???

Thanks
Jaik
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18020
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic