开发者

JSF RichFaces - How to show a rich:modalPanel when page loaded?

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;

    @PostC开发者_JS百科onstruct
    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


There is 'showWhenRendered' attribute or similar.


You might want to call the function openPopup() you have declared ...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜