This content has been marked as final.
Show 3 replies
-
1. Re: Property 'statusMessages'
pmuir Oct 6, 2008 4:26 PM (in response to nico.ben)You can't inject conversation scoped objects into objects you use for JSF binding.
-
2. Re: Property 'statusMessages'
nimo22 Oct 6, 2008 6:36 PM (in response to nico.ben)If you want to use binding in conversation-scope, then look at the SEAM-Reference:
7.10. Conversational components and JSF component
bindings -
3. Re: Property 'statusMessages'
nico.ben Oct 9, 2008 10:40 AM (in response to nico.ben)Hi,
I followed the instructions from chapter 7.10 creating:@Name("menuToolBar") @Scope(ScopeType.EVENT) public class MenuToolBar extends HtmlToolBar { private HtmlToolBar toolBar; public HtmlToolBar getToolBar() { return toolBar; } public void setToolBar(HtmlToolBar toolBar) { this.toolBar = toolBar; } }
Which is then injected in:
@Scope(ScopeType.SESSION) @Name("loginInfo") public class LoginInfo implements Serializable { ... @In(required=false) private MenuToolBar menuToolBar; public HtmlToolBar getMenuToolBar() { if (isLoggedIn()) { initToolbar(menuToolBar); } return menuToolBar; } public void setMenuToolBar(MenuToolBar menuToolBar) { this.menuToolBar = menuToolBar; } }
In JSF now I call:
<rich:toolBar binding="#{loginInfo.menuToolBar}" rendered="#{identity.loggedIn}"/>
But I get this exception:
javax.faces.FacesException: javax.el.PropertyNotFoundException: /layout/menu.xhtml @18,87 binding="#{loginInfo.menuToolBar}": Property 'menuToolBar' not writable on type org.richfaces.component.html.HtmlToolBar at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:253) at org.jboss.seam.jsf.SeamApplication.createComponent(SeamApplication.java:394)
Where do I get wrong, please?
Cheers,
Nic