Components

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Components

pepone.onrez
Hello
can any body help to understand the renderComponet



//MENU

public abstract class Menu extends AbstractComponent {
       
        private String name;
        private String style;
       
        protected void renderComponent(IMarkupWriter writer,IRequestCycle cycle)
        {
                if(cycle.isRewinding())
                {
                        return;
                }
               
                writer.begin("div");
                writer.attribute("class","Menu");
                writer.begin("ul");
                                   
               //here i want to begin render Items menu  i don't know how do it

                writer.end("ul");
                writer.end("div");
        }
}

How can i do to Items componet begin reder betwenn ul tags or in a
specific part of the html generated code?
 
is necesary that items be a property of the menu or can i specific
items as simple childs componets and set allow-body true?

<div jwcid="@Menu" name="topMenu" style="topmenu">
            <div jwcid="@ItemMenu" name="Inicio"/>
            <div jwcid="@ItemMenu" name="Tienda"/>
            <div jwcid="@ItemMenu" name="Tpv"/>
            <div jwcid="@ItemMenu" name="Desarrollo Web"/>
 </div>

Thanks to all

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Components

richard.hensley
It is normal practice for a component to render the surrounding html, and
the allow the contained components to render them selves. So, to accomplish
this feat use the renderBody() method on AbstractComponent. Take a peak at
any of the Standard components that allow a body.

Richard

-----Original Message-----
From: pepone pepone [mailto:[hidden email]]
Sent: Friday, May 13, 2005 11:15 AM
To: [hidden email]
Subject: Components

Hello
can any body help to understand the renderComponet



//MENU

public abstract class Menu extends AbstractComponent {
       
        private String name;
        private String style;
       
        protected void renderComponent(IMarkupWriter writer,IRequestCycle
cycle)
        {
                if(cycle.isRewinding())
                {
                        return;
                }
               
                writer.begin("div");
                writer.attribute("class","Menu");
                writer.begin("ul");
                                   
               //here i want to begin render Items menu  i don't know how do
it

                writer.end("ul");
                writer.end("div");
        }
}

How can i do to Items componet begin reder betwenn ul tags or in a
specific part of the html generated code?
 
is necesary that items be a property of the menu or can i specific
items as simple childs componets and set allow-body true?

<div jwcid="@Menu" name="topMenu" style="topmenu">
            <div jwcid="@ItemMenu" name="Inicio"/>
            <div jwcid="@ItemMenu" name="Tienda"/>
            <div jwcid="@ItemMenu" name="Tpv"/>
            <div jwcid="@ItemMenu" name="Desarrollo Web"/>
 </div>

Thanks to all

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Components

Patrick Casey
In reply to this post by pepone.onrez
writer.begin("ul");
for (int x=0; x<10; x++){
        writer.begin("li");
        writer.print("Line Item Number " + x);
        writer.end("li");
}
writer.end("ul");

> -----Original Message-----
> From: pepone pepone [mailto:[hidden email]]
> Sent: Friday, May 13, 2005 11:15 AM
> To: [hidden email]
> Subject: Components
>
> Hello
> can any body help to understand the renderComponet
>
>
>
> //MENU
>
> public abstract class Menu extends AbstractComponent {
>
> private String name;
> private String style;
>
> protected void renderComponent(IMarkupWriter writer,IRequestCycle
> cycle)
> {
> if(cycle.isRewinding())
> {
> return;
> }
>
> writer.begin("div");
> writer.attribute("class","Menu");
> writer.begin("ul");
>
>                //here i want to begin render Items menu  i don't know how
> do it
>
> writer.end("ul");
> writer.end("div");
> }
> }
>
> How can i do to Items componet begin reder betwenn ul tags or in a
> specific part of the html generated code?
>
> is necesary that items be a property of the menu or can i specific
> items as simple childs componets and set allow-body true?
>
> <div jwcid="@Menu" name="topMenu" style="topmenu">
>             <div jwcid="@ItemMenu" name="Inicio"/>
>             <div jwcid="@ItemMenu" name="Tienda"/>
>             <div jwcid="@ItemMenu" name="Tpv"/>
>             <div jwcid="@ItemMenu" name="Desarrollo Web"/>
>  </div>
>
> Thanks to all
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]