[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-432) Support @IfInvalid functionality without @IfInvalid
by Norman Richards (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-432?page=comments#action_12348908 ]
Norman Richards commented on JBSEAM-432:
----------------------------------------
I'm trying to understand the motivation, so let's look at the example here. The way I am interpreting this is that Christian wants to be able to go "back" without failing because a user entered a poorly formed email address or something. Since this are string values, we want the values to go straight into the model without model validation, but they still go through JSF validation, even if you don't configure any JSF constraints.
First, required="true" would cause this to not work. If you don't put require="true", then s:validateAll will to correctly validate missing fields later. You'll get an error when you try to commit the transaction, which I don't think is anything close to a desired behavior.
Second, what happens with a numeric field here? If you enter "random text" and then go to profile, you will fail at conversion and will not be able to go back. And, if you can always hit back successfully, what's the whole point? Let's suppose you could bypass this, where do you store the value? On the int field in the model? No - the only place I can see this data making sense is in the UI model.
In my mind, the JSF solution works well. immediate=true bypasses processing of the submitted data, leaving it on the UI model for future use.
I can't quite nail down a reasonable use case for deferred model validation, but I suppose I can imagine that one might exist. I just can't see it as being generally useful or interesting.
> Support @IfInvalid functionality without @IfInvalid
> ---------------------------------------------------
>
> Key: JBSEAM-432
> URL: http://jira.jboss.com/jira/browse/JBSEAM-432
> Project: JBoss Seam
> Issue Type: Feature Request
> Components: Core
> Affects Versions: 1.1.0.BETA1
> Reporter: Christian Bauer
> Assigned To: Norman Richards
> Fix For: 1.1.1.GA
>
>
> The "Previous Page" button has to Update Model Values, but not Process Validations:
> <h:form>
> <f:facet name="beforeInvalidField">
> <h:graphicImage value="/img/attention.gif"
> width="18" height="18"
> styleClass="attentionImage"/>
> </f:facet>
> <f:facet name="afterInvalidField">
> <s:message/>
> </f:facet>
> <f:facet name="aroundInvalidField">
> <s:span styleClass="errors"/>
> </f:facet>
> <div class="errors" align="center">
> <h:messages globalOnly="true"/>
> </div>
> <s:validateAll>
> <div class="entry">
> <div class="label">#{messages['Firstname']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.firstname}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label">#{messages['Lastname']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.lastname}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label">#{messages['Email']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.email}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label"> </div>
> <div class="input">
> <h:commandButton value="#{messages['PrevPage']}" styleClass="button"
> action="register"/>
> <h:commandButton value="#{messages['NextPage']}" styleClass="button"
> action="#{register.enterProfile}"/>
> </div>
> </div>
> </s:validateAll>
> </h:form>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years
[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-432) Support @IfInvalid functionality without @IfInvalid
by Gavin King (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-432?page=comments#action_12348907 ]
Gavin King commented on JBSEAM-432:
-----------------------------------
OK, I did some more research on the JSF RI source.
I think the correct way to handle this is to create an <s:inputText/> component (so only for textual input, but at least its OK for a start) by subclass in the JSF component and:
* adding an immediateApply="true|false" attribute
* overriding processDecodes to call updateModel() if immediateApply=true
This way values get applied to the model *before* in the apply request values phase, before validation runs, just like immediate=true causes validation to occur in apply request values.
> Support @IfInvalid functionality without @IfInvalid
> ---------------------------------------------------
>
> Key: JBSEAM-432
> URL: http://jira.jboss.com/jira/browse/JBSEAM-432
> Project: JBoss Seam
> Issue Type: Feature Request
> Components: Core
> Affects Versions: 1.1.0.BETA1
> Reporter: Christian Bauer
> Assigned To: Norman Richards
> Fix For: 1.1.1.GA
>
>
> The "Previous Page" button has to Update Model Values, but not Process Validations:
> <h:form>
> <f:facet name="beforeInvalidField">
> <h:graphicImage value="/img/attention.gif"
> width="18" height="18"
> styleClass="attentionImage"/>
> </f:facet>
> <f:facet name="afterInvalidField">
> <s:message/>
> </f:facet>
> <f:facet name="aroundInvalidField">
> <s:span styleClass="errors"/>
> </f:facet>
> <div class="errors" align="center">
> <h:messages globalOnly="true"/>
> </div>
> <s:validateAll>
> <div class="entry">
> <div class="label">#{messages['Firstname']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.firstname}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label">#{messages['Lastname']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.lastname}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label">#{messages['Email']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.email}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label"> </div>
> <div class="input">
> <h:commandButton value="#{messages['PrevPage']}" styleClass="button"
> action="register"/>
> <h:commandButton value="#{messages['NextPage']}" styleClass="button"
> action="#{register.enterProfile}"/>
> </div>
> </div>
> </s:validateAll>
> </h:form>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years
[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-432) Support @IfInvalid functionality without @IfInvalid
by Gavin King (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-432?page=comments#action_12348906 ]
Gavin King commented on JBSEAM-432:
-----------------------------------
(1) I don't think this is anywhere near as important as christian thinks it is - nevertheless it is useful, and something that users have requested
(2) Norman, that's not quite right - JSF decouples type conversion from value validation, and they happen in different phases - there is no problem with applying converters, but then skipping the validators
(3) The implementation I suggested above, was to hack into queueEvent method on UICommand, and skip the PROCESS_VALIDATIONS phase but now I'm not so sure that this works - anyway, its worth further investigation
> Support @IfInvalid functionality without @IfInvalid
> ---------------------------------------------------
>
> Key: JBSEAM-432
> URL: http://jira.jboss.com/jira/browse/JBSEAM-432
> Project: JBoss Seam
> Issue Type: Feature Request
> Components: Core
> Affects Versions: 1.1.0.BETA1
> Reporter: Christian Bauer
> Assigned To: Norman Richards
> Fix For: 1.1.1.GA
>
>
> The "Previous Page" button has to Update Model Values, but not Process Validations:
> <h:form>
> <f:facet name="beforeInvalidField">
> <h:graphicImage value="/img/attention.gif"
> width="18" height="18"
> styleClass="attentionImage"/>
> </f:facet>
> <f:facet name="afterInvalidField">
> <s:message/>
> </f:facet>
> <f:facet name="aroundInvalidField">
> <s:span styleClass="errors"/>
> </f:facet>
> <div class="errors" align="center">
> <h:messages globalOnly="true"/>
> </div>
> <s:validateAll>
> <div class="entry">
> <div class="label">#{messages['Firstname']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.firstname}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label">#{messages['Lastname']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.lastname}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label">#{messages['Email']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.email}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label"> </div>
> <div class="input">
> <h:commandButton value="#{messages['PrevPage']}" styleClass="button"
> action="register"/>
> <h:commandButton value="#{messages['NextPage']}" styleClass="button"
> action="#{register.enterProfile}"/>
> </div>
> </div>
> </s:validateAll>
> </h:form>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years
[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-432) Support @IfInvalid functionality without @IfInvalid
by Christian Bauer (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-432?page=comments#action_12348904 ]
Christian Bauer commented on JBSEAM-432:
----------------------------------------
My suggestion is that you guys try to write the #1 thing we promise with our conversation stuff: a wizard for data entry. The problems you will find then need solutions, this is not academic at all.
> Support @IfInvalid functionality without @IfInvalid
> ---------------------------------------------------
>
> Key: JBSEAM-432
> URL: http://jira.jboss.com/jira/browse/JBSEAM-432
> Project: JBoss Seam
> Issue Type: Feature Request
> Components: Core
> Affects Versions: 1.1.0.BETA1
> Reporter: Christian Bauer
> Assigned To: Norman Richards
> Fix For: 1.1.1.GA
>
>
> The "Previous Page" button has to Update Model Values, but not Process Validations:
> <h:form>
> <f:facet name="beforeInvalidField">
> <h:graphicImage value="/img/attention.gif"
> width="18" height="18"
> styleClass="attentionImage"/>
> </f:facet>
> <f:facet name="afterInvalidField">
> <s:message/>
> </f:facet>
> <f:facet name="aroundInvalidField">
> <s:span styleClass="errors"/>
> </f:facet>
> <div class="errors" align="center">
> <h:messages globalOnly="true"/>
> </div>
> <s:validateAll>
> <div class="entry">
> <div class="label">#{messages['Firstname']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.firstname}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label">#{messages['Lastname']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.lastname}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label">#{messages['Email']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.email}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label"> </div>
> <div class="input">
> <h:commandButton value="#{messages['PrevPage']}" styleClass="button"
> action="register"/>
> <h:commandButton value="#{messages['NextPage']}" styleClass="button"
> action="#{register.enterProfile}"/>
> </div>
> </div>
> </s:validateAll>
> </h:form>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years
[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-432) Support @IfInvalid functionality without @IfInvalid
by Christian Bauer (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-432?page=comments#action_12348903 ]
Christian Bauer commented on JBSEAM-432:
----------------------------------------
I'm not using JSF validation, integrity constraints belong declaratively on the model, not in the UI. I don't understand your comments about "only works for strings". But yes, I basically want to turn off <s:validateAll> sometimes and have a halfway correct model.
> Support @IfInvalid functionality without @IfInvalid
> ---------------------------------------------------
>
> Key: JBSEAM-432
> URL: http://jira.jboss.com/jira/browse/JBSEAM-432
> Project: JBoss Seam
> Issue Type: Feature Request
> Components: Core
> Affects Versions: 1.1.0.BETA1
> Reporter: Christian Bauer
> Assigned To: Norman Richards
> Fix For: 1.1.1.GA
>
>
> The "Previous Page" button has to Update Model Values, but not Process Validations:
> <h:form>
> <f:facet name="beforeInvalidField">
> <h:graphicImage value="/img/attention.gif"
> width="18" height="18"
> styleClass="attentionImage"/>
> </f:facet>
> <f:facet name="afterInvalidField">
> <s:message/>
> </f:facet>
> <f:facet name="aroundInvalidField">
> <s:span styleClass="errors"/>
> </f:facet>
> <div class="errors" align="center">
> <h:messages globalOnly="true"/>
> </div>
> <s:validateAll>
> <div class="entry">
> <div class="label">#{messages['Firstname']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.firstname}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label">#{messages['Lastname']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.lastname}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label">#{messages['Email']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.email}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label"> </div>
> <div class="input">
> <h:commandButton value="#{messages['PrevPage']}" styleClass="button"
> action="register"/>
> <h:commandButton value="#{messages['NextPage']}" styleClass="button"
> action="#{register.enterProfile}"/>
> </div>
> </div>
> </s:validateAll>
> </h:form>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years
[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-432) Support @IfInvalid functionality without @IfInvalid
by Norman Richards (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-432?page=comments#action_12348902 ]
Norman Richards commented on JBSEAM-432:
----------------------------------------
So then I'd interpret the request as being "find a way to turn off s:validateAll" for some submissions?
I don't see how this is generally valuable. This only would be interesting for the small subset of models that consist of string values. Otherwise, you will still not be able to perform "back" navigation for invalid fields requiring conversion. (numbers, dates. etc...) Maybe that is acceptable? I guess that's what would have happened with @IfInvalid anyways. If you have data that fails JSF validation (everything but model validation) your back button wouldn't work then, right?
> Support @IfInvalid functionality without @IfInvalid
> ---------------------------------------------------
>
> Key: JBSEAM-432
> URL: http://jira.jboss.com/jira/browse/JBSEAM-432
> Project: JBoss Seam
> Issue Type: Feature Request
> Components: Core
> Affects Versions: 1.1.0.BETA1
> Reporter: Christian Bauer
> Assigned To: Norman Richards
> Fix For: 1.1.1.GA
>
>
> The "Previous Page" button has to Update Model Values, but not Process Validations:
> <h:form>
> <f:facet name="beforeInvalidField">
> <h:graphicImage value="/img/attention.gif"
> width="18" height="18"
> styleClass="attentionImage"/>
> </f:facet>
> <f:facet name="afterInvalidField">
> <s:message/>
> </f:facet>
> <f:facet name="aroundInvalidField">
> <s:span styleClass="errors"/>
> </f:facet>
> <div class="errors" align="center">
> <h:messages globalOnly="true"/>
> </div>
> <s:validateAll>
> <div class="entry">
> <div class="label">#{messages['Firstname']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.firstname}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label">#{messages['Lastname']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.lastname}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label">#{messages['Email']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.email}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label"> </div>
> <div class="input">
> <h:commandButton value="#{messages['PrevPage']}" styleClass="button"
> action="register"/>
> <h:commandButton value="#{messages['NextPage']}" styleClass="button"
> action="#{register.enterProfile}"/>
> </div>
> </div>
> </s:validateAll>
> </h:form>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years
[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-432) Support @IfInvalid functionality without @IfInvalid
by Christian Bauer (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-432?page=comments#action_12348900 ]
Christian Bauer commented on JBSEAM-432:
----------------------------------------
BTW, my first approach (which is in the new Hibernate book as well) was to defer model validation (not until flush/commit time, but until Next Page is clicked) with @IfInvalid and without <s:validateAll>.
> Support @IfInvalid functionality without @IfInvalid
> ---------------------------------------------------
>
> Key: JBSEAM-432
> URL: http://jira.jboss.com/jira/browse/JBSEAM-432
> Project: JBoss Seam
> Issue Type: Feature Request
> Components: Core
> Affects Versions: 1.1.0.BETA1
> Reporter: Christian Bauer
> Assigned To: Norman Richards
> Fix For: 1.1.1.GA
>
>
> The "Previous Page" button has to Update Model Values, but not Process Validations:
> <h:form>
> <f:facet name="beforeInvalidField">
> <h:graphicImage value="/img/attention.gif"
> width="18" height="18"
> styleClass="attentionImage"/>
> </f:facet>
> <f:facet name="afterInvalidField">
> <s:message/>
> </f:facet>
> <f:facet name="aroundInvalidField">
> <s:span styleClass="errors"/>
> </f:facet>
> <div class="errors" align="center">
> <h:messages globalOnly="true"/>
> </div>
> <s:validateAll>
> <div class="entry">
> <div class="label">#{messages['Firstname']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.firstname}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label">#{messages['Lastname']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.lastname}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label">#{messages['Email']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.email}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label"> </div>
> <div class="input">
> <h:commandButton value="#{messages['PrevPage']}" styleClass="button"
> action="register"/>
> <h:commandButton value="#{messages['NextPage']}" styleClass="button"
> action="#{register.enterProfile}"/>
> </div>
> </div>
> </s:validateAll>
> </h:form>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years
[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-432) Support @IfInvalid functionality without @IfInvalid
by Christian Bauer (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-432?page=comments#action_12348899 ]
Christian Bauer commented on JBSEAM-432:
----------------------------------------
It's my model, I can apply whatever values ("valid" or not) to it I like. The DBMS is the authority on consistency, here I want to handle correctness of data.
This is just a JSF limitation. I think it would be easier and more valuable to open up control of the JSF processing phases (not only an "immediate" switch) instead of messing around with view hacks. In fact, there are certainly some wizards that require a partially correct model. That's why you use the wizard approach, so that the user can, with think-time, supply the correct values for the model. You don't flush and commit that model until the wizard completes, is all.
The only advantage I can see from an approach that would hold these values in the view (this is a "buffered presentation model" in Swing btw) is that we could recreate an aborted wizard easier.
> Support @IfInvalid functionality without @IfInvalid
> ---------------------------------------------------
>
> Key: JBSEAM-432
> URL: http://jira.jboss.com/jira/browse/JBSEAM-432
> Project: JBoss Seam
> Issue Type: Feature Request
> Components: Core
> Affects Versions: 1.1.0.BETA1
> Reporter: Christian Bauer
> Assigned To: Norman Richards
> Fix For: 1.1.1.GA
>
>
> The "Previous Page" button has to Update Model Values, but not Process Validations:
> <h:form>
> <f:facet name="beforeInvalidField">
> <h:graphicImage value="/img/attention.gif"
> width="18" height="18"
> styleClass="attentionImage"/>
> </f:facet>
> <f:facet name="afterInvalidField">
> <s:message/>
> </f:facet>
> <f:facet name="aroundInvalidField">
> <s:span styleClass="errors"/>
> </f:facet>
> <div class="errors" align="center">
> <h:messages globalOnly="true"/>
> </div>
> <s:validateAll>
> <div class="entry">
> <div class="label">#{messages['Firstname']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.firstname}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label">#{messages['Lastname']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.lastname}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label">#{messages['Email']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.email}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label"> </div>
> <div class="input">
> <h:commandButton value="#{messages['PrevPage']}" styleClass="button"
> action="register"/>
> <h:commandButton value="#{messages['NextPage']}" styleClass="button"
> action="#{register.enterProfile}"/>
> </div>
> </div>
> </s:validateAll>
> </h:form>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years
[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-432) Support @IfInvalid functionality without @IfInvalid
by Norman Richards (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-432?page=comments#action_12348898 ]
Norman Richards commented on JBSEAM-432:
----------------------------------------
I think this is an invalid request. The only logical place to store unvalidated, uncoverted state is in the view, not the model. You cannot update the model from a non-validated value. The UIInput doesn't allow that. Without completely and fundamentally changing the way input works in JSF, the best we could do would be to somehow turn off the contribution s:validateAll makes, but you would still be left with any other validation (string conversion, required, etc...) and if any of those fail you would not be able to move back to the previous screen.
Is there perhaps some way to keep the UIViewRoots alive in a pageflow so that the submitted values don't disappear?
> Support @IfInvalid functionality without @IfInvalid
> ---------------------------------------------------
>
> Key: JBSEAM-432
> URL: http://jira.jboss.com/jira/browse/JBSEAM-432
> Project: JBoss Seam
> Issue Type: Feature Request
> Components: Core
> Affects Versions: 1.1.0.BETA1
> Reporter: Christian Bauer
> Assigned To: Norman Richards
> Fix For: 1.1.1.GA
>
>
> The "Previous Page" button has to Update Model Values, but not Process Validations:
> <h:form>
> <f:facet name="beforeInvalidField">
> <h:graphicImage value="/img/attention.gif"
> width="18" height="18"
> styleClass="attentionImage"/>
> </f:facet>
> <f:facet name="afterInvalidField">
> <s:message/>
> </f:facet>
> <f:facet name="aroundInvalidField">
> <s:span styleClass="errors"/>
> </f:facet>
> <div class="errors" align="center">
> <h:messages globalOnly="true"/>
> </div>
> <s:validateAll>
> <div class="entry">
> <div class="label">#{messages['Firstname']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.firstname}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label">#{messages['Lastname']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.lastname}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label">#{messages['Email']}:</div>
> <div class="input">
> <s:decorate>
> <h:inputText size="32" required="true"
> value="#{register.user.email}"/>
> </s:decorate>
> </div>
> </div>
> <div class="entry">
> <div class="label"> </div>
> <div class="input">
> <h:commandButton value="#{messages['PrevPage']}" styleClass="button"
> action="register"/>
> <h:commandButton value="#{messages['NextPage']}" styleClass="button"
> action="#{register.enterProfile}"/>
> </div>
> </div>
> </s:validateAll>
> </h:form>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years