[jboss-cvs] jboss-seam/examples/wiki/view/includes ...

Christian Bauer christian at hibernate.org
Mon May 7 07:42:31 EDT 2007


  User: cbauer  
  Date: 07/05/07 07:42:31

  Modified:    examples/wiki/view/includes    preferencesEditor.xhtml
                        commentForm.xhtml
  Added:       examples/wiki/view/includes    formFieldDecorate.xhtml
  Log:
  Switched to tabbed ajax forms
  
  Revision  Changes    Path
  1.3       +18 -6     jboss-seam/examples/wiki/view/includes/preferencesEditor.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: preferencesEditor.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/includes/preferencesEditor.xhtml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- preferencesEditor.xhtml	26 Apr 2007 15:11:52 -0000	1.2
  +++ preferencesEditor.xhtml	7 May 2007 11:42:31 -0000	1.3
  @@ -6,14 +6,9 @@
           xmlns:a="https://ajax4jsf.dev.java.net/ajax"
           xmlns:s="http://jboss.com/products/seam/taglib">
   
  -    <s:div id="preferenceValidationErrors">
  -        <div align="center">
  -            <h:message for="preferenceValidationErrors" styleClass="attentionMessage"/>
  -        </div>
  -    </s:div>
  -
       <h:panelGrid columns="2" columnClasses="formListGridColumn">
   
  +        <a:region>
           <h:dataTable id="preferenceComponentList" var="prefComp"
                        value="#{preferenceComponents}"
                        styleClass="formListTable"
  @@ -29,9 +24,11 @@
               </h:column>
   
           </h:dataTable>
  +        </a:region>
   
           <s:div id="propertyPanel">
   
  +            <a:region>
               <h:dataTable id="propertyTable" var="v"
                            rendered="#{not empty preferenceEditor.preferenceComponent}"
                            value="#{preferenceEditor.preferenceValues}"
  @@ -88,9 +85,24 @@
   
                   </h:column>
               </h:dataTable>
  +            </a:region>
   
           </s:div>
   
  +        <s:div id="preferenceValidationErrors">
  +            <s:span rendered="#{!preferenceEditor.valid}">
  +                <span id="preferenceValidationErrorMessage" style="display:none"><h:message for="preferenceValidationErrors"/></span>
  +                <script type="text/javascript">jQuery(function() {
  +                    formTabRaiseError("#{tabId}", "prefEditor", "Preferences, " + jQuery("#preferenceValidationErrorMessage").html())
  +                });</script>
  +            </s:span>
  +            <s:span rendered="#{preferenceEditor.valid}">
  +                <script type="text/javascript">jQuery(function() {
  +                    formTabClearError("#{tabId}", "prefEditor");
  +                });</script>
  +            </s:span>
  +        </s:div>
  +
       </h:panelGrid>
   
   </s:div>
  \ No newline at end of file
  
  
  
  1.5       +53 -79    jboss-seam/examples/wiki/view/includes/commentForm.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: commentForm.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/includes/commentForm.xhtml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- commentForm.xhtml	21 Apr 2007 08:16:39 -0000	1.4
  +++ commentForm.xhtml	7 May 2007 11:42:31 -0000	1.5
  @@ -12,58 +12,38 @@
   
               <div class="formFields formBorder wideLabels">
   
  -                <s:validateAll>
  -
  -                    <s:decorate id="userNameDecorate">
  -                        <div class="entry">
  -                            <div class="label">Name:</div>
  -                            <div class="input">
  +                <s:decorate id="userNameDecorate" template="formFieldDecorate.xhtml">
  +                    <ui:define name="label">Name</ui:define>
                                   <h:inputText tabindex="102" size="40" maxlength="100" required="true"
                                                id="userName" value="#{commentHome.comment.fromUserName}">
                                       <a:support event="onblur" reRender="userNameDecorate"/>
                                   </h:inputText>
  -                            </div>
  -                        </div>
                       </s:decorate>
   
  -                    <s:decorate id="userEmailDecorate">
  -                        <div class="entry">
  -                            <div class="label">E-mail address (optional):</div>
  -                            <div class="input">
  +                <s:decorate id="userEmailDecorate" template="formFieldDecorate.xhtml">
  +                    <ui:define name="label">E-mail address (optional)</ui:define>
                                   <h:inputText tabindex="102" size="40" maxlength="255" required="false"
                                                id="userEmail" value="#{commentHome.comment.fromUserEmail}">
                                   </h:inputText>
  -                            </div>
  -                        </div>
                       </s:decorate>
   
  -                    <s:decorate id="userHomepageDecorate">
  -                        <div class="entry">
  -                            <div class="label">Homepage URL (optional):</div>
  -                            <div class="input">
  +                <s:decorate id="userHomepageDecorate" template="formFieldDecorate.xhtml">
  +                    <ui:define name="label">Homepage URL (optional)</ui:define>
                                   <h:inputText tabindex="102" size="40" maxlength="1000" required="false"
                                                id="userHomepage" value="#{commentHome.comment.fromUserHomepage}">
                                   </h:inputText>
  -                            </div>
  -                        </div>
                       </s:decorate>
   
  -                    <s:decorate id="subjectDecorate">
  -                        <div class="entry">
  -                            <div class="label">Subject:</div>
  -                            <div class="input">
  +                <s:decorate id="subjectDecorate" template="formFieldDecorate.xhtml">
  +                    <ui:define name="label">Subject</ui:define>
                                   <h:inputText tabindex="102" size="40" maxlength="255" required="true"
                                                id="subject" value="#{commentHome.comment.subject}">
                                       <a:support event="onblur" reRender="subjectDecorate"/>
                                   </h:inputText>
  -                            </div>
  -                        </div>
                       </s:decorate>
   
  -                    <s:decorate id="commentDecorate">
  -                        <div class="entry">
  -                            <div class="label">Comment:</div>
  -                            <s:div styleClass="input" id="commentText">
  +                <s:decorate id="commentDecorate" template="formFieldDecorate.xhtml">
  +                    <ui:define name="label">Comment</ui:define>
                                   <h:inputTextarea tabindex="102" required="true"
                                                    cols="40"
                                                    rows="10"
  @@ -71,8 +51,6 @@
                                                    value="#{commentHome.comment.text}">
                                       <a:support event="onblur" reRender="commentDecorate"/>
                                   </h:inputTextarea>
  -                            </s:div>
  -                        </div>
                       </s:decorate>
   
                       <s:div rendered="#{!identity.loggedIn}">
  @@ -83,18 +61,14 @@
                               </div>
                           </s:div>
   
  -                        <s:decorate>
  -                            <s:div styleClass="entry">
  -                                <div class="label">Enter response:</div>
  -                                <div class="input">
  -                                    <h:inputText tabindex="102" size="15" id="verifyCaptcha" value="#{captcha.response}" required="true"/>
  -                                </div>
  -                            </s:div>
  +                    <s:decorate id="verifyCaptchaDecorate" template="formFieldDecorate.xhtml">
  +                        <ui:define name="label">Enter repsonse</ui:define>
  +                        <h:inputSecret tabindex="102" size="5" maxlength="5" required="true"
  +                                       redisplay="true" id="verifyCaptcha" value="#{captcha.response}">
  +                        </h:inputSecret>
                           </s:decorate>
                       </s:div>
   
  -                </s:validateAll>
  -
               </div>
   
               <div class="formControls wideLabels">
  
  
  
  1.1      date: 2007/05/07 11:42:31;  author: cbauer;  state: Exp;jboss-seam/examples/wiki/view/includes/formFieldDecorate.xhtml
  
  Index: formFieldDecorate.xhtml
  ===================================================================
  <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                  xmlns:ui="http://java.sun.com/jsf/facelets"
                  xmlns:h="http://java.sun.com/jsf/html"
                  xmlns:f="http://java.sun.com/jsf/core"
                  xmlns:s="http://jboss.com/products/seam/taglib">
  
      <div class="entry #{invalid?'errorDiv':''}">
  
          <s:div rendered="#{not empty tabId}">
              <s:span rendered="#{invalid}">
                  <script type="text/javascript">jQuery(function() {
                      formTabRaiseError("#{tabId}", "#{fieldId}", '<s:message/>');
                  });</script>
              </s:span>
              <s:span rendered="#{!invalid}">
                  <script type="text/javascript">jQuery(function() {
                      formTabClearError("#{tabId}", "#{fieldId}");
                  });</script>
              </s:span>
          </s:div>
  
          <h:panelGroup rendered="#{invalid}">
              <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/attention.gif"
                              width="18" height="18"
                              styleClass="attentionImage"/>
              <s:span styleClass="attentionMessage">&#160;<s:message/></s:span>
          </h:panelGroup>
          <div class="label"><ui:insert name="label"/>:</div>
          <div class="input">
              <s:validateAll>
                  <ui:insert/>
              </s:validateAll>
          </div>
      </div>
  
  </ui:composition>
  
  



More information about the jboss-cvs-commits mailing list