-
1. Re: how to stop modal panel on required fields
sergeysmirnov Jun 22, 2007 12:53 PM (in response to ivan.tufegdzic)could you provide some code snippet of the page to illustrate your needs?
-
2. Re: how to stop modal panel on required fields
ivan.tufegdzic Jun 25, 2007 4:23 AM (in response to ivan.tufegdzic)Yes, I can.
Here
<a4j:form xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:t="http://myfaces.apache.org/tomahawk"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:lmg="http://www.livemediagroup.de/jsf"
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
xmlns:ss="http://myfaces.apache.org/sandbox"
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets">
<rich:panel rendered="#{not empty currentCompanyUser}">
<ss:fieldset>
<s:decorate id="login" template="/layout/edit.xhtml">
<ui:define name="label">#{messages.newUserLogin}</ui:define>
<h:inputText size="30" required="true"
value="#{currentCompanyUser.login}">
<a4j:support event="onblur" reRender="login" bypassUpdates="true" />
</h:inputText>
</s:decorate>
<s:decorate id="passw" template="/layout/edit.xhtml">
<ui:define name="label">#{messages.newUserPassw} [5-15 #{messages.chars}]</ui:define>
<t:inputSecret size="30" required="true"
value="#{currentCompanyUser.password}">
<a4j:support event="onblur" reRender="passw" bypassUpdates="true" />
<f:validateLength minimum="5" maximum="15" />
</t:inputSecret>
</s:decorate>
<s:decorate id="passwcomp" template="/layout/edit.xhtml">
<ui:define name="label">#{messages.newUserPasswVer}</ui:define>
<t:inputSecret size="30" required="true"
value="#{currentCompanyUser.passwordComparison}">
<a4j:support event="onblur" reRender="login" bypassUpdates="true" />
<f:validateLength minimum="5" maximum="15" />
<t:validateEqual for="passw" summaryMessage='#{"messages.text35"}'
detailMessage='#{"messages.text34"}' />
</t:inputSecret>
</s:decorate>
<s:decorate id="name" template="/layout/edit.xhtml">
<ui:define name="label">#{messages.name}</ui:define>
<h:inputText size="30" required="true"
value="#{currentCompanyUser.name}">
<a4j:support event="onblur" reRender="name" bypassUpdates="true" />
</h:inputText>
</s:decorate>
<s:decorate id="desc" template="/layout/edit.xhtml">
<ui:define name="label">#{messages.newUserDescription}:</ui:define>
<t:inputTextarea id="description"
value="#{currentCompanyUser.description}">
</t:inputTextarea>
</s:decorate>
<s:decorate id="phone" template="/layout/edit.xhtml">
<ui:define name="label">#{messages.newUserPhone}</ui:define>
<h:inputText size="30" value="#{currentCompanyUser.phone}">
<a4j:support event="onblur" reRender="phone" bypassUpdates="true" />
</h:inputText>
</s:decorate>
<s:decorate id="email" template="/layout/edit.xhtml">
<ui:define name="label">#{messages.newUserEmail1}</ui:define>
<h:inputText size="30" required="true"
value="#{currentCompanyUser.email}">
<a4j:support event="onblur" reRender="email" bypassUpdates="true" />
<t:validateEmail></t:validateEmail>
</h:inputText>
</s:decorate>
<s:decorate id="email2" template="/layout/edit.xhtml">
<ui:define name="label">#{messages.newUserEmail2}</ui:define>
<h:inputText size="30" value="#{currentCompanyUser.reminderemail}">
<a4j:support event="onblur" reRender="email2" bypassUpdates="true" />
<t:validateEmail></t:validateEmail>
</h:inputText>
</s:decorate>
</ss:fieldset>
<ss:fieldset>
<rich:panel style="inpanelBody2"
headerClass="standardRich_SortHeader">
<f:facet name="header">
<t:panelGroup>
<a4j:commandButton action="#{companyHandler.saveUser}"
value="#{messages.save}"
oncomplete="Richfaces.hideModalPanel('mp_new')"
reRender="addresspanel,companyUsersTable,link,panel">
</a4j:commandButton>
<a4j:commandButton action="#{companyHandler.closeUser}"
value="#{messages.close}"
oncomplete="Richfaces.hideModalPanel('mp_new')" reRender="mp_new"
immediate="true">
</a4j:commandButton>
</t:panelGroup>
</f:facet>
</rich:panel>
</ss:fieldset>
</rich:panel>
</a4j:form>
I want: if I not entered value name, page will shown required field and will stay in mp. -
3. Re: how to stop modal panel on required fields
ilya_shaikovsky Jun 25, 2007 9:26 AM (in response to ivan.tufegdzic)Is this that you need to achieve?
http://labs.jboss.com/wiki/ModalPanelValidation -
4. Re: how to stop modal panel on required fields
ivan.tufegdzic Jun 25, 2007 10:08 AM (in response to ivan.tufegdzic)Yes. That is that. But I have problem with syntax in that script.
I wrote:
function windowclose {
if (document.getElementById('mp_form.error')!=null)Richfaces.hideModalPanel_panel}}>
but this is not ok -
5. Re: how to stop modal panel on required fields
ivan.tufegdzic Jun 25, 2007 10:08 AM (in response to ivan.tufegdzic)
function windowclose {
if (document.getElementById('mp_form.error')!=null)Richfaces.hideModalPanel_panel}}> -
6. Re: how to stop modal panel on required fields
baz Jun 25, 2007 10:15 AM (in response to ivan.tufegdzic)Hello,
@ilya_shaikovsky
The CDATA section on the wiki is broken and unreadable.
Are you able to fix it? Thanks in advance -
7. Re: how to stop modal panel on required fields
ilya_shaikovsky Jun 26, 2007 7:01 AM (in response to ivan.tufegdzic)Sorry. Fixed