I think you've kinda got it a bit backward. Basically Seam has a big map of
components that are available. These components are defined either in
components.xml with or more usually with the @Name annotation.
For accessing pure components these are the only names that are available for
you to use in EL and for injection via @In. So you can't put
#{searchRecord.xxx} in an EL expression because there is no component called
searchRecord. Similarly @In looks for components by using the field/method
name unless it is specified explicitly by @In( value="" ).
To get your example to work you have to leave the name as profileRecord in the
.xhtml or use some method of creating a profileRecord alias. Putting
<factory auto-create="true" name="searchRecord" value="#{profileRecord}"/>
would probably have the effect you are after.
It sounds like you might be trying to achieve something similar to what I am at
the moment. I'm trying to create a searchTemplate.xhtml facelet template that
wraps all the common layout and action hooks of a standard search screen
(parameters, grid, search button, rows returned display, pagination buttons
etc). Then I'll use the template in a real view page and just populate the
parameter grid and data grid definition. On the model side I want to implement
all the common logic and magic in a reusable component and allow overriding
with custom logic per page (custom validation, grid population etc).
So I want do have component per search screen but then access the current
search screen in my search template with #{searchBean}.
If anyone has any experience doing this I'd be interested to hear about it.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012937#4012937
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012937
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user