Re: Page composition question

2009-02-11 Thread Igor Vaynberg
then simply change Panel to Fragment, and keep the entire html in one place.

-igor

On Wed, Feb 11, 2009 at 12:37 AM, uwe janner  wrote:
> thx igor!
>
> but i still cant see how i can define the subPanels.
>
> in facelets, in the parent i would have written:
>name="specialInfo"/>  
>
> then there would be 5 different childs, each one defining the 3
> html-snippets:
> 
> .
>
> that means, the parent knows, somebody of his children has defined a snippet
> for "detailInfo", and this will be inserted at the 
> and so the three snippets can stay within the same file, e.g. in a
> "SimpleCustomerDetails.xhtml"
>
> and in wicket?
>
> i see how i would construct 3 different panels ( newpanel1,2 and 3 in your
> example) within the child class extending parentpanel - but every panel i
> create in the overwritten methods needs its own html file, doesnt it?
> that means, for one of the 5 types of customers i would have to write 3
> panels, one for each of the 3 parts:
> SimpleCustomerDetailInfoPanel.html, SimpleCustomerSpecialInfoPanel.html,
> SimpleCustomerAdditionalInfoPanel.html,
> then 3 for VipCustomerDetailInfoPanel.html, and so on, ending up with 15
> different html files.
>
> i still dont see the way how i can put e.g.
> SimpleCustomerDetailInfoPanel.html, SimpleCustomerSpecialInfoPanel.html and
> SimpleCustomerAdditionalInfoPanel.html into one html file (as i can do it
> with facelets above), thereby reducing the nr of html files to 5. the 3
> parts belong together.
>
> thx4anyhint, uwe!
>
>
>
> On Wed, Feb 11, 2009 at 2:34 AM, Igor Vaynberg wrote:
>
>> class abstract parentpanel extends panel {
>>  private panel panel1, panel2, panel3;
>>
>>  protected abstract panel newpanel1(string id, imodel model);
>>  protected abstract panel newpanel2(string id, imodel model);
>>  protected abstract panel newpanel3(string id, imodel model);
>>
>>  protected void onbeforerender() {
>>if (panel1==null) {
>>  add(panel1=newpanel1("p1", getdefaultmodel());
>>  add(panel2=newpanel1("p2", getdefaultmodel());
>>  add(panel3=newpanel1("p3", getdefaultmodel());
>>   }
>>  super.onbeforerender();
>>   }
>> }
>>
>> -igor
>>
>> On Tue, Feb 10, 2009 at 4:46 PM, uwe janner 
>> wrote:
>> > dear wicketeers,
>> >
>> > i'm facing a problem with page composition where i cant find an elegant
>> > solution; i hope i can explain it comprehensible:
>> >
>> > i have a panel named CustomerInfo.
>> >
>> > there are 5 types of customers in the application.
>> >
>> > most of the CustomerInfo.html is the same for all types of customers -
>> > except three div's:
>> > DetailInfo, SpecialInfo and AdditionalInfo
>> >
>> > these two div's contain different html and different components for each
>> > type of customer;
>> >
>> > one way would be to create 15 different panels (DetailInfoCustomerType1,
>> > DetailInfoCustomerType2, DetailInfoCustomerType3, ,
>> > SpecialInfoCustomerType1, .)
>> > then, in CustomerInfo-panel i would include the right 3 panels depending
>> on
>> > the customer type, e.g. (DetailInfoCustomerType1,
>> SpecialInfoCustomerType1,
>> > AdditionalInfoCustomerType1);
>> >
>> > ok, its no good idea to have 15 separate panels, i want to group the 3
>> > html-snippets together (Detail, Special, Additional)
>> >
>> > how can i achieve this? as i understood, neither panels, nor fragments
>> nor
>> > borders can be used for this.
>> > how could a parent container ( "CustomerInfo" ) fill 3 different areas
>> (the
>> > 3 div's) with 3 different fragments of a child (e.g.
>> > DetailInfoCustomerType2, SpecialInfoCustomerType2,
>> > AdditionalInfoCustomerType2)?
>> >
>> > if the 3 different areas were contiguous/adjacent i could use simple page
>> > inheritance, bc then the parent container pulls out the whole child's
>> > content with  .
>> >
>> > in my case i needed sth like 
>> .> > html/>... .> > html/>... .
>> > where with  the parent would only include the
>> part
>> > of the child with wicket:id "xxx"
>> >
>> > thxinadvance,uwe!
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Page composition question

2009-02-11 Thread Thomas Mäder
Hi Uwe,

what is not clear is: are the detail info panels different for each of the 5
customer infos? Then you really would have 15 different html markups for the
5x3 panels? Or are the 3 panel kinds (special, detail, or additiional)
always the same, but appear (or not) for the different customer info types?
If you have 15 different html markups, you'll have to implement 15 different
panels. What's the problem with that? Chuck it in it's own package and
forget it.

Thomas

On Wed, Feb 11, 2009 at 9:37 AM, uwe janner  wrote:

> thx igor!
>
> but i still cant see how i can define the subPanels.
>
> in facelets, in the parent i would have written:
>name="specialInfo"/>  
>
> then there would be 5 different childs, each one defining the 3
> html-snippets:
> 
> .
>
> that means, the parent knows, somebody of his children has defined a
> snippet
> for "detailInfo", and this will be inserted at the 
> and so the three snippets can stay within the same file, e.g. in a
> "SimpleCustomerDetails.xhtml"
>
> and in wicket?
>
> i see how i would construct 3 different panels ( newpanel1,2 and 3 in your
> example) within the child class extending parentpanel - but every panel i
> create in the overwritten methods needs its own html file, doesnt it?
> that means, for one of the 5 types of customers i would have to write 3
> panels, one for each of the 3 parts:
> SimpleCustomerDetailInfoPanel.html, SimpleCustomerSpecialInfoPanel.html,
> SimpleCustomerAdditionalInfoPanel.html,
> then 3 for VipCustomerDetailInfoPanel.html, and so on, ending up with
> 15
> different html files.
>
> i still dont see the way how i can put e.g.
> SimpleCustomerDetailInfoPanel.html, SimpleCustomerSpecialInfoPanel.html and
> SimpleCustomerAdditionalInfoPanel.html into one html file (as i can do it
> with facelets above), thereby reducing the nr of html files to 5. the 3
> parts belong together.
>
> thx4anyhint, uwe!
>
>
>
> On Wed, Feb 11, 2009 at 2:34 AM, Igor Vaynberg  >wrote:
>
> > class abstract parentpanel extends panel {
> >  private panel panel1, panel2, panel3;
> >
> >  protected abstract panel newpanel1(string id, imodel model);
> >  protected abstract panel newpanel2(string id, imodel model);
> >  protected abstract panel newpanel3(string id, imodel model);
> >
> >  protected void onbeforerender() {
> >if (panel1==null) {
> >  add(panel1=newpanel1("p1", getdefaultmodel());
> >  add(panel2=newpanel1("p2", getdefaultmodel());
> >  add(panel3=newpanel1("p3", getdefaultmodel());
> >   }
> >  super.onbeforerender();
> >   }
> > }
> >
> > -igor
> >
> > On Tue, Feb 10, 2009 at 4:46 PM, uwe janner 
> > wrote:
> > > dear wicketeers,
> > >
> > > i'm facing a problem with page composition where i cant find an elegant
> > > solution; i hope i can explain it comprehensible:
> > >
> > > i have a panel named CustomerInfo.
> > >
> > > there are 5 types of customers in the application.
> > >
> > > most of the CustomerInfo.html is the same for all types of customers -
> > > except three div's:
> > > DetailInfo, SpecialInfo and AdditionalInfo
> > >
> > > these two div's contain different html and different components for
> each
> > > type of customer;
> > >
> > > one way would be to create 15 different panels
> (DetailInfoCustomerType1,
> > > DetailInfoCustomerType2, DetailInfoCustomerType3, ,
> > > SpecialInfoCustomerType1, .)
> > > then, in CustomerInfo-panel i would include the right 3 panels
> depending
> > on
> > > the customer type, e.g. (DetailInfoCustomerType1,
> > SpecialInfoCustomerType1,
> > > AdditionalInfoCustomerType1);
> > >
> > > ok, its no good idea to have 15 separate panels, i want to group the 3
> > > html-snippets together (Detail, Special, Additional)
> > >
> > > how can i achieve this? as i understood, neither panels, nor fragments
> > nor
> > > borders can be used for this.
> > > how could a parent container ( "CustomerInfo" ) fill 3 different areas
> > (the
> > > 3 div's) with 3 different fragments of a child (e.g.
> > > DetailInfoCustomerType2, SpecialInfoCustomerType2,
> > > AdditionalInfoCustomerType2)?
> > >
> > > if the 3 different areas were contiguous/adjacent i could use simple
> page
> > > inheritance, bc then the parent container pulls out the whole child's
> > > content with  .
> > >
> > > in my case i needed sth like 
> > . > > html/>... . > > html/>... .
> > > where with  the parent would only include the
> > part
> > > of the child with wicket:id "xxx"
> > >
> > > thxinadvance,uwe!
> > >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>



-- 
Thomas Mäder
Wicket & Eclipse Consulting
www.devotek-it.ch


Re: Page composition question

2009-02-11 Thread uwe janner
thx igor!

but i still cant see how i can define the subPanels.

in facelets, in the parent i would have written:


then there would be 5 different childs, each one defining the 3
html-snippets:

.

that means, the parent knows, somebody of his children has defined a snippet
for "detailInfo", and this will be inserted at the 
and so the three snippets can stay within the same file, e.g. in a
"SimpleCustomerDetails.xhtml"

and in wicket?

i see how i would construct 3 different panels ( newpanel1,2 and 3 in your
example) within the child class extending parentpanel - but every panel i
create in the overwritten methods needs its own html file, doesnt it?
that means, for one of the 5 types of customers i would have to write 3
panels, one for each of the 3 parts:
SimpleCustomerDetailInfoPanel.html, SimpleCustomerSpecialInfoPanel.html,
SimpleCustomerAdditionalInfoPanel.html,
then 3 for VipCustomerDetailInfoPanel.html, and so on, ending up with 15
different html files.

i still dont see the way how i can put e.g.
SimpleCustomerDetailInfoPanel.html, SimpleCustomerSpecialInfoPanel.html and
SimpleCustomerAdditionalInfoPanel.html into one html file (as i can do it
with facelets above), thereby reducing the nr of html files to 5. the 3
parts belong together.

thx4anyhint, uwe!



On Wed, Feb 11, 2009 at 2:34 AM, Igor Vaynberg wrote:

> class abstract parentpanel extends panel {
>  private panel panel1, panel2, panel3;
>
>  protected abstract panel newpanel1(string id, imodel model);
>  protected abstract panel newpanel2(string id, imodel model);
>  protected abstract panel newpanel3(string id, imodel model);
>
>  protected void onbeforerender() {
>if (panel1==null) {
>  add(panel1=newpanel1("p1", getdefaultmodel());
>  add(panel2=newpanel1("p2", getdefaultmodel());
>  add(panel3=newpanel1("p3", getdefaultmodel());
>   }
>  super.onbeforerender();
>   }
> }
>
> -igor
>
> On Tue, Feb 10, 2009 at 4:46 PM, uwe janner 
> wrote:
> > dear wicketeers,
> >
> > i'm facing a problem with page composition where i cant find an elegant
> > solution; i hope i can explain it comprehensible:
> >
> > i have a panel named CustomerInfo.
> >
> > there are 5 types of customers in the application.
> >
> > most of the CustomerInfo.html is the same for all types of customers -
> > except three div's:
> > DetailInfo, SpecialInfo and AdditionalInfo
> >
> > these two div's contain different html and different components for each
> > type of customer;
> >
> > one way would be to create 15 different panels (DetailInfoCustomerType1,
> > DetailInfoCustomerType2, DetailInfoCustomerType3, ,
> > SpecialInfoCustomerType1, .)
> > then, in CustomerInfo-panel i would include the right 3 panels depending
> on
> > the customer type, e.g. (DetailInfoCustomerType1,
> SpecialInfoCustomerType1,
> > AdditionalInfoCustomerType1);
> >
> > ok, its no good idea to have 15 separate panels, i want to group the 3
> > html-snippets together (Detail, Special, Additional)
> >
> > how can i achieve this? as i understood, neither panels, nor fragments
> nor
> > borders can be used for this.
> > how could a parent container ( "CustomerInfo" ) fill 3 different areas
> (the
> > 3 div's) with 3 different fragments of a child (e.g.
> > DetailInfoCustomerType2, SpecialInfoCustomerType2,
> > AdditionalInfoCustomerType2)?
> >
> > if the 3 different areas were contiguous/adjacent i could use simple page
> > inheritance, bc then the parent container pulls out the whole child's
> > content with  .
> >
> > in my case i needed sth like 
> . > html/>... . > html/>... .
> > where with  the parent would only include the
> part
> > of the child with wicket:id "xxx"
> >
> > thxinadvance,uwe!
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Page composition question

2009-02-10 Thread Igor Vaynberg
class abstract parentpanel extends panel {
  private panel panel1, panel2, panel3;

  protected abstract panel newpanel1(string id, imodel model);
  protected abstract panel newpanel2(string id, imodel model);
  protected abstract panel newpanel3(string id, imodel model);

  protected void onbeforerender() {
if (panel1==null) {
  add(panel1=newpanel1("p1", getdefaultmodel());
  add(panel2=newpanel1("p2", getdefaultmodel());
  add(panel3=newpanel1("p3", getdefaultmodel());
   }
  super.onbeforerender();
   }
}

-igor

On Tue, Feb 10, 2009 at 4:46 PM, uwe janner  wrote:
> dear wicketeers,
>
> i'm facing a problem with page composition where i cant find an elegant
> solution; i hope i can explain it comprehensible:
>
> i have a panel named CustomerInfo.
>
> there are 5 types of customers in the application.
>
> most of the CustomerInfo.html is the same for all types of customers -
> except three div's:
> DetailInfo, SpecialInfo and AdditionalInfo
>
> these two div's contain different html and different components for each
> type of customer;
>
> one way would be to create 15 different panels (DetailInfoCustomerType1,
> DetailInfoCustomerType2, DetailInfoCustomerType3, ,
> SpecialInfoCustomerType1, .)
> then, in CustomerInfo-panel i would include the right 3 panels depending on
> the customer type, e.g. (DetailInfoCustomerType1, SpecialInfoCustomerType1,
> AdditionalInfoCustomerType1);
>
> ok, its no good idea to have 15 separate panels, i want to group the 3
> html-snippets together (Detail, Special, Additional)
>
> how can i achieve this? as i understood, neither panels, nor fragments nor
> borders can be used for this.
> how could a parent container ( "CustomerInfo" ) fill 3 different areas (the
> 3 div's) with 3 different fragments of a child (e.g.
> DetailInfoCustomerType2, SpecialInfoCustomerType2,
> AdditionalInfoCustomerType2)?
>
> if the 3 different areas were contiguous/adjacent i could use simple page
> inheritance, bc then the parent container pulls out the whole child's
> content with  .
>
> in my case i needed sth like  . html/>... . html/>... .
> where with  the parent would only include the part
> of the child with wicket:id "xxx"
>
> thxinadvance,uwe!
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Page composition question

2009-02-10 Thread uwe janner
dear wicketeers,

i'm facing a problem with page composition where i cant find an elegant
solution; i hope i can explain it comprehensible:

i have a panel named CustomerInfo.

there are 5 types of customers in the application.

most of the CustomerInfo.html is the same for all types of customers -
except three div's:
DetailInfo, SpecialInfo and AdditionalInfo

these two div's contain different html and different components for each
type of customer;

one way would be to create 15 different panels (DetailInfoCustomerType1,
DetailInfoCustomerType2, DetailInfoCustomerType3, ,
SpecialInfoCustomerType1, .)
then, in CustomerInfo-panel i would include the right 3 panels depending on
the customer type, e.g. (DetailInfoCustomerType1, SpecialInfoCustomerType1,
AdditionalInfoCustomerType1);

ok, its no good idea to have 15 separate panels, i want to group the 3
html-snippets together (Detail, Special, Additional)

how can i achieve this? as i understood, neither panels, nor fragments nor
borders can be used for this.
how could a parent container ( "CustomerInfo" ) fill 3 different areas (the
3 div's) with 3 different fragments of a child (e.g.
DetailInfoCustomerType2, SpecialInfoCustomerType2,
AdditionalInfoCustomerType2)?

if the 3 different areas were contiguous/adjacent i could use simple page
inheritance, bc then the parent container pulls out the whole child's
content with  .

in my case i needed sth like    .
where with  the parent would only include the part
of the child with wicket:id "xxx"

thxinadvance,uwe!