This content has been marked as final.
Show 3 replies
-
1. Re: <s:decorate> - is id available within template?
tynor Jul 25, 2007 11:54 AM (in response to tynor)It may not be clear from my original text what i'm trying to do.
I have various form elements that use <s:decorate>:<s:decorate id="cityDecoration" template="/WEB-INF/facelets/templates/edit.xhtml"> <ui:define name="label">City</ui:define> <ui:param name="partialRequired" value="true" /> <h:inputText id="city" size="40" maxlength="50" value="#{clientHome.instance.city}"> <a:support event="onblur" reRender="cityDecorationINNER1,cityDecorationINNER2"/> </h:inputText> </s:decorate>
in my edit.xhtml, i'd like to use the id passed to s:decorate (cityDecoration) and use it to name two spans:<tr class="entry""> <th class="name"> <span id="#{id}INNER1"> <s:label styleClass="name #{invalid?'errors':''}"> <ui:insert name="label"/> <s:span styleClass="required" rendered="#{required}">*</s:span> </s:label> </span> </th> <td> <span id="#{id}INNER2"> <span class="value #{invalid?'errors':''}"> <s:validateAll> <ui:insert/> </s:validateAll> </span> <ui:insert name="description" /> <div><s:message styleClass="error errors"/></div> </span> </td> </tr>
I can't find a way to refer to the s:decorate's id to generate a derived name (#{id} as above doesn't work - it evaluates to an empty string). The only thing i can find that will work is to set a <ui:param> and use that instead of the s:decorate's id-- but that really clutters my form xhtml. -
2. Re: <s:decorate> - is id available within template?
christian.bauer Jul 25, 2007 12:11 PM (in response to tynor)
The only thing i can find that will work is to set a <ui:param> and use that instead of the s:decorate's id-- but that really clutters my form xhtml.
And that would be the only way how you can get a value into a scope that is resolvable via EL. The id just isn't available. -
3. Re: <s:decorate> - is id available within template?
tynor Jul 25, 2007 12:24 PM (in response to tynor)Thanks Christian,
Knowing that will save me some from wasting more time on fruitless searching. I'll reconcile myself to adding <ui:param>'s :)