On 5/6/05, Sylvain Vieujot <[EMAIL PROTECTED]> wrote:
>  I don't know if this really helps in your case, but have a look at the
> x:aliasBean tag.
>  I use it to have generic subforms, and it works pretty well.

Thanks.   I'll look for an example on Monday.



On 5/6/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> You might check out the Clay component under Struts Shale:
> http://cvs.apache.org/builds/struts/nightly/struts-shale/clay-plugin
>
> This component will allow you to define a sub-tree within a jsp page where 
> the component metadata is defined in an XML config file.  The metadata is 
> very tiles like in that it allows inheritances.

Thanks.   You probably noticed me updating the BuildingShale wiki page
earlier this week. :)

I've been following your work (and the Shale project in general) with
interest, particularly the tie-ins with Velocity to support a non-JSP
presentation tier.  I took a month out to work on XForms stuff, so I'm
a little out of date with Shale, and am just now starting to get
caught up again.

I've still got your March 12th "[Shale] subview component XML
composition extension" message sitting in my action mailbox :) and a
bunch more stuff in my gmail account.

I'm planning to take a more in-depth look later.   

> A subtree is added to an existing component tree using a JSP tag.
> 
> &lt;sh:clay id="subview" jsfid="template.html" managedBeanName="mybean"/&gt;
> 
> The subtree can be formed using three methods:
> 1)      Tapestry like html templates where a "jsfid" attribute in the html 
> binds it to a JSF component.
> 2)      The composition can be formed using an xml definition.  This option 
> gives the most in terms of inheritances and resues.
> 3)      The subtree can be defined at runtime by a property event of the 
> component, shapeValidator="#{fullAddress.createSubtree}.
> 
> The attribute "jsfid" is a mnemonic that represents a meta-component 
> definition in the XML configuration file or an html fragment.
> 
> The "managedBeanName" attribute is the name of the registered bean in the 
> faces config.   The value of this attribute is substituted in place of a 
> literal, "managed-bean-name" in the clay config.  This allows you to create 
> reusable view fragments that are not bound to a single logical bean name.
> 
> Consider the following simple example of an html fragment that is added to 
> the jsf component tree.
> 
> JSP:
> &lt;sh:clay id="subview" jsfid="Template.html" managedBeanName="mybean"/&gt;
> 
> Template.html:
>   &lt;input jsfid="username" type="text"&gt;
> 
> clay-config.xml
>    &lt;!-- username input widget --&gt;
>    &lt;component jsfid="username" extends="inputText" id="username"&gt;
>       &lt;attributes&gt;
>          &lt;set name="required" value="true"/&gt;
>          &lt;set name="value" useValueLateBinding="true" 
> value="#{managed-bean-name.username}"/&gt;
>          &lt;set name="size"  value="20"/&gt;
>          &lt;set name="validator" 
> value="#{managed-bean-name.validateUser}"/&gt;
>       &lt;/attributes&gt;
>    &lt;/component&gt;
> 
> You might find the dialog features in the logon use cases interesting too.  
> It allows you to reuse a jsp page within many page flows where you can insert 
> action logic between the transitions of pages to do additional processing 
> specific to the flow.
> 
> Gary
> 
> >
> > What would have been a five-minute task under WebObjects, and maybe a
> > five-hour task with Struts/Velocity became a 30-hour ordeal of
> > creating a custom composite component
> > (HtmlDataTable/UIColumn/UIColumns/UICommand) in JSF, and all of the
> > horrors of serialization/saveState/restoreState that it entailed.
> 
> You might find the Clay html JSF binding an interesting option.  The runtime 
> composition option might solve this problem.

Sounds good.   The examples are sure to help!  :)

Reply via email to