[JBoss Seam] - Re: @SelectItems and @SelectItemsSelection annotations?
by CptnKirk
This is the expected behaviour. The @SelectItems annotation applies a data binder and outjects the wrapped object as a contextual variable (regions). Direct access to the method selector.getRegions() will return the method's original values. Useful for calling the method from other components or JSF backing beans. Getting a List of SelectItems wouldn't be right in that case.
As with most things in Seam bijection happens to and from a Seam context. Seam adds a variable resolver so that JSF can find things stored in these contexts. However it doesn't prevent you from calling things via the JSF std way, getting JSF std results/objects back.
If you did want JSF to intercept and apply conversion to #{selector.regions} you might be able to call the data binder directly within your custom converter. I think the method that does the conversion might be private, but I could change that if you think this code could be reused elsewhere. Otherwise, just remember that #{regions} gets a contextual variable from a Seam context and #{selector.regions} calls a method on #{selector}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972639#3972639
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972639
19 years, 7 months
[JBoss Seam] - Re: the database of Seam application
by norman.richards@jboss.com
Woops - that'll teach me to not look at that example. The original poster was right that the hypersonic instance in the booking example is entirely in memory. We normally don't recommend using a private instance like this, but it works for the example. To use the JBoss-managed HSQL instance, change the connection-url in booking-ds.xml to:
| <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</connection-url>
Redeploy the application (not just the datasource) and then from the JMX console, find the jboss:database=localDB,service=Hypersonic MBean. Click the link, then invoke the startDatabaseManager operation. You'll see your data.
You can look at the DVD store for another example. The DVD store uses it's own HSQL instance, but it registers it as a proper MBean so you can manage the data.
Hope that helps.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972633#3972633
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972633
19 years, 7 months
[JBoss Seam] - Found the cause but not the cure
by Holy Joe
I've figured out why this is happening, but I don't know how to fix it yet. The problem is this: Each time a method on my bean gets called, the DataModel is injected/outjected, and a new DataModel is created to wrap my list. The JSF implementation, however, continues to use the first one outjected, so when it finally sets the rowIndex for my selected item, it is on a DataModel that is no longer accessible from Seam (it has been replaced by subsequent outjections). Without the extra form field, there's only one call to my bean, so there's no problem.
Although I'm less lost when wandering around the Seam source these days, this seems like a deeper fix than my limited understanding can supply. Do any Seam gurus out there have some advice on how to go about fixing this? I'll give it a try myself, but a couple of starting pointers would be welcome.
Thanks,
Joe
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972632#3972632
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972632
19 years, 7 months