You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Fadil <fa...@gmail.com> on 2005/03/04 19:43:56 UTC

MyFaces / Tiles / Sitemesh

Hi all,

   Is it simple to integrate tiles with myfaces ?  
Works MyFaces bester with Sitemesh ?


Toughts ?



On Fri, 04 Mar 2005 18:32:13 +0000, gvanmatre@comcast.net
<gv...@comcast.net> wrote:
> > We're not actually using the MyFaces configurator to read the elements
> > from the file.  I don't think the MyFaces configurator even reads
> > them.  I wrote my own digester to parse just those files.  I'm just
> > using the existing elements so I dont' have to write my own DTD.
> >
> ..
> ..
> > > > That way, you can just write <h:panelGrid />, but the HtmlPanelGrid
> > > > that is returned has its columns attribute set to 1.  This way, you
> > > > don't explicitly have to define the columns attribute, and we quit
> > > > getting those warnings about it being undefined.
> > > >
> 
> This sounds like a similar solution proposed in Shale.
> 
> http://issues.apache.org/bugzilla/show_bug.cgi?id=33752
> 
> A single subview tag is used to add to the existing component tree.  The subview is defined in XML configuration files.  These files hold reusable compositions of view metadata used to construct the sub component tree.  The XML structure provides a way to define a complex component, say an address, and have the ability to extend and override or add additional components.
> 
> <sh:xsubview id="agentAddress" elementId="agentAddressForm" />
> 
> Another example is a data table that defines columns for first and last name.  This component definition is extended adding an ssn and a birthdate.
> 
> <displayElement elementId="personsTable" extends="dataTable">
>    <attributes>
>        <set name="value" useValueLateBinding="true" value="#{managed-bean-name.persons}"/>
>        <set name="var"   value="e"/>
>        <set name="rows"  value="5"/>
>        <set name="first"  value="1"/>
>     </attributes>
> 
>     <element renderId="1" elementId="firstNameColumn"/>
>     <element renderId="2" elementId="lastNameColumn"/>
> 
> </displayElement>
> 
> <displayElement elementId="personsTableEx" extends="personsTable">
>     <element renderId="0" elementId="ssnColumn"/>
>     <element renderId="0" elementId="birthDateColumn"/>
> </displayElement>
> 
> <sh:xsubview id="personsTableEx" elementId="personsTableEx" />
> 
> Another feature is that there is a substitution of the expression language when constructing the components.  This allows a view fragment to be bound to more than one logical managed bean.  For example, in the dataTable defined above, #{managed-bean-name.persons} might be substitued with #{personsTableEx.persons}.  The substitued name would be defined by the suviews id attribute.
> 
> Gary
> 
>

Re: MyFaces / Tiles / Sitemesh

Posted by David Geary <sa...@earthlink.net>.
Le Mar 4, 2005, à 11:43 AM, Fadil a écrit :

> Hi all,
>
>    Is it simple to integrate tiles with myfaces ?

Yes. In fact, it's already integrated. See the MyFaces website for more 
details.

> Works MyFaces bester with Sitemesh ?

I use both Tiles and SiteMesh with the JSF Reference Implementation and 
I've had no difficulties with either. I'm sure the same is true for 
MyFaces.


david
>
>
> Toughts ?
>
>
>
> On Fri, 04 Mar 2005 18:32:13 +0000, gvanmatre@comcast.net
> <gv...@comcast.net> wrote:
>>> We're not actually using the MyFaces configurator to read the 
>>> elements
>>> from the file.  I don't think the MyFaces configurator even reads
>>> them.  I wrote my own digester to parse just those files.  I'm just
>>> using the existing elements so I dont' have to write my own DTD.
>>>
>> ..
>> ..
>>>>> That way, you can just write <h:panelGrid />, but the HtmlPanelGrid
>>>>> that is returned has its columns attribute set to 1.  This way, you
>>>>> don't explicitly have to define the columns attribute, and we quit
>>>>> getting those warnings about it being undefined.
>>>>>
>>
>> This sounds like a similar solution proposed in Shale.
>>
>> http://issues.apache.org/bugzilla/show_bug.cgi?id=33752
>>
>> A single subview tag is used to add to the existing component tree.  
>> The subview is defined in XML configuration files.  These files hold 
>> reusable compositions of view metadata used to construct the sub 
>> component tree.  The XML structure provides a way to define a complex 
>> component, say an address, and have the ability to extend and 
>> override or add additional components.
>>
>> <sh:xsubview id="agentAddress" elementId="agentAddressForm" />
>>
>> Another example is a data table that defines columns for first and 
>> last name.  This component definition is extended adding an ssn and a 
>> birthdate.
>>
>> <displayElement elementId="personsTable" extends="dataTable">
>>    <attributes>
>>        <set name="value" useValueLateBinding="true" 
>> value="#{managed-bean-name.persons}"/>
>>        <set name="var"   value="e"/>
>>        <set name="rows"  value="5"/>
>>        <set name="first"  value="1"/>
>>     </attributes>
>>
>>     <element renderId="1" elementId="firstNameColumn"/>
>>     <element renderId="2" elementId="lastNameColumn"/>
>>
>> </displayElement>
>>
>> <displayElement elementId="personsTableEx" extends="personsTable">
>>     <element renderId="0" elementId="ssnColumn"/>
>>     <element renderId="0" elementId="birthDateColumn"/>
>> </displayElement>
>>
>> <sh:xsubview id="personsTableEx" elementId="personsTableEx" />
>>
>> Another feature is that there is a substitution of the expression 
>> language when constructing the components.  This allows a view 
>> fragment to be bound to more than one logical managed bean.  For 
>> example, in the dataTable defined above, #{managed-bean-name.persons} 
>> might be substitued with #{personsTableEx.persons}.  The substitued 
>> name would be defined by the suviews id attribute.
>>
>> Gary
>>
>>
>