[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-432) Support @IfInvalid functionality without @IfInvalid

Christian Bauer (JIRA) jira-events at jboss.com
Sun Dec 17 13:16:38 EST 2006


    [ 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">&#160;</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

        



More information about the seam-issues mailing list