On 2/17/07, Gary VanMatre <[EMAIL PROTECTED]> wrote:
>From: "Richard Eggert" <[EMAIL PROTECTED]>
>
> In an application I'm working on, I'm trying to implement a mechanism by which
> the exact HTML template file that is used for a given page is dependent upon a
> configurable (at a minimum, by the person deploying the application, but
> ideally, in the profile of each user) parameter such that although the actual
> information displayed by a given page remains the same, the layout and
> formatting of the page may vary according to the site "theme" selected by the
> site owner and/or user preferences. After doing some experimenting, I
> discovered that expressions are not allowed in the jsfid attribute of the 
"clay"
> JSP tag. Is there some other way of implementing this? Is what I'm trying to
> do even feasible with Clay?
>


You should be able to do this kind of thing using Clay. The key is to use 
"action" outcome with navigation rules if you are posting back to the same 
page.  Action listeners will not cause the page to be rebuilt from the view root down.

If you are dynamically change the content using symbols,  you need to rebuild 
the tree from the top down.  Otherwise, clay will just try to merge the new 
template with the old tree.


I think I saw a problem (maybe mine) related to this.  I was using 2
clay components nested within the tomahawk dataList component.  It was
to create the illusion of tabs.  1 of the clay components clayJsfid
was bound to the html template that shows a "selected" tab.  The other
was bound to a clay component that shows an unselected tab (which
contained commandLinks which when clicked would update the tab status
to selected and also the status of the currently selected to
unselected.  For each iteration of the dataList only 1 of the 2 clay
components would be rendered.  This worked fine for the first render,
but subsequent postbacks from the commandLinks where confusing clay.
The render after the postback clay doubled the amount of tabs.  It
seems like it was merging templates with the tree instead of using the
existing ones.

I was returning null from the commandLink action handler.  Is there a
difference between returing null from the action handler and returning
an action string mapped to the same view id in faces-config.xml?  In
mean in relation to whether or not the tree is rebuilt from scratch.





Another limitation is that from a JSP, you can not include other JSP fragments 
using clay like you would tiles.  Clay needs to control the subtree built under 
it.  There is just not a good way to make Clay include a JSP fragment but a JSP 
can include a clay subtree.


>
> Rich Eggert
> Member of Technical Staff
> Proteus Technologies, LLC
> http://www.proteus-technologies.com
>

Gary

>

Reply via email to