This content has been marked as final.
Show 2 replies
-
1. Re: SimpleTogglePanel + Seam in 3.1.0
ilya_shaikovsky Sep 26, 2007 9:50 AM (in response to doballve)paste please code snippet for your case.
-
2. Re: SimpleTogglePanel + Seam in 3.1.0
doballve Sep 26, 2007 2:22 PM (in response to doballve)I got the cause a bit more refined while preparing you a snippet: it only happens if I use my custom TagHandler inside the form. I can move it to immediately before the form and I think it works the same for me, so up to you to decide if it is a bug or just wrong TagHandler usage.
Here is the XHTML:<h:form enctype="multipart/form-data"> <dc:formMode value="EDITABLE" var="dcFormMode"> <rich:simpleTogglePanel switchType="client" label="Panel1"> <h:inputText id="v1" value="#{panelTest.value1}" required="true"/> <h:message for="v1"/> </rich:simpleTogglePanel> <rich:simpleTogglePanel switchType="client" label="Panel2"> <h:inputText id="v2" value="#{panelTest.value2}" required="true"/> <h:message for="v2"/> </rich:simpleTogglePanel> <h:messages/> <h:commandButton value="Submit"/> </dc:formMode> </h:form>
And here the relevant part of the TagHandler:public void apply(FaceletContext ctx, UIComponent component) throws IOException, FacesException, FaceletException, ELException { ... VariableMapper orig = ctx.getVariableMapper(); try { // use a wrapper to redefine our value VariableMapperWrapper map = new VariableMapperWrapper(orig); ValueExpression modeVE = ctx.getExpressionFactory() .createValueExpression(uiFormMode, UIFormMode.class); map.setVariable(var.getValue(), modeVE); ctx.setVariableMapper(map); this.nextHandler.apply(ctx, component); } finally { ctx.setVariableMapper(orig); } }
Thanks for your time.
Diego