>> Besides defining these in XML, you can do this sort of thing mixing in HTML templating. >> >> Common XML Config: >> >> <component jsfid="widgetsLabel" extends="baseLabel"> >> <attributes> >> <set name="value" value="@label" /> >> <set name="for" value="@property" /> >> </attributes> >> </component> >> <component jsfid="widgetsText" extends="inputText" id="@property"> >> <attributes> >> <set name="value" value="[EMAIL PROTECTED]@property}"/> >> <set name="size" value="@size" /> >> <set name="maxlength" value="@maxlength" /> >> <set name="required" value="@required" /> >> <set name="immediate" value="@immediate"/> >> </attributes> >> </component> >> <component jsfid="widgetsMessage" extends="baseMessage" > >> <attributes> >> <set name="for" value="@property" /> >> </attributes> >> </component> >> >> HTML template "/widgets.html": >> <tr> >> <td><label jsfid="widgetsLabel">Mock Label:</label></td> >> <td><input jsfid="widgetsText" type="text"/></td> >> <td><span jsfid="widgetsMessage">Mock Message</span><td> >> </tr> >> >> Outer HTML template include: >> <table> >> <tr> >> <td colspan="3"> >> <p>This example show how a pattern of components, label, input >> text and message can be abstracted into a common template. </p> >> </td> >> </tr> >> <tr jsfid="clay" clayJsfid="/widgets.html" label="First Name:" >> property="firstName" size="20" maxlength="30" >> required="true" immediate="false"/> >> <tr jsfid="clay" clayJsfid="/widgets.html" label="Middle Name:" >> property="middleName" size="20" maxlength="30" >> required="false" immediate="false"/> >> <tr jsfid="clay" clayJsfid="/widgets.html" label="Last Name:" >> property="lastName" size="30" maxlength="40" >> required="true" immediate="false"/> >> <tr jsfid="clay" clayJsfid="/widgets.html" label="Business Name:" >> property="lastName" size="40" maxlength="50" >> required="true" immediate="false"/> >> >> </table> >> > >That's really cool, Gary. How would I package widgets.html in a jar >so that it can be referenced in the application like you did in your >example? > Untill we resolve the bug ticket you posted, the html templates can only be loaded from the context root.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38168 We should be able to use the same syntax with html resources. <span jsfid="clay" clayJsfid="classpath*:org/acme/html/widgets.html"/> I'm going to make the syntax more simple for including html templates within html templates. <span jsfid="classpath*:org/acme/html/widgets.html"/> I'll try to take a look this weekend but the Broncos are playing and it's ski season here :-) Gary