Re: [Wicket-user] getVariation and extended panels

2007-05-10 Thread Igor Vaynberg

could you more clearly define what you think the behavior should be, and
what it is now?

-igor


On 5/10/07, Joshua Lim [EMAIL PROTECTED] wrote:


Hi

I have got a SuperPanel class that extends Panel, I have a few variations
of html for this SuperPanel and am overriding the getVariation() method for
to get what I want ...that's all good.

Then I wanted to add a ChildPanel extending SuperPanel. and also I would
like to have ChildPanel to have also a few variations hence giving me more
flexibility in generating dynamic panels as a result...

getVariation() gets resolved at the ChildPanel level only. since
overriding the getVariation on ChildPanel hides SuperPanel.getVariation().

Am I stretching this too far?? :p and should just work with one variation
per component hierarchy

Joshua

-
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


-
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


Re: [Wicket-user] getVariation and extended panels

2007-05-10 Thread Joshua Lim

Ok I'll try...

I was experimenting with the following with 2 panels... bascially
ChildPanel.getVariation() will override the SuperPanel.getVariation() so I
cannot have say a Blue SuperPanel and a Red ChildPanel... which would
then make it possible to have flexible combination of layouts by extending
the panels...

I am not sure if this is the right approach, so would like some advice.
right now I have move to just sticking to 1 variation to 1 hierachy

thanks
Joshua


// SuperPanel //

// SuperPanel.Html

   wicket:panel
   DIV style=border:1px solid #000
   This is Super Panel
   wicket:child/
   /DIV
   /wicket:panel

// SuperPanel_Red.html

   wicket:panel
   DIV style=border:1px solid #F00
   This is Red Super Panel
   wicket:child /
   /DIV
   /wicket:panel

// SuperPanel.java

public class SuperPanel extends Panel
{
   public String getVariation()
   {
   return Red;
   }
}

// ChildPanel //

// ChildPanel.html

   wicket:extend
   DIV style=border:1px solid #000
   This is Child Panel
   /DIV
   /wicket:extend

// ChildPanel_Blue.html

   wicket:extend
   DIV style=border:1px solid #00F
   This is Blue Child Panel
   /DIV
   /wicket:extend

// ChildPanel.java

public class ChildPanel extends SuperPanel
{
   public String getVariation()
   {
   return Blue;
   }
}




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


could you more clearly define what you think the behavior should be, and
what it is now?

-igor


On 5/10/07, Joshua Lim  [EMAIL PROTECTED] wrote:

 Hi

 I have got a SuperPanel class that extends Panel, I have a few
 variations of html for this SuperPanel and am overriding the getVariation()
 method for to get what I want ...that's all good.

 Then I wanted to add a ChildPanel extending SuperPanel. and also I would
 like to have ChildPanel to have also a few variations hence giving me more
 flexibility in generating dynamic panels as a result...

 getVariation() gets resolved at the ChildPanel level only. since
 overriding the getVariation on ChildPanel hides SuperPanel.getVariation
 ().

 Am I stretching this too far?? :p and should just work with one
 variation per component hierarchy

 Joshua


 -
 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



-
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


-
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


Re: [Wicket-user] getVariation()

2006-11-02 Thread Otan
How about this one?public class MyPage extends WebPage {String variant;public MyPage(PageParameters p) {variant = 
p.getString(var);System.out.println(constructor called. The variant is now  + variant);}public String getVariation() {
System.out.println(getVariation() called! The value returned is  + variant);return variant;}}
When I request the page (three times), It prints:getVariation() called! The value returned is nullconstructor called. The variant is now earthgetVariation() called! The value returned is null
constructor called. The variant is now earthgetVariation() called! The value returned is nullconstructor called. The variant is now earth

On 02/11/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
Check that that constructor is actually called, and check that the varparameter returns not null. If that is the case, your code shouldwork.EelcoOn 11/1/06, Otan 
[EMAIL PROTECTED] wrote: Why can't I do this?  public class MyPage extends WebPage { String variant; public MyPage(PageParameters p) { variant = 
p.getString(var); } public String getVariation() { return variant; } }  getVariation() always return null as if 'variant' never get set in the
 constructor. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job
 easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/wicket-user-Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___Wicket-user mailing list
Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] getVariation()

2006-11-02 Thread Johan Compagner
This is because the commomInit() method that is called in the constructor of WebPagealready also gets the markup to test for the body tag .But the strange thing is that this markup is not kept on to. So when rendered it should ask it again
and then the variation is encountered. I dont know why that doesn't happen.The problem still is that then the body thing is wrong (if suddenly the markup is swapped...)johan
On 11/2/06, Otan [EMAIL PROTECTED] wrote:
How about this one?public class MyPage extends WebPage {String variant;public MyPage(PageParameters p) {
variant = 
p.getString(var);System.out.println(constructor called. The variant is now  + variant);}public String getVariation() {

System.out.println(getVariation() called! The value returned is  + variant);return variant;}}
When I request the page (three times), It prints:getVariation() called! The value returned is nullconstructor called. The variant is now earthgetVariation() called! The value returned is null
constructor called. The variant is now earthgetVariation() called! The value returned is nullconstructor called. The variant is now earth

On 02/11/06, Eelco Hillenius 
[EMAIL PROTECTED] wrote:
Check that that constructor is actually called, and check that the varparameter returns not null. If that is the case, your code shouldwork.EelcoOn 11/1/06, Otan 

[EMAIL PROTECTED] wrote: Why can't I do this?  public class MyPage extends WebPage { String variant; public MyPage(PageParameters p) { variant = 
p.getString(var); } public String getVariation() { return variant; } }  getVariation() always return null as if 'variant' never get set in the
 constructor. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job
 easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo 
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
 ___ Wicket-user mailing list 
Wicket-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/wicket-user-Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo

http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___Wicket-user mailing list

Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user


-Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___Wicket-user mailing list
Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] getVariation()

2006-11-02 Thread Eelco Hillenius
Yuck. As a dirty workaround you could create a custom request cycle
that overrides

onBeginRequest() {
  style = getRequest().getParameter(style);
}

and then:

getVariation() {
  return MyRequestCycle.get().getStyle();
}

Haven't tested it, but that should work.

Eelco


On 11/2/06, Johan Compagner [EMAIL PROTECTED] wrote:
 This is because the commomInit() method that is called in the constructor of
 WebPage
 already also gets the markup to test for the body tag .

 But the strange thing is that this markup is not kept on to. So when
 rendered it should ask it again
 and then the variation is encountered. I dont know why that doesn't happen.
 The problem still is that then the body thing is wrong (if suddenly the
 markup is swapped...)

 johan



  On 11/2/06, Otan [EMAIL PROTECTED] wrote:
  How about this one?
  
  public class MyPage extends WebPage {
 
  String variant;
  public MyPage(PageParameters p) {
 
  variant = p.getString(var);
  System.out.println(constructor called. The variant is now  + variant);
  }
  public String getVariation() {
 
  System.out.println(getVariation() called! The value returned is  +
 variant);
 
  return variant;
  }
  }
  
 
  When I request the page (three times), It prints:
 
  getVariation() called! The value returned is null
  constructor called. The variant is now earth
  getVariation() called! The value returned is null
  constructor called. The variant is now earth
  getVariation() called! The value returned is null
  constructor called. The variant is now earth
 
 
 
 
 
  On 02/11/06, Eelco Hillenius  [EMAIL PROTECTED] wrote:
   Check that that constructor is actually called, and check that the var
   parameter returns not null. If that is the case, your code should
   work.
  
   Eelco
  
  
   On 11/1/06, Otan  [EMAIL PROTECTED] wrote:
Why can't I do this?

public class MyPage extends WebPage {
String variant;
public MyPage(PageParameters p) {
variant = p.getString(var);
}
public String getVariation() {
return variant;
}
}

getVariation() always return null as if 'variant' never get set in the
constructor.
   
   
   
 -
Using Tomcat but need to do more? Need to support web services,
 security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache
 Geronimo
   
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
   
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
   
 https://lists.sourceforge.net/lists/listinfo/wicket-user
   
   
   
  
  
 -
   Using Tomcat but need to do more? Need to support web services,
 security?
   Get stuff done quickly with pre-integrated technology to make your job
 easier
   Download IBM WebSphere Application Server v.1.0.1 based on Apache
 Geronimo
  
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
   ___
   Wicket-user mailing list
   Wicket-user@lists.sourceforge.net
  
 https://lists.sourceforge.net/lists/listinfo/wicket-user
  
 
 
 
 -
  Using Tomcat but need to do more? Need to support web services, security?
  Get stuff done quickly with pre-integrated technology to make your job
 easier
  Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
 
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 


 -
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job
 easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642

 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user




-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing 

Re: [Wicket-user] getVariation()

2006-11-02 Thread Otan
Thanks Eelco, this workaround works... but onBeginRequest() {getRequest().getParameter(style);
}doesn't work if the page is mounted. Unfortunately, every page of my webapp is mounted so that I can take advantage of the nice urls. Is there any more workaround to make getVariation() return a value from a page parameter?
On 03/11/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
Yuck. As a dirty workaround you could create a custom request cyclethat overridesonBeginRequest() {style = getRequest().getParameter(style);}and then:getVariation() {
return MyRequestCycle.get().getStyle();}Haven't tested it, but that should work.EelcoOn 11/2/06, Johan Compagner [EMAIL PROTECTED] wrote:
 This is because the commomInit() method that is called in the constructor of WebPage already also gets the markup to test for the body tag . But the strange thing is that this markup is not kept on to. So when
 rendered it should ask it again and then the variation is encountered. I dont know why that doesn't happen. The problem still is that then the body thing is wrong (if suddenly the markup is swapped...)
 johanOn 11/2/06, Otan [EMAIL PROTECTED] wrote:  How about this one?  
  public class MyPage extends WebPage {   String variant;  public MyPage(PageParameters p) {   variant = p.getString(var);  System.out.println
(constructor called. The variant is now  + variant);  }  public String getVariation() {   System.out.println(getVariation() called! The value returned is  +
 variant);   return variant;  }  }     When I request the page (three times), It prints: 
  getVariation() called! The value returned is null  constructor called. The variant is now earth  getVariation() called! The value returned is null  constructor called. The variant is now earth
  getVariation() called! The value returned is null  constructor called. The variant is now earth   On 02/11/06, Eelco Hillenius  
[EMAIL PROTECTED] wrote:   Check that that constructor is actually called, and check that the var   parameter returns not null. If that is the case, your code should
   work. Eelco   On 11/1/06, Otan  [EMAIL PROTECTED] wrote:
Why can't I do this?public class MyPage extends WebPage {String variant;public MyPage(PageParameters p) {
variant = p.getString(var);}public String getVariation() {return variant;}}
getVariation() always return null as if 'variant' never get set in theconstructor.  
-Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job
easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642   ___Wicket-user mailing list
Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user
  -   Using Tomcat but need to do more? Need to support web services,
 security?   Get stuff done quickly with pre-integrated technology to make your job easier   Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
   http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642   ___
   Wicket-user mailing list   Wicket-user@lists.sourceforge.net   
https://lists.sourceforge.net/lists/listinfo/wicket-user  -  Using Tomcat but need to do more? Need to support web services, security?
  Get stuff done quickly with pre-integrated technology to make your job easier  Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo  
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642   ___  Wicket-user mailing list  
Wicket-user@lists.sourceforge.net  https://lists.sourceforge.net/lists/listinfo/wicket-user   
 - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job
 easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/wicket-user-Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to 

Re: [Wicket-user] getVariation()

2006-11-02 Thread Igor Vaynberg
getRequest().getRequestParameters().getParameter(style) -igorOn 11/2/06, Otan [EMAIL PROTECTED]
 wrote:Thanks Eelco, this workaround works... but 
onBeginRequest() {getRequest().getParameter(style);
}doesn't work if the page is mounted. Unfortunately, every page of my webapp is mounted so that I can take advantage of the nice urls. Is there any more workaround to make getVariation() return a value from a page parameter?
On 03/11/06, Eelco Hillenius 
[EMAIL PROTECTED] wrote:
Yuck. As a dirty workaround you could create a custom request cyclethat overridesonBeginRequest() {style = getRequest().getParameter(style);}and then:getVariation() {
return MyRequestCycle.get().getStyle();}Haven't tested it, but that should work.EelcoOn 11/2/06, Johan Compagner 
[EMAIL PROTECTED] wrote:
 This is because the commomInit() method that is called in the constructor of WebPage already also gets the markup to test for the body tag . But the strange thing is that this markup is not kept on to. So when
 rendered it should ask it again and then the variation is encountered. I dont know why that doesn't happen. The problem still is that then the body thing is wrong (if suddenly the markup is swapped...)
 johanOn 11/2/06, Otan [EMAIL PROTECTED] wrote:
  How about this one?  
  public class MyPage extends WebPage {   String variant;  public MyPage(PageParameters p) {   variant = p.getString(var);  
System.out.println
(constructor called. The variant is now  + variant);  }  public String getVariation() {   System.out.println(getVariation() called! The value returned is  +
 variant);   return variant;  }  }     When I request the page (three times), It prints: 
  getVariation() called! The value returned is null  constructor called. The variant is now earth  getVariation() called! The value returned is null  constructor called. The variant is now earth
  getVariation() called! The value returned is null  constructor called. The variant is now earth   On 02/11/06, Eelco Hillenius  
[EMAIL PROTECTED] wrote:   Check that that constructor is actually called, and check that the var
   parameter returns not null. If that is the case, your code should
   work. Eelco   On 11/1/06, Otan  
[EMAIL PROTECTED] wrote:
Why can't I do this?public class MyPage extends WebPage {String variant;public MyPage(PageParameters p) {
variant = p.getString(var);}public String getVariation() {return variant;}}
getVariation() always return null as if 'variant' never get set in theconstructor.  
-Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job
easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo

http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642   ___Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
  -   Using Tomcat but need to do more? Need to support web services,
 security?   Get stuff done quickly with pre-integrated technology to make your job easier   Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
   http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
   ___
   Wicket-user mailing list   Wicket-user@lists.sourceforge.net
   
https://lists.sourceforge.net/lists/listinfo/wicket-user  -  Using Tomcat but need to do more? Need to support web services, security?
  Get stuff done quickly with pre-integrated technology to make your job easier  Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo  

http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642   ___  Wicket-user mailing list  

Wicket-user@lists.sourceforge.net  https://lists.sourceforge.net/lists/listinfo/wicket-user
   
 - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job
 easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo 
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
 ___ Wicket-user mailing list 
Wicket-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/wicket-user-Using Tomcat 

Re: [Wicket-user] getVariation()

2006-11-02 Thread Otan
there is no getParameter(string) method in wicket.request.RequestParametersBy the way, since I cannot rely on getVariation() to return the result of the per request condition (because I'm now forced to use some data persisted in session to make it work), I realized that I should use 
Session.setStyle() instead. Now I wonder, what usecase getVariation() really good for?On 03/11/06, Igor Vaynberg 

[EMAIL PROTECTED] wrote:getRequest().getRequestParameters().getParameter(style) 
-igorOn 11/2/06, Otan 

[EMAIL PROTECTED]
 wrote:Thanks Eelco, this workaround works... but 


onBeginRequest() {getRequest().getParameter(style);
}doesn't work if the page is mounted. Unfortunately, every page of my webapp is mounted so that I can take advantage of the nice urls. Is there any more workaround to make getVariation() return a value from a page parameter?
On 03/11/06, Eelco Hillenius 


[EMAIL PROTECTED] wrote:
Yuck. As a dirty workaround you could create a custom request cyclethat overridesonBeginRequest() {style = getRequest().getParameter(style);}and then:getVariation() {
return MyRequestCycle.get().getStyle();}Haven't tested it, but that should work.EelcoOn 11/2/06, Johan Compagner 


[EMAIL PROTECTED] wrote:
 This is because the commomInit() method that is called in the constructor of WebPage already also gets the markup to test for the body tag . But the strange thing is that this markup is not kept on to. So when
 rendered it should ask it again and then the variation is encountered. I dont know why that doesn't happen. The problem still is that then the body thing is wrong (if suddenly the markup is swapped...)
 johanOn 11/2/06, Otan [EMAIL PROTECTED] wrote:
  How about this one?  
  public class MyPage extends WebPage {   String variant;  public MyPage(PageParameters p) {   variant = p.getString(var);  
System.out.println
(constructor called. The variant is now  + variant);  }  public String getVariation() {   System.out.println(getVariation() called! The value returned is  +
 variant);   return variant;  }  }     When I request the page (three times), It prints: 
  getVariation() called! The value returned is null  constructor called. The variant is now earth  getVariation() called! The value returned is null  constructor called. The variant is now earth
  getVariation() called! The value returned is null  constructor called. The variant is now earth   On 02/11/06, Eelco Hillenius  
[EMAIL PROTECTED] wrote:   Check that that constructor is actually called, and check that the var
   parameter returns not null. If that is the case, your code should
   work. Eelco   On 11/1/06, Otan  


[EMAIL PROTECTED] wrote:
Why can't I do this?public class MyPage extends WebPage {String variant;public MyPage(PageParameters p) {
variant = p.getString(var);}public String getVariation() {return variant;}}
getVariation() always return null as if 'variant' never get set in theconstructor.  
-Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job
easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo



http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642   ___Wicket-user mailing list
Wicket-user@lists.sourceforge.net


https://lists.sourceforge.net/lists/listinfo/wicket-user
  -   Using Tomcat but need to do more? Need to support web services,
 security?   Get stuff done quickly with pre-integrated technology to make your job easier   Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
   http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
   ___
   Wicket-user mailing list   Wicket-user@lists.sourceforge.net


   
https://lists.sourceforge.net/lists/listinfo/wicket-user  -  Using Tomcat but need to do more? Need to support web services, security?
  Get stuff done quickly with pre-integrated technology to make your job easier  Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo  



http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642   ___  Wicket-user mailing list  



Wicket-user@lists.sourceforge.net  https://lists.sourceforge.net/lists/listinfo/wicket-user
   
 - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with 

Re: [Wicket-user] getVariation()

2006-11-02 Thread Igor Vaynberg
On 11/2/06, Otan [EMAIL PROTECTED] wrote:
there is no getParameter(string) method in wicket.request.RequestParametersyou know, you could spend a little bit of the time and explore the api. there is no getParameter(String), but there is a Map getParameters()
By the way, since I cannot rely on getVariation() to return the result of the per request condition (because I'm now forced to use some data persisted in session to make it work), I realized that I should use 
Session.setStyle() instead. Now I wonder, what usecase getVariation() really good for?variation is per component instance, style is per session instance. two different scopes.-igor
On 03/11/06, 
Igor Vaynberg 

[EMAIL PROTECTED] wrote:getRequest().getRequestParameters().getParameter(style) 
-igorOn 11/2/06, Otan 


[EMAIL PROTECTED]
 wrote:Thanks Eelco, this workaround works... but 



onBeginRequest() {getRequest().getParameter(style);
}doesn't work if the page is mounted. Unfortunately, every page of my webapp is mounted so that I can take advantage of the nice urls. Is there any more workaround to make getVariation() return a value from a page parameter?
On 03/11/06, Eelco Hillenius 



[EMAIL PROTECTED] wrote:
Yuck. As a dirty workaround you could create a custom request cyclethat overridesonBeginRequest() {style = getRequest().getParameter(style);}and then:getVariation() {
return MyRequestCycle.get().getStyle();}Haven't tested it, but that should work.EelcoOn 11/2/06, Johan Compagner 



[EMAIL PROTECTED] wrote:
 This is because the commomInit() method that is called in the constructor of WebPage already also gets the markup to test for the body tag . But the strange thing is that this markup is not kept on to. So when
 rendered it should ask it again and then the variation is encountered. I dont know why that doesn't happen. The problem still is that then the body thing is wrong (if suddenly the markup is swapped...)
 johanOn 11/2/06, Otan [EMAIL PROTECTED] wrote:
  How about this one?  
  public class MyPage extends WebPage {   String variant;  public MyPage(PageParameters p) {   variant = p.getString(var);  
System.out.println
(constructor called. The variant is now  + variant);  }  public String getVariation() {   System.out.println(getVariation() called! The value returned is  +
 variant);   return variant;  }  }     When I request the page (three times), It prints: 
  getVariation() called! The value returned is null  constructor called. The variant is now earth  getVariation() called! The value returned is null  constructor called. The variant is now earth
  getVariation() called! The value returned is null  constructor called. The variant is now earth   On 02/11/06, Eelco Hillenius  
[EMAIL PROTECTED] wrote:   Check that that constructor is actually called, and check that the var
   parameter returns not null. If that is the case, your code should
   work. Eelco   On 11/1/06, Otan  



[EMAIL PROTECTED] wrote:
Why can't I do this?public class MyPage extends WebPage {String variant;public MyPage(PageParameters p) {
variant = p.getString(var);}public String getVariation() {return variant;}}
getVariation() always return null as if 'variant' never get set in theconstructor.  
-Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job
easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo




http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642   ___Wicket-user mailing list
Wicket-user@lists.sourceforge.net



https://lists.sourceforge.net/lists/listinfo/wicket-user
  -   Using Tomcat but need to do more? Need to support web services,
 security?   Get stuff done quickly with pre-integrated technology to make your job easier   Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
   http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
   ___
   Wicket-user mailing list   Wicket-user@lists.sourceforge.net



   
https://lists.sourceforge.net/lists/listinfo/wicket-user  -  Using Tomcat but need to do more? Need to support web services, security?
  Get stuff done quickly with pre-integrated technology to make your job easier  Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo  




http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642   ___  Wicket-user mailing 

Re: [Wicket-user] getVariation()

2006-11-01 Thread Eelco Hillenius
Check that that constructor is actually called, and check that the var
parameter returns not null. If that is the case, your code should
work.

Eelco


On 11/1/06, Otan [EMAIL PROTECTED] wrote:
 Why can't I do this?
 
 public class MyPage extends WebPage {
 String variant;
 public MyPage(PageParameters p) {
 variant = p.getString(var);
 }
 public String getVariation() {
 return variant;
 }
 }
 
 getVariation() always return null as if 'variant' never get set in the
 constructor.


 -
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job
 easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642

 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user




-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user