-
1. Re: Seam Conversational components and JSF component bindings
ranjithk Mar 6, 2008 9:55 AM (in response to ranjithk)I want to add onto my post. I tried the way seam document suggests i.e having a EVENT scoped Seam Grid component and a Conversation scoped seam gridEditor component but then seam throws the following error. Here sdmManager is equivalent gridEditor, sdmGrid is equivalent grid and grid refers to the actual HtmlPanelGrid javax.el.PropertyNotFoundException: /html/add.xhtml @31,64 binding="#{sdmManager.sdmGrid.grid}" Target Unreachable, identifier 'sdmManager' resolved to null
-
2. Re: Seam Conversational components and JSF component bindings
rmcdonough Mar 6, 2008 4:31 PM (in response to ranjithk)You sound like you're having a similar problem as I was. Christian followed up with a post that explains the problem here:
http://seamframework.org/Community/ConversationalScopeWithJavaBeans
Ryan-
-
3. Re: Seam Conversational components and JSF component bindings
mail.micke Mar 6, 2008 4:41 PM (in response to ranjithk)Hi,
I went through the same a while ago.For me it worked to @Out:ject the object I did the bindnig to.
- Micke
-
4. Re: Seam Conversational components and JSF component bindings
ranjithk Mar 7, 2008 2:50 AM (in response to ranjithk)Thanks for your responses. I will try out the suggestions.
Ranjith
-
5. Re: Seam Conversational components and JSF component bindings
ranjithk Mar 7, 2008 4:01 AM (in response to ranjithk)I am still not able to get it working. I am posting the code here so it might help in understanding how I am trying to use the workaround mentioned in the document. I tried to outject thesdmGrid as suggested by Micke but it did not help either
Binding in JSP page: -------------------- <h:panelGrid columns="2" binding="#{sdmManager.sdmGrid.grid}"> </h:panelGrid>
SDMManager - Conversation scope component: ------------------------------------------- @Name("sdmManager") @Scope(ScopeType.CONVERSATION) public class SDMManager { @In(required=false) private SDMGrid sdmGrid; public SDMGrid getSdmGrid(){ sdmGrid = new SDMGrid(); HtmlPanelGrid grid = new HtmlPanelGrid(); sdmGrid.setGrid(grid); List<UIComponent> children = grid.getChildren(); Collection<FieldFormatData> formats = dataManager.getFieldFormatData(); for(FieldFormatData format:formats){ HtmlOutputLabel outputLabel = new HtmlOutputLabel(); outputLabel.setValue(format.getShortDesr()); children.add(outputLabel); HtmlInputText inputText = new HtmlInputText(); inputText.setSize(10); inputText.setMaxlength(10); System.out.println("Binding ................................... " + format.getEntityField()); inputText.setValueBinding("value", FacesContext.getCurrentInstance().getApplication().createValueBinding("#{entity."+format.getEntityField()+"}")); children.add(inputText); } }
SDMGrid - Event Scope component ---------------------------- @Name("sdmGrid") @Scope(ScopeType.EVENT) public class SDMGrid { private HtmlPanelGrid grid; public HtmlPanelGrid getGrid() { return grid; } public void setGrid(HtmlPanelGrid grid) { this.grid = grid; } }
Ranjith
-
6. Re: Seam Conversational components and JSF component bindings
ranjithk Mar 10, 2008 3:52 AM (in response to ranjithk)Hi,
I am still looking for a solution for this problem. Would really appreciate any help on this. Thanks
Ranjith
-
7. Re: Seam Conversational components and JSF component bindings
matt.drees Mar 10, 2008 5:29 AM (in response to ranjithk)Ranjith:
Binding in JSP page: -------------------- <h:panelGrid columns="2" binding="#{sdmManager.sdmGrid.grid}"> </h:panelGrid>
You're not really following what the Seam documentation is suggesting. Your view should look more like this:
<h:panelGrid columns="2" binding="#{sdmGrid.grid}"> </h:panelGrid>
And your manager should look more like this:
@Name("sdmManager") @Scope(ScopeType.CONVERSATION) public class SDMManager { @In(create=true) private SDMGrid sdmGrid; public void populateGrid(){ // do stuff to sdmGrid.getGrid, if empty } }
You'd probably want to call populateGrid() in a page action.
-
8. Re: Seam Conversational components and JSF component bindings
ranjithk Mar 10, 2008 7:02 AM (in response to ranjithk)I could get it working now. Thanks a lot Matt
Ranjith