tags:

views:

21

answers:

1

Hi all,

Does anyone know if I can inject value from pages.xml into a Seam component? In pages.xml there seems to be an in element that would indicate I can but I can't figure out how to use it & documentation is lacking.

I'm trying to set a value in a component that varies from page to page. It needs to be set for page load & I don't want it exposed to the user. Here's what I've tried at the moment:

<page view-id="/daily.xhtml">
    <in name="chartLoader.reportType" value="DAILY"/>
    <action execute="#{chartLoader.loadData}" />
</page>

<page view-id="/hourly.xhtml">
    <in name="#{chartLoader.reportType}" value="HOURLY"/>
    <action execute="#{chartLoader.loadData}" />
</page>

Neither of these work now with an error of:

javax.el.PropertyNotWritableException: Illegal Syntax for Set Operation

The reportType property is private but it has the correct public setter method. So I'm thinking that my syntax is slightly off.

Does anyone know how to use this element correctly or have a better suggestion?

Thanks, Lee

+2  A: 

Try this instead

<action execute="#{chartLoader.setReportType('DAILY')}"/>
Arthur Ronald F D Garcia
Thanks. It never occurred to me that I pass method parameters over like that (and as I do in my Seam pages) for some reason.
Lee Theobald
@Lee Theobald I am pretty sure Seam must support a "property" element inside a "page" element
Arthur Ronald F D Garcia