-
1. Re: MethodExpressionActionListener programmatically created
ethnarch Jan 16, 2009 10:52 AM (in response to ethnarch)I probably should have posted this code also, this is where I am generating the new object go easy on me if this is all wrong. The summaryFactory is where the code above lives.
public void encodeEnd(FacesContext context){ BizRulesSummaryPanelFactory summaryFactory = new BizRulesSummaryPanelFactory(); HtmlOutputLabel p = new HtmlOutputLabel(); p.setValue("test"); BRRule brRule = (BRRule)getAttributes().get("brRule"); try{ if(brRule!=null){ UIComponent component = summaryFactory.build(this, brRule, context); component.encodeAll(context); this.getChildren().add(component); } this.getChildren().add(p); }catch(IOException e){ logger.error(e); } }
-
2. Re: MethodExpressionActionListener programmatically created
ethnarch Jan 19, 2009 8:57 AM (in response to ethnarch)I tried doing this another way by binding my assembled parts to a panelmenu through the backing bean. This gave me the same result. It seems to be rather easily reproducible. Here is my new code.
I am not using the binding tag on the jsp page instead I am just using the tag as a place holder.<rich:panelMenu id="ruleSummaryPanel"/>
Then in my backing bean I am doing this.HtmlPanelMenu panelMenu = (HtmlPanelMenu)FacesContext.getCurrentInstance().getViewRoot().findComponent("frmMain:ruleSummaryPanel"); if(panelMenu!=null){ Application application = FacesContext.getCurrentInstance().getApplication(); HtmlPanelMenuGroup panelMenuGroup = (HtmlPanelMenuGroup)application.createComponent(HtmlPanelMenuGroup.COMPONENT_TYPE); panelMenuGroup.setLabel("test01"); HtmlPanelMenuItem panelItem = (HtmlPanelMenuItem)application.createComponent(HtmlPanelMenuItem.COMPONENT_TYPE); //create method expression ExpressionFactory expressionFactory = application.getExpressionFactory(); Class [] classList=new Class[1]; classList[0]=ActionEvent.class; MethodExpression methodExpression = expressionFactory.createMethodExpression( FacesContext.getCurrentInstance().getELContext(), "#{ruleMgmt.onSelectSection}", null, classList); MethodExpressionActionListener actionListener = new MethodExpressionActionListener(methodExpression); panelMenuGroup.getChildren().add(panelItem); panelItem.addActionListener(actionListener); panelMenu.getChildren().add(panelMenuGroup);
The problem is pretty easily reproduced in this way. The actionListener will work propertly in ie6 and 7 but not in any other browsers. Does anybody know why? -
3. Re: MethodExpressionActionListener programmatically created
nbelaevski Jan 19, 2009 9:21 AM (in response to ethnarch)Hi,
Probably a bug in 3.1.3.GA. What about 3.1.6, does it work there? -
4. Re: MethodExpressionActionListener programmatically created
ethnarch Jan 19, 2009 9:32 AM (in response to ethnarch)I haven't tried that, but I probably should have thanks I'll let you know.
-
5. Re: MethodExpressionActionListener programmatically created
nbelaevski Jan 19, 2009 11:19 AM (in response to ethnarch)Right, sorry, thank you in advance for checking with 3.1.6.SR1! BTW, the problem looks similar to: https://jira.jboss.org/jira/browse/RF-4239. Have you tried with FF2/Safari or Opera?
-
6. Re: MethodExpressionActionListener programmatically created
ethnarch Jan 19, 2009 11:43 AM (in response to ethnarch)3.1.6
gives me the same problem
I tried it in FF3, Opera and Chrome. Only IE 6 and 7 work.BTW, the problem looks similar to: https://jira.jboss.org/jira/browse/RF-4239
That's interesting I never tried doing this hardcoded or with a different type of component. I might try this some other other way. -
7. Re: MethodExpressionActionListener programmatically created
ethnarch Jan 19, 2009 12:01 PM (in response to ethnarch)I switched out the HtmlPanelMenuItem for an HtmlCommandButton and this works. I think this bug matches my problem.