Reputation: 11
That's exactly what I am looking for ... I need to show a rich:modalPanel automatically when the page has ended loading.
This is my approach so far:
MAIN.XHTML
<script type="text/javascript">
function openPopUp(){
if(#{rich:element('popUpAltaTrenesEstaciones')}.value == 'true'){
#{rich:component('idAltaPlantillasTrenesEstacionesPop')}.show();
return false;
}
}
</script>
.........
<a4j:include id="popUp" viewId="AltaPlantillasTrenesEstacionesPopUp.xhtml" />
.....
<a4j:outputPanel ajaxRendered="true">
<h:inputText id="popUpAltaTrenesEstaciones"
value="#{altaPlantillasTrenesEstaciones.showPopUp}"
style="display:none;" />
</a4j:outputPanel>
BACKING BEAN. JAVA
private boolean showPopUp;
@PostConstruct
public void init() {
...
setShowPopUp(true);
}
POPUP.XHTML
<rich:modalPanel id="idAltaPlantillasTrenesEstacionesPop" height="200"
width="400" rendered="true">
<a4j:form>
........
</a4j:form>
</rich:modalPanel>
WHAT AM I DOING WRONG??? DO I NEED TO ADD ANYTHING ELSE?
THANK YOU
Upvotes: 1
Views: 3325
Reputation: 70564
You might want to call the function openPopup()
you have declared ...
Upvotes: 0