8 Replies Latest reply on Jul 14, 2007 4:48 PM by tynor

    seam 1.2.1GA - belowField / description facet

    tynor

      I'm trying to add a belowField facet, but it is not being displayed on my form.

      Google shows that Seam 2.0 may have changed this to be called "description", but the 1.2.1 docs still document belowField. I've tried both -- neither displays on my form (and I see nothing in the generated HTML). Can anyone help me spot an error here?

      <s:decorate id="naicsCodeDecoration" template="/layout/edit.xhtml">
       <ui:define name="label">naicsCode</ui:define>
       <h:inputText id="naicsCode"
       size="50"
       maxlength="50"
       value="#{clientHome.instance.naicsCode}">
       <a:support event="onblur" reRender="naicsCodeDecoration"/>
       </h:inputText>
       <f:facet name="belowField">Does belowField Display?</f:facet>
       <f:facet name="description">Does description Display?</f:facet>
      </s:decorate>
      


        • 1. Re: seam 1.2.1GA - belowField / description facet
          pmuir

          Thats a bug in the docs. Please follow what this http://docs.jboss.com/seam/1.2.1.GA/reference/en/html/validation.html says and ignore the JSF Controls chapter for that control.

          • 2. Re: seam 1.2.1GA - belowField / description facet
            tynor

            Thanks Pete. However the doc you point to does not talk about any sort of annotation that would seem to correspond to the apparently unusable "belowField" or "description" facets. I see only <ui:define name="label">. Perhaps you are implying that we should use something like <ui:define name="belowField"> ?

            Can you post an example of the recommended way to do a belowField or description annotation?

            Thanks!

            • 3. Re: seam 1.2.1GA - belowField / description facet
              tynor

              Following up to my only question, I think Pete was trying to tell us that belowField and description facets simply don't work any more. I see they are used in the ui example (via <ui:define name="description"), but when I deploy that example, those extra annotations ("Enter your name as it appears on your passport") are not displayed when I deploy via Seam 1.2.1-GA and JBoss 4.0.5.



              • 4. Re: seam 1.2.1GA - belowField / description facet
                pmuir

                Sorry, I lost the net yesterday. We had those facets in CVS, but removed in favour of the enhanced s:decorate and forgot to update the docs. If there was a bug in ui example - sorry :( Anyway, the booking example has it correct.

                • 5. Re: seam 1.2.1GA - belowField / description facet
                  tynor

                  OK. I hate to be a pest, but I've looked through all uses of s:decorate in the 1.2.1-GA booking demo, and don't see any that set anything other than <ui:define name="label"> and input widgets. Nothing that looks analogous to a belowField comment. Can you be more specific?

                  Thanks!

                  • 6. Re: seam 1.2.1GA - belowField / description facet
                    pmuir

                    The ui example in Seam2 does this with divs and css. Basically, the idea of s:decorate is to allow you to design your own template for this

                    <s:decorate template="decorateField.xhtml">
                     <ui:define name="label">Age</ui:define>
                     <ui:define name="description">The age list is an array of primitives</ui:define>
                     <h:selectOneMenu value="#{person.age}">
                     <s:selectItems value="#{ages}" var="age" label="#{age}" />
                     <f:converter converterId="ageConverter" />
                     </h:selectOneMenu>
                    </s:decorate>


                    <div class="entry">
                     <s:label styleClass="label #{invalid?'errors':''}">
                     <ui:insert name="label"/>
                     <s:span styleClass="required" rendered="#{required}">*</s:span>
                     </s:label>
                     <span class="input #{invalid?'errors':''}">
                     <s:validateAll>
                     <ui:insert/>
                     </s:validateAll>
                     </span>
                     <div>
                     <s:message styleClass="error errors"/>
                     </div>
                     <div class="description"><ui:insert name="description" /></div>
                    </div>


                    • 7. Re: seam 1.2.1GA - belowField / description facet
                      pmuir

                      Btw, you are not being a pest at all, you are asking clear questions and providing the necessary information to allow people to ask answer your question in each post which is lovely :)

                      • 8. Re: seam 1.2.1GA - belowField / description facet
                        tynor

                        Thanks Pete. The underlying confusion (for me at least) is that the 1.2.1 seam-gen generated layout/edit.xhtml used by the forms it generated does not in fact have <ui:insert> for these belowField/definition annotations as in your example above. I'll add some and go on my merry way.

                        Cheers!