-
1. Re: s:decorate changed to use DIV instead of SPAN
christian.bauer Oct 8, 2007 8:33 AM (in response to damianharvey)?! s:decorate doesn't render anything. It decorates a template. You can customize/create that template.
-
2. Re: s:decorate changed to use DIV instead of SPAN
damianharvey Oct 8, 2007 8:47 AM (in response to damianharvey)Sorry but it does. Look at the pagesource.
From UIDecorate.java under Seam 1.3:@Override public void encodeBegin(FacesContext context) throws IOException { super.encodeBegin(context); Contexts.getEventContext().set("invalid", hasMessage(this, context)); Contexts.getEventContext().set("required", hasRequired(this, context)); context.getResponseWriter().startElement("span", this); context.getResponseWriter().writeAttribute("id", getClientId(context), "id");
And then in DecorateRendererBase (split out from UIDecorate) from Seam 2.0:@Override protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException { UIDecorate decorate = (UIDecorate) component; Contexts.getEventContext().set("invalid", Decoration.hasMessage(decorate, context)); Contexts.getEventContext().set("required", Decoration.hasRequired(component, context)); boolean hasMessage = decorate.hasMessage(); writer.startElement("div", decorate); writer.writeAttribute("id", decorate.getClientId(context), "id");
-
3. Re: s:decorate changed to use DIV instead of SPAN
pmuir Oct 8, 2007 8:48 AM (in response to damianharvey)"damianharvey" wrote:
Can anyone think of any suggestions to remedy this?
http://jira.jboss.com/jira/browse/JBSEAM-1572Why was this changed? What was wrong with using a span?
It's not valid html to nest div's inside spans hence inflexible. -
4. Re: s:decorate changed to use DIV instead of SPAN
damianharvey Oct 8, 2007 9:15 AM (in response to damianharvey)"pete.muir@jboss.org" wrote:
http://jira.jboss.com/jira/browse/JBSEAM-1572
I'm not sure what the solution proposed there involves? Is it to move the field value out of the decorate and use the "for" attribute? Or to use ui:decorate?It's not valid html to nest div's inside spans hence inflexible.
I think it's a moot point about being inflexible as the current situation is obviously inflexible as well. IMHO I think that span is more flexible. If someone is worried about valid HTML then they shouldn't use a div in their template. At least this way they can style the span in their template to resemble a div (ie. display=block, etc). I can't do anything to style this div to look like a span.
Thanks,
Damian. -
5. Re: s:decorate changed to use DIV instead of SPAN
pmuir Oct 8, 2007 9:20 AM (in response to damianharvey)There is no solution unless the FR described (by me) in that issue gets implemented. You could file a issue asking for the ability to style the s:decorate's div.
At least this way they can style the span in their template to resemble a div (ie. display=block, etc)
No, because it's not valid to nest block level components in inline components. -
6. Re: s:decorate changed to use DIV instead of SPAN
damianharvey Oct 8, 2007 9:28 AM (in response to damianharvey)One option could be to use the approach that the Richfaces guys have followed (eg. in the a4j:outputPanel) and have an attribute called layout that can be set to 'block' or 'inline'.
From the outputPanel documentation:
HTML layout for generated markup. Possible values: "block" for generating an HTML div element, "inline" for generating an HTML span element, and "none" for generating no HTML element. There is a minor exception for the "none" case where a child element has the property "rendered" set to "false". In this case, we create an empty span element with same ID as the child element to use as a placeholder for later processing.
Setting it to "none" would also partially address the issue in JBSEAM-1572.
Thanks,
Damian. -
7. Re: s:decorate changed to use DIV instead of SPAN
damianharvey Oct 8, 2007 9:51 AM (in response to damianharvey)I've raised a JIRA to allow for the styling of the decorate. http://jira.jboss.com/jira/browse/JBSEAM-2065.
I'll change the DecorateRendererBase myself and manually build as I have no other option and certainly can't use it as it is.
Pete, do you think that styling the DIV is the best way forward or is the "layout" option (as per Richfaces) feasible?
Thanks,
Damian. -
8. Re: s:decorate changed to use DIV instead of SPAN
pmuir Oct 8, 2007 11:02 AM (in response to damianharvey)"damianharvey" wrote:
I've raised a JIRA to allow for the styling of the decorate. http://jira.jboss.com/jira/browse/JBSEAM-2065.
I'll get this fixed for the GA as it's almost a bug and necessary ;)Pete, do you think that styling the DIV is the best way forward or is the "layout" option (as per Richfaces) feasible?
I would like to see both options available. I've scheduled the layout option for 2.0.1 (if you do the patch yourself, feel free to attach it to the issue :) ) -
9. Re: s:decorate changed to use DIV instead of SPAN
damianharvey Oct 8, 2007 11:14 AM (in response to damianharvey)Cheers Pete. Much appreciated.
I'll have a go myself and put the patch up for your inspection/amusement.
Thanks,
Damian.