[ 
https://issues.apache.org/jira/browse/TOBAGO-410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498519
 ] 

Udo Schnurpfeil commented on TOBAGO-410:
----------------------------------------

in the Java Code you can use:

      StyleClasses classes = StyleClasses.ensureStyleClasses(component);
      classes.add???Class(...);

to modify the Style Classes. Here is also the possibility to use markups with 
"addMarkupClass"

> attribute-tag causes ClassCastException
> ---------------------------------------
>
>                 Key: TOBAGO-410
>                 URL: https://issues.apache.org/jira/browse/TOBAGO-410
>             Project: MyFaces Tobago
>          Issue Type: Bug
>          Components: Core
>            Reporter: Matthias Wronka
>             Fix For: 1.0.11, 1.0.12
>
>
> We use the tc:attribute-Tag to assign styles to components such as
> <tc:panel>
>       <tc:attribute name="styleClass" value="tobago-panel-default my-style" />
> ...
> or using Java Code:
>        ivPanel = (UIPanel) ComponentUtil.createComponent(facesContext, 
> UIPanel.COMPONENT_TYPE, "Panel");
>        Map lvAttr = ivPanel.getAttributes();
>        lvAttr.put("styleClass", "tobago-panel-default my-style");
> In the current snapshots this causes a ClassCastException:
> java.lang.ClassCastException
>       at 
> org.apache.myfaces.tobago.renderkit.html.StyleClasses.ensureStyleClasses(StyleClasses.java:64)
>       at 
> org.apache.myfaces.tobago.renderkit.html.HtmlRendererUtil.createCssClass(HtmlRendererUtil.java:115)
>       at 
> org.apache.myfaces.tobago.renderkit.html.HtmlRendererUtil.prepareRender(HtmlRendererUtil.java:90)
>       at 
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.DefaultLayoutRenderer.prepareRender(DefaultLayoutRenderer.java:40)
>       at 
> org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java:73)
>       at 
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.encodeChildrenOfComponent(GridLayoutRenderer.java:364)
>       at 
> org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent(UILayout.java:71)
>       at 
> org.apache.myfaces.tobago.component.UIGridLayout.encodeChildrenOfComponent(UIGridLayout.java:277)
>       at 
> org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(UIPanelBase.java:43)
>       at 
> org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java:77)
>       at 
> org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.DefaultLayoutRenderer.encodeChildrenOfComponent(DefaultLayoutRenderer.java:47)
>       at 
> org.apache.myfaces.tobago.component.UILayout.encodeChildrenOfComponent(UILayout.java:71)
>       at 
> org.apache.myfaces.tobago.component.UIPanelBase.encodeChildren(UIPanelBase.java:43)
>       at 
> org.apache.myfaces.tobago.renderkit.RenderUtil.encode(RenderUtil.java:77)
> As this feature worked fine with version 1.0.10 we would appreciate a 
> transition period, in which the styles are still assigned but a warning is 
> logged. Currently our applications cannot use these snapshots.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to