Shale Clay allows you to resolve a backing bean dynamically thru what we call symbols.  The symbols represent simple string substitution and are resolved before the value or method binding expressions are created. 
 
For example:
 <component jsfid="firstName" extends="inputText" id="firstName">
     <attributes>
        <set name="value" value="[EMAIL PROTECTED]"/>  
     <set name="size" value="20" />
     <set name="maxlength" value="30" />
     <set name="required" value="true" />
     <set name="immediate" value="true"/>
     </attributes>
 </component>
 
In this example the symbol @managed-bean-name will be replaced with a backing bean name specific for the view.  So the same compositions can be reused on many pages. 
 
I think of the symbol replacement as horizontal inheritance verses the vertical you get using the extends attribute. 
 
You can also use symbols for generic layouts like you might see with tiles.
 
Generic Config:
 
    <component jsfid="basePage" extends="clay">
       <attributes>
           <set name="clayJsfid" value="/layout.html" />
       </attributes>
       <symbols>
           <set name="@leftContent" value="space"/>
           <set name="@headercontent" value="space"/>
           <set name="@bodycontent" value="space"/>
           <set name="@footercontent" value="space"/>  
       </symbols>
    </component>
Layout HTML:
<html>
   <head><title>@title</title></head>
   <body>
      <form>
          <table border="1">
             <tr>
                <td id="leftContent" rowspan="3"><span jsfid="clay" clayJsfid="@leftContent" allowBody="false">Left<br/>Content</span></td>
                <td id="headerContent"><span jsfid="clay" clayJsfid="@headercontent" allowBody="false">Header<br/>Content</span></td>
             </tr>
           &nbs p; <tr>
                <td id="bodyContent"><span jsfid="clay" clayJsfid="@bodycontent" allowBody="false">Body<br/>Content</span></td>
             </tr>
             <tr>
                <td id="footerContent"><span jsfid="clay" clayJsfid="@footercontent" allowBody="false">Footer<br/>Content</span></td>
             </tr>
          </table>
      </form>
   </body>
</html>
 
Full XML entry page:

<view>
    <component jsfid="/page2.xml" extends="basePage">
       <symbols>
           <set name="@bodycontent" value="/hello.html"/>
       </symbols>
    </component>
</view>
 
Or, Full HTML entry page:
<html jsfid="clay" clayJsfid="/layout.html" leftContent=space headercontent=space bodycontent="/hello.html" footercontent=space allowBody=false>
    <head></head>
    <body>Mock Body</body>
</html>
 
 
Gary
 
-------------- Original message --------------
From: Mike Kienenberger <[EMAIL PROTECTED]>

> I'm pretty sure that the value has to be a value binding and not a
> method binding.
> The same issue came up on the facelets user list, and the recommended
> solution is to pass a backing bean that implements your method
> binding.
>
> Ie,
>
>
>
> and in your aliased code....
>
> action=""
>
>
> On 12/23/05, Dave <[EMAIL PROTECTED]>wrote:
> >
> >
> >
> > summaryBean.backBean is a method binding that returns a Backing bean for the
> > alias. I got error "backing bean is null" during restoreView/render phase.
> > It seems that JSF can not tell if it is the name of the backing bean or
> > method binding. But JSF should be able to tell the difference because method
> > binding has a dot(.). Is this a bug? or JSF does not support it? Thanks.
> >
> >
> >
> > .....
> >

> >

> >
> >
> > ________________________________
> > Yahoo! Photos
> > Ring in the New Year with Photo Calendars. Add photos, events, holidays,
> > whatever.
> >
> >

Reply via email to