-
1. Re: Label Whitespace Disapears on Re-render
kragoth Sep 16, 2011 1:50 AM (in response to cdesserich)Every example for s:decorate I have seen uses a template. So...that's what I did and it seems to work.
Try doing this. NOTE carefully how the label is defined now
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:rich="http://richfaces.org/rich" xmlns:a="http://richfaces.org/a4j"> <head> <title>WhitespaceTest</title> </head> <body> <h:form id="form"> <s:decorate id="decorate" template="edit.xhtml"> <h:selectBooleanCheckbox id="checkbox" value="#{true}" /> <ui:define name="label">label</ui:define> </s:decorate> <a:commandLink id="commandLink" value="commandLink" reRender="decorate" /> </h:form> </body> </html>
And use this template file.
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:s="http://jboss.com/products/seam/taglib"> <div> <span> <ui:insert/> </span> <s:label> <ui:insert name="label"/> </s:label> </div> </ui:composition>
Ultimately I have no idea why it behaves the way it does. But....this should do. :)
-
2. Re: Label Whitespace Disapears on Re-render
cdesserich Sep 19, 2011 10:21 AM (in response to cdesserich)Sorry it took me this long to respond. The team I'm working on is coming up to a deadline so I haven't had a chance to try the workaround out. I did read something about how facelets alters the component tree (possibly in unwanted ways) somewhere, but I can't remember where and I'm not sure I would have understood anyway. It's just a thought that if facelets was maybe generating markup that JSF wasn't altering, that that may be why this works, but of course I don't know that for sure...
Anyway thanks for the workaround. I will try and see if it will work to make my project more consistent, I just can't get to it at this point. If and when I do, I'll try and post again with my success/failure.