Hi all,
Since a week ago there has not been any answer on this thread... So I am
asking again for some points.
Debugging the application, I saw that the custom renderer for the panelBox
was read from faces-config.xml and loaded inside the renderkit's map. On the
other hand, when the jsp needs to render the panelBox, the default
Trinidad's PanelBoxRenderer is the one who gets used, not the custom one.
Maybe this is a bug, or maybe I am misunderstanding anything. I am using
Myfaces 1.1.5 and Trinidad 1.0.3.
Thanks in advance,
- - Rafa
On Oct 25, 2007 12:54 PM, Rafa Pérez <[EMAIL PROTECTED]> wrote:
> Hi Michael,
>
> I need to set the width to a percentage. The contentStyle attribute for
> the panelBox works as if I set in my skin's CSS
>
> af|panelBox::medium af|panelBox::content { width: 100% }
>
> I have been looking inside PanelBoxRenderer, and I have found the method
> responsible for rendering de body:
>
> protected void renderBody(FacesContext context, RenderingContext arc,
> UIComponent component, FacesBean bean, Object icon, Object text) throws
> IOException;
>
> At line 309, you can see:
>
> OutputUtils.renderLayoutTableAttributes (context, arc, "0", null);
>
> The last parameter is the width for the table that is going to be
> generated as container for both the header and the content of the panelBox,
> and goes null, i.e., the width attribute for this table is not set.
>
> Does not it make sense to fix this parameter to 100% and so the header and
> the content fill all the width of the body?
>
> Regards,
>
> - - Rafa
>
>
>
> On 10/25/07, Michael Borchert <[EMAIL PROTECTED]>
> wrote:
> >
> > Hello,
> >
> > I'm currently setting inlineStyle and contentStyle to fixed width.
> > contentStyle = inlineStyle width - graphics width.
> >
> > Michael
> >
> > Am Donnerstag, den 25.10.2007, 10:15 +0200 schrieb Rafa Pérez:
> > > Hi all,
> > >
> > > I am using panelBox as container for some links in our jsp's. Looking
> > > into the generated HTML for this component I can see the following:
> > >
> > >
> > > <!--Start: org.apache.myfaces.trinidad.Panel["_idJsp129"]-->
> > > <table class="af_panelBox_dark" style="" border="0" cellpadding="0"
> > > cellspacing="0">
> > > <tbody>
> > > <tr>
> > > <td class="af_panelBox_top-start"></td>
> > >
> > > <td class="af_panelBox_top"></td>
> > >
> > > <td class="af_panelBox_top-end"></td>
> > > </tr>
> > > <tr>
> > > <td
> > > class="af_panelBox_start"></td>
> > > <td class="af_panelBox_body">
> > > <table border="0" cellpadding="0" cellspacing="0">
> > > <tbody>
> > > <tr>
> > > <td
> > > class="af_panelBox_header">Organización</td>
> > > </tr>
> > > <tr>
> > > <td class="af_panelBox_content">
> > > <!--Start: org.apache.myfaces.trinidad.Panel["_idJsp130"]-->
> > > <div class="af_panelList">
> > > <ul>
> > > <li> ... /li>
> > > </ul>
> > > </div>
> > > </td>
> > > </tr>
> > > </tbody>
> > > </table>
> > > </td>
> > > <td class="af_panelBox_end"></td>
> > >
> > > </tr>
> > > <tr>
> > > <td class="af_panelBox_bottom-start"></td>
> > >
> > > <td class="af_panelBox_bottom"></td>
> > >
> > > <td class="af_panelBox_bottom-end"></td>
> > > </tr>
> > > </tbody>
> > > </table>
> > >
> > > As you see, the first child of panelBox's body is a table. There is no
> > > way of styling the width of this element, what causes that the
> > > panelBox::header and the panelBox::content are unable to fill the
> > > width of the panelBox::body.
> > >
> > > I do not know if this is the correct behaviour or it is a bug. To work
> > > around this issue, I am trying to define a custom renderer for
> > > panelBox. Unfortunately, I have no success. I have created
> > > MyPanelBoxRenderer who extends PanelBoxRenderer, and declared it as a
> > > renderer in faces-config.xml as follows:
> > >
> > > <render-kit>
> > > <render-kit-id>
> > > org.apache.myfaces.trinidad.core
> > > </render-kit-id>
> > >
> > > <render-kit-class>
> > >
> > > org.apache.myfaces.trinidadinternal.renderkit.core.CoreRenderKit
> > > </render-kit-class>
> > >
> > > <renderer>
> > > <component-family>
> > > org.apache.myfaces.trinidad.Panel
> > > </component-family>
> > > <renderer-type>
> > > org.apache.myfaces.trinidad.Box
> > > </renderer-type>
> > > <renderer-class>
> > > core.vista.renderer.MyPanelBoxRenderer
> > > </renderer-class>
> > > </renderer>
> > > </render-kit>
> > >
> > > But the application does not use this renderer at all. Any ideas?
> > >
> > > Thanks in advance,
> > >
> > > - - Rafa
> >
> >
>