This content has been marked as final.
Show 3 replies
-
1. Re: should modalPanel cause a postback onshow
ilya_shaikovsky Sep 17, 2008 6:31 AM (in response to powerhouse_b)show your code please. probable you using some a4j: or h: command components to use the modal.
-
2. Re: should modalPanel cause a postback onshow
powerhouse_b Sep 17, 2008 6:49 AM (in response to powerhouse_b)Here is my modal Panel:
<f:subview id="loginsubview" > <rich:modalPanel id="loginModal" height="150" width="350" minWidth="350"> <f:facet name="header"> <h:outputText value="Login Window" /> </f:facet> <f:facet name="controls"> <h:graphicImage value="/images/close.png" style="cursor:pointer" onclick="Richfaces.hideModalPanel('loginModal')" /> </f:facet> <a4j:form id="loginform" ajaxSubmit="true"> <div align="center"> <h:outputText value="#{messages.pleaseLogin}" style="text-align: center; width: 100%;" /> </div> <a4j:region renderRegionOnly="false"> <div align="center"> <h:panelGrid columns="2" rowClasses="prop" columnClasses="name,value"> <h:outputLabel for="username" value="#{messages.Username}"></h:outputLabel> <h:inputText id="username" value="#{Authentificator.username}" styleClass="rd-pnl-txt" style="background-color:#D1E8D1;" onblur="this.style.margin = '1px'; this.style.borderWidth = '1px'; this.style.backgroundColor = '#D1E8D1';" onfocus="this.style.margin = '0'; this.style.borderWidth = '2px'; this.style.backgroundColor = '#FFFFFF';"> </h:inputText> <h:outputLabel for="password" value="#{messages.Password}"></h:outputLabel> <h:inputSecret id="password" value="#{Authentificator.password}" styleClass="rd-pnl-txt" style="background-color:#D1E8D1;" onblur="this.style.margin = '1px'; this.style.borderWidth = '1px'; this.style.backgroundColor = '#D1E8D1';" onfocus="this.style.margin = '0'; this.style.borderWidth = '2px'; this.style.backgroundColor = '#FFFFFF';"> </h:inputSecret> </h:panelGrid> </div> <div align="center"> <a4j:commandButton value="Login" action="#{Authentificator.login}" id="loginModalButton" reRender="topmenupanel,rightmenupanel,indexmessages,wstablepanel,auxiliarmenupanel" styleClass="dr-pbl-bnt" status="progressMain"/> <rich:componentControl for="loginsubview:loginModal" attachTo="loginModalButton" operation="hide" event="onclick"/> </div> </a4j:region> </a4j:form> </rich:modalPanel> </f:subview>
This is used to show the modal panel.<f:view> // ............ <a4j:form id="topmenuform"> <a4j:outputPanel layout="none" id="topmenupanel"> <div class="header"> <h1><a href="#">huddi</a></h1> <h2> <h:outputText value="human uddi - #{messages.wssc}" /> </h2> <div style="width: 100%;" id="uplinks"> <table width="100%"> <tr> <td align="left" width="75%;"> <h:commandLink value="RO " action="#{LocaleSelector.setLocaleRo}" /> <h:commandLink value=" EN" action="#{LocaleSelector.setLocaleEn}" /> </td> <td align="right" width="20%"> <a4j:commandLink id="logincommand" value="#{messages.Login} " rendered="#{!Authentificator.authentificated}" status="progressMain"/> <rich:componentControl for="loginsubview:loginModal" attachTo="logincommand" operation="show" event="onclick" params="top: 75, left: window.innerWidth - 410"/> <h:outputText id="welcometext" value="#{messages.Welcome}, #{Authentificator.username} " rendered="#{Authentificator.authentificated}" style="color: white;"/> </td> <td align="right" width="10"> <div align="center"> <p style="color: white;">|</p> </div> </td> <td align="left" width="30"> <h:outputLink id="registerlink" value="/huddi/pages/register.jsf" rendered="#{!Authentificator.authentificated}" > <h:outputText value=" #{messages.register_register}" /> </h:outputLink> <a4j:commandLink id="logoutcommand" value="#{messages.Logout}" action="#{Authentificator.logout}" rendered="#{Authentificator.authentificated}" reRender="topmenupanel" status="progressMain"/> </td> </tr> </table> </div> </div> </a4j:outputPanel> </a4j:form> <f:view>
-
3. Re: should modalPanel cause a postback onshow
ilya_shaikovsky Sep 17, 2008 7:29 AM (in response to powerhouse_b)so you using a4j:command to show/close the panel this will cause the request for sure.
use just h:outputLink as it shown in demo.
and this is not about it but do not use ajaxSubmit="true" without nessesity on the form. You already use a4j:command controls. So this attribute usage not nessesary.