Hi

>There seems to be some problems with this aproach with respect to name 
>resolving.
>
>Scenario : @managed-bean-name is a backing bean X, the table that you want to 
>display (see: Outer HTML template include) is from a bean Person as person on 
>X, 
>and has properties firstName and middleName and so on....
>Now doing this:
><tr jsfid="clay" clayJsfid="/widgets.html" label="First Name:"
>        property="person.firstName" size="20" maxlength="30"
>        required="true" immediate="false"/>
>results in:
>
>Subsequent characters of component identifier must be a letter, a digit, an 
>underscore ('_'), or a dash ('-')! But component identifier contains "."
>trying property="['person.firstName']" it also complains

You are using the property symbol in this example to populate the JSF component 
id.  
The component id cannot have a dot character.  You will want to use
the @managed-bean-name symbol for the "person" mnemonic.  

Symbols are scoped from the out inwards.  What I mean by this is that a symbol
like managed-bean-name is defined at the page/clay component sub tree.  All 
components under that subtree managed by Clay will inherit the symbol defined 
at the outer scope.   Each component can choose to override the symbol which 
will propagate to all its child components. 

So, if you are using full Clay html views, the defaut for the managed bean name 
is 
derived from the view id.  This is a core mechanism in Shale used to map a view 
with a view controller.  So, if your view was /symbols/page1.xml, the default
managed-bean-name symbol would be "symbols$page1".  

But, if you have part of the page that you would like to map to another managed 
bean,
you can override it at a outer scope.  Consider the following: 

<tr jsfid="clay" clayJsfid="/widgets.html" label="First Name:"
        property="person" size="20" maxlength="30"
        required="true" immediate="false" managed-bean-name="person" ..
.. or .. 
<tr jsfid="clay" clayJsfid="/widgets.html" label="First Name:"
        property="person" size="20" maxlength="30"
        required="true" immediate="false" 
managed-bean-name="symbols$person.person" ..
.. or ..
<span jsfid="subview" managed-bean-name="person" ..
   <table ..
      <tr jsfid="clay" clayJsfid="/widgets.html" label="First Name:"
           property="person" size="20" maxlength="30"
           required="true" immediate="false" ..
    </table..
</span..

>Any suggestions?
>Hermod
>

The example I gave you  is now part of the Shale use cases.  From the menu 
page, it's under the "Symbols" link.  
It demonstrates how you can use symbols with generic HTML templates layouts 
(tiles like).  These HTML 
templates can be loaded from the classpath or context root.  

I also added some simple dataTable components to the rolodex use case.  There 
is a web pager component
and column sorter.  They show how to use the new shale remoting to load images 
from the classpath.
I think these components might also show how simple JSF component authoring can 
be.

Gary

Reply via email to