Re: [Wicket-user] Highlander - 1 Template, Some Sub Pages, Many Components

2007-05-16 Thread Fábio Bombonato

   More one doubt, if I want to add more than one component in
these containers, than I need to use a List of components? It´s the best
choice? For example, in my container Header1, I need to put some Panels,
like HeaderPanel(panel), SearchPanel(search), AdsPanel(ads), like,

addToHeader1(new HeaderPanel(panel));
addToHeader1(new SearchPanel(search));
addToHeader1(new AdsPanel(ads));

I need to change the code and insert something like this,

   List Components  list

that´s the idea?

Thanks for any help
Bombonato.

On 5/15/07, Igor Vaynberg [EMAIL PROTECTED] wrote:


youre welcome

-igor


On 5/15/07, Fábio Bombonato [EMAIL PROTECTED] wrote:

 Igor,

   Thanks so much for the fast response. It seems exactly what I
 want. I´ll try to use your examples.

I need to send you a postal card ;-)

 And again, thanks !
 Bombonato.


 On 5/15/07, Igor Vaynberg [EMAIL PROTECTED]  wrote:
 
  class templatepage extends webpage {
 private boolean initialized=false;
 private final RepeatingView header1,content1;
 public templatepage() {
 
  add(header1=new RepeatingView(header1));
  add(header2=new RepeatingView(content1));
  }
 
  protected void addToHeader(Component c) { header1.add(c); }
  protected void addToContent1(Component c) { content1.add(c); }
 
 
  protected abstract initialize();
 
  onBeforeRender() { if (!initialized) { initialize();
  initialized=true; }
  }
 
  templatepage.html
  htmlbody...
  div id=header1div wicket:id=header1/div/div
  div id=header1div wicket:id=content1/div/div
  wicket:child/!-- needed for markup inheritance --
  /body
  /html
 
  class page1 extends templatepage {
initialize() {
addToHeader1(new HeaderPanel(panel));
Fragment f=new Fragment(1,contentfrag);
f.add(new Label(hello,hello));
addToContent1(f);
 }
  }
 
  page1.html
  wicket:extend
 
  wicket:fragment wicket:id=contentfrag
  div wicket:id=hello/div
  /wicket:fragment
 
  /wicket:extend
 
  you can add two types of components into those containers: panels and
  fragments. if you use a fragment then you have to define its markup in the
  page's html.
 
  -igor
 
 
 
   On 5/15/07, Fábio Bombonato [EMAIL PROTECTED] wrote:
 
   Hi Folks,
  
   I´m newbie in Wicket, but until last week I trying to figure out how
   to organize the code and html markup with wicket to get a template page to
   work. Let me explain,
  
   I´m want to create a Template web page that contains markup´s that I
   called containers, for example:
  
   Template.html:
   html
   head
   /head
   body
   div id=header1 wicket:id=header1/div
   div id=content1 wicket:id=content1/div
   div id=content2 wicket:id=content2/div
   /body
   /html
  
   In this containers I could insert many components in each one, or
   simple no one, depends on which web page will use this template.
  
   Than, I create a web page to use the containers of
   theTemplate.html and insert in it the components that I want. For
   example,
  
   MainPage.html
   html
   head
   /head
   body
   div id=header1 wicket:id=header1
  span wicket:id=login/span
   /div
   div id=content1 wicket:id=content1
  span wicket:id=lastNews/span
   /div
   div id=content2 wicket:id=content2
   span wicket:id=blogContent/span
   /div
   /body
   /html
  
   In above example I repeat the Template html code to exemplify the
   situation, however the problem is that I don´t want to repeat the Template
   page all time to create some web page, I want to reuse the template web 
page
   and not repeat that in sub pages. The template page is used for all the
   pages, so it´s easy if the design is centralized in that template page the
   only place that I need to modify that design if I want to change the main
   template page and not in all sub pages. Reading the Maillist, the people
   call this the Dreamweaver centric.
  
   Remembering, the pages that use template could change the components
   used in it. For example:
  
   UserProfilePage.html
   html
   head
   /head
   body
   div id=header1 wicket:id=header1
  span wicket:id=showAd/span
   /div
   div id=content1 wicket:id=content1
  span wicket:id=userProfileDetails/span
   /div
   div id=content2 wicket:id=content2
   span wicket:id=lastUsers/span
   /div
   /body
   /html
  
   Note that all components was changed. So, it´s not the simple
   Header, Content and Footer centric, which header and footer is static, but
   all parts in the containers could be changed. Them, use the markup
   inheritance and wicket:child / it isn´t sufficient, because all content
   could change

Re: [Wicket-user] Highlander - 1 Template, Some Sub Pages, Many Components

2007-05-16 Thread Fábio Bombonato

People, forget about, my mistake. Only need to add the other component by
calling the addToHeader1 (or any other) again with the new panel, like:

addToHeader1(new HeaderPanel(panel));
addToHeader1(new SearchPanel(search) );
addToHeader1(new AdsPanel(ads));

Thanks for everybody e mainly Igor!
Bombonato.


On 5/16/07, Fábio Bombonato [EMAIL PROTECTED] wrote:



More one doubt, if I want to add more than one component in
these containers, than I need to use a List of components? It´s the best
choice? For example, in my container Header1, I need to put some Panels,
like HeaderPanel(panel), SearchPanel(search), AdsPanel(ads), like,

addToHeader1(new HeaderPanel(panel));
addToHeader1(new SearchPanel(search) );
addToHeader1(new AdsPanel(ads));

I need to change the code and insert something like this,

List Components  list

that´s the idea?

Thanks for any help
Bombonato.

On 5/15/07, Igor Vaynberg [EMAIL PROTECTED] wrote:

 youre welcome

 -igor


 On 5/15/07, Fábio Bombonato  [EMAIL PROTECTED] wrote:
 
  Igor,
 
Thanks so much for the fast response. It seems exactly what
  I want. I´ll try to use your examples.
 
 I need to send you a postal card ;-)
 
  And again, thanks !
  Bombonato.
 
 
  On 5/15/07, Igor Vaynberg [EMAIL PROTECTED]  wrote:
  
   class templatepage extends webpage {
  private boolean initialized=false;
  private final RepeatingView header1,content1;
  public templatepage() {
  
   add(header1=new RepeatingView(header1));
   add(header2=new RepeatingView(content1));
   }
  
   protected void addToHeader(Component c) { header1.add(c); }
   protected void addToContent1(Component c) { content1.add(c); }
  
  
   protected abstract initialize();
  
   onBeforeRender() { if (!initialized) { initialize();
   initialized=true; }
   }
  
   templatepage.html
   htmlbody...
   div id=header1div wicket:id=header1/div/div
   div id=header1div wicket:id=content1/div/div
   wicket:child/!-- needed for markup inheritance --
   /body
   /html
  
   class page1 extends templatepage {
 initialize() {
 addToHeader1(new HeaderPanel(panel));
 Fragment f=new Fragment(1,contentfrag);
 f.add(new Label(hello,hello));
 addToContent1(f);
  }
   }
  
   page1.html
   wicket:extend
  
   wicket:fragment wicket:id=contentfrag
   div wicket:id=hello/div
   /wicket:fragment
  
   /wicket:extend
  
   you can add two types of components into those containers: panels
   and fragments. if you use a fragment then you have to define its markup in
   the page's html.
  
   -igor
  
  
  
On 5/15/07, Fábio Bombonato [EMAIL PROTECTED] wrote:
  
Hi Folks,
   
I´m newbie in Wicket, but until last week I trying to figure out
how to organize the code and html markup with wicket to get a template 
page
to work. Let me explain,
   
I´m want to create a Template web page that contains markup´s that
I called containers, for example:
   
Template.html:
html
head
/head
body
div id=header1 wicket:id=header1/div
div id=content1 wicket:id=content1/div
div id=content2 wicket:id=content2/div
/body
/html
   
In this containers I could insert many components in each one,
or simple no one, depends on which web page will use this
template.
   
Than, I create a web page to use the containers of
theTemplate.html and insert in it the components that I want. For
example,
   
MainPage.html
html
head
/head
body
div id=header1 wicket:id=header1
   span wicket:id=login/span
/div
div id=content1 wicket:id=content1
   span wicket:id=lastNews/span
/div
div id=content2 wicket:id=content2
span wicket:id=blogContent/span
/div
/body
/html
   
In above example I repeat the Template html code to exemplify the
situation, however the problem is that I don´t want to repeat the 
Template
page all time to create some web page, I want to reuse the template web 
page
and not repeat that in sub pages. The template page is used for all the
pages, so it´s easy if the design is centralized in that template page 
the
only place that I need to modify that design if I want to change the 
main
template page and not in all sub pages. Reading the Maillist, the people
call this the Dreamweaver centric.
   
Remembering, the pages that use template could change the
components used in it. For example:
   
UserProfilePage.html
html
head
/head
body
div id=header1 wicket:id=header1
   span wicket:id=showAd/span
/div
div id=content1 wicket:id=content1
   span

[Wicket-user] Highlander - 1 Template, Some Sub Pages, Many Components

2007-05-15 Thread Fábio Bombonato

Hi Folks,

I´m newbie in Wicket, but until last week I trying to figure out how to
organize the code and html markup with wicket to get a template page to
work. Let me explain,

I´m want to create a Template web page that contains markup´s that I called
containers, for example:

Template.html:
html
   head
   /head
   body
   div id=header1 wicket:id=header1/div
   div id=content1 wicket:id=content1/div
   div id=content2 wicket:id=content2/div
   /body
/html

In this containers I could insert many components in each one, or simple no
one, depends on which web page will use this template.

Than, I create a web page to use the containers of theTemplate.html and
insert in it the components that I want. For example,

MainPage.html
html
   head
   /head
   body
   div id=header1 wicket:id=header1
  span wicket:id=login/span
   /div
   div id=content1 wicket:id=content1
  span wicket:id=lastNews/span
   /div
   div id=content2 wicket:id=content2
   span wicket:id=blogContent/span
   /div
   /body
/html

In above example I repeat the Template html code to exemplify the situation,
however the problem is that I don´t want to repeat the Template page all
time to create some web page, I want to reuse the template web page and not
repeat that in sub pages. The template page is used for all the pages, so
it´s easy if the design is centralized in that template page the only place
that I need to modify that design if I want to change the main template page
and not in all sub pages. Reading the Maillist, the people call this the
Dreamweaver centric.

Remembering, the pages that use template could change the components used in
it. For example:

UserProfilePage.html
html
   head
   /head
   body
   div id=header1 wicket:id=header1
  span wicket:id=showAd/span
   /div
   div id=content1 wicket:id=content1
  span wicket:id=userProfileDetails/span
   /div
   div id=content2 wicket:id=content2
   span wicket:id=lastUsers/span
   /div
   /body
/html

Note that all components was changed. So, it´s not the simple Header,
Content and Footer centric, which header and footer is static, but all parts
in the containers could be changed. Them, use the markup inheritance and
wicket:child / it isn´t sufficient, because all content could change and
not a specific part (like only the Content part).


Read some topics in Wicket WiKi, I searched and readed many topics in
maillist, like:
Border and markup inheritance problem

http://www.nabble.com/Border-and-markup-inheritance-problem-t1639150.html#a4475258
Inheritance and wicket:child / inside a tag with wicket:id

http://www.nabble.com/Inheritance-and-%3Cwicket%3Achild--%3E-inside-a-tag-with-wicket%3Aid-tf1811521.html#a4936866
More than one wicket:child

http://www.nabble.com/More-than-one-%3Cwicket%3Achild%3E-tf3584957.html#a10017716

I´m little lost ;-), The problem is that I couldn't´t figure out what I need
to use and how implement something to do this. I don´t know if a need to use
wicket Panels, Borders, Fragments or perhaps MarkupContainer. In the end, I
think it´s necessary to group many panels, but I don´t know how.

I really, really appreciate some simple example.

Thanks for any help,
and excuse me for my bad English.
--
Bombonato
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Template Pages and Wicket: Best Way?

2007-05-10 Thread Fábio Bombonato

Hi Everyone,

Well, I´m a newbie in Wicket framework and had some difficulty to figure out
how is the best way to make a template page where all areas defined in this
template could be changed for Pages that use it. I read many topics about
template, layout in mail-list, some examples in Wicket Wiki e some
others of Panels/Borders (
http://www.wicket-wiki.org.uk/wiki/index.php/Panels_and_borders) and the
correct way isn´t clearly for me.

Somebody has any suggestion or example to do this:

For example, if a have a main Template page that define some containers,
like header1, header2, content1:


Template.html:
html
   head
   /head
   body
   div id=mainheader
   !-- Every page could change this content --
   /div

   div id=header1
   !-- Every page could change this content --
   /div

   div id=header2
   !-- Every page could change this content --
   /div

   div id=content3
   !-- Every page could change this content --
   /div

   div id=maincontent
   !-- Every page could change this content --
   /div

   div id=content1
   !-- Every page could change this content --
   /div

   div id=content2
   !-- Every page could change this content --
   /div
   /body
/html



And Pages that use this template and change the contents of this
containers, like:

MainPage.html
html
   head
   /head
   body
   div id=mainheader
   !-- no component here --
   /div

   div id=header1
   !-- My Login Component --
   /div

   div id=header2
   !-- Navigation Component --
   /div

   div id=content3
   !-- Last News Component --
   !-- Blogs Listing Component --
   !-- Last Forum Messages Component --
   /div

   div id=maincontent
   !-- News Component --
   /div

   div id=content1
   !-- Some User News Component --
   /div

   div id=content2
   !-- Search Component --
   !-- Ads Component --
   /div
   /body
/html


And other Page, using the same Template but change the content, like:


SignInPage.html:
html
   head
   /head
   body
   div id=mainheader
   !-- no component here --
   /div

   div id=header1
!-- no component here --
   /div

   div id=header2
   !-- Navigation Component --
   /div

   div id=content3
   !-- Last Registered Users Component --
   /div

   div id=maincontent
   !-- User Sign In Component --
   /div

   div id=content1
   !-- no component here --
   /div

   div id=content2
   !-- Search Component --
   /div
   /body
/html

Thanks for any help!
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user