[JBoss Seam] - JavaBean injection
by RRLevering
For a particular very complex grid-like view, I use a factory method to set a large two-dimensionsal javabean array where each javabean is non-Seam managed POJO - a description of what to render in that grid:
| @In(required=false)
| @Out(required=false)
| private GridSlot[][] slots;
|
| @Factory("slots")
| public void createSlots() {
| ...
| }
|
I then use facelet methods to iterate across the grid and draw it to the screen. It all works fine. The problem is I need certain parts of the grid to redraw based on other grid changes.
Each one of these grid squares contains a h:selectOneMenu like:
| <ui:repeat value="#{slots}" item="row">
| <ui:repeat value="#{row" item="slot">
| <h:selectOneMenu value="#{slot.id}" valueChangeListener="#{myAction.updateGrid}" onchange="submit()" />
| ...
|
When something in the selection box changes, the form submits correctly and I get good event values in the updateGrid method. In addition, when the view is redrawn post submit, the changed slot information is reflected, which makes me believe that the bijection is working on some level. However, in the updateGrid method, the local variable "slots" does not actually have updated properties. I had many theories about why this is happening, but many attempts to fix this (making the POJO seam managed, playing with injection type, etc.) haven't changed anything.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049875#4049875
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049875
17 years, 6 months