Re: [Wicket-user] Help understanding component creation

2005-11-04 Thread Martijn Dashorst
To quote from the discussion (not the exact wording, but the basic idea):

First we introduce markup parameters (which then need to be parsed,
could become any OGNL expression), then we want conditional markup,
loops in your markup, and finally we end up with Wicket Server Pages:
JSP in another language.

Having the expressions in one place and one place only is one of
Wickets strengths: it is clear, simple and sensible.

Martijn

On 11/4/05, Eelco Hillenius [EMAIL PROTECTED] wrote:
 Though there has been much debate about allowing such markupdriven
 configuration (with me being in favor for allowing it to some extend),
 configuring components like that is not 'the Wicket way'. Rather, you
 would do any configuration in your code. Contrairy to most alternative
 frameworks, Wicket is largely unmanaged, hence you are in charge of
 component and initialization yourself. Thus, you would do:

 MyComponent c = new MyComponent();
 c.setParam1(...)
 c.setXX(..
 add(c);

 To get a better idea, please take a look at Wicket's examples.

 Eelco


 On 11/3/05, David Leangen [EMAIL PROTECTED] wrote:
 
  Hello!
 
  I have read the doc and looked at the examples, but there are still a
  few things that I don't get. Probably, I have the Tapestry approach
  stuck too much in my head...
 
 
  How do I write a component that takes parameters?
 
  This is an example of what I'd like to do:
 
  span wicket:id=myComponent param1=someValue
  param2=ognl:com.package.SomeClass/
 
 
  public class MyPanel
  extends Panel
  {
  private String m_param1;
  private SomeClass m_someClass;
 
  public MyPanel( final String id )
  {
  super( id );
  }
 
  public void setParam1( final String param1 )
  {
  m_param1 = param1;
  }
 
  public String getParam1()
  {
  return m_param1;
  }
 
  public void setSomeClass( final SomeClass someClass )
  {
  m_someClass = someClass;
  }
 
  public SomeClass getSomeClass()
  {
  return m_someClass;
  }
  }
 
 
  Thanks for any advice you can give!
 
 
 
 
 
  ---
  SF.Net email is sponsored by:
  Tame your development challenges with Apache's Geronimo App Server. Download
  it for free - -and be entered to win a 42 plasma tv or your very own
  Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 


 ---
 SF.Net email is sponsored by:
 Tame your development challenges with Apache's Geronimo App Server. Download
 it for free - -and be entered to win a 42 plasma tv or your very own
 Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



--
Living a wicket life...

Martijn Dashorst - http://www.jroller.com/page/dashorst

Wicket 1.1 is out: http://wicket.sourceforge.net/wicket-1.1


---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Help understanding component creation

2005-11-04 Thread Eelco Hillenius
I know the danger. I agree with the danger, and I agree with /not/
implementing it when other people are against. It is just that /I/
think it is powerful to be able to create high level components that
you can add with a single line in your java code, and then configure
the rest in your markup. And that would be the basis of combining it
with wicket:component, so that you put such components in your markup
anywhere you like to circumvent one of the drawbacks of Wicket, namely
that you have to keep your component nesting and markup nesting in
sync.

Again, potentially dangerous, but a powerful tool for the users that
can handle it. We're not especially targetting rooky programmers with
Wicket too.

Eelco

On 11/3/05, Martijn Dashorst [EMAIL PROTECTED] wrote:
 To quote from the discussion (not the exact wording, but the basic idea):

 First we introduce markup parameters (which then need to be parsed,
 could become any OGNL expression), then we want conditional markup,
 loops in your markup, and finally we end up with Wicket Server Pages:
 JSP in another language.

 Having the expressions in one place and one place only is one of
 Wickets strengths: it is clear, simple and sensible.

 Martijn

 On 11/4/05, Eelco Hillenius [EMAIL PROTECTED] wrote:
  Though there has been much debate about allowing such markupdriven
  configuration (with me being in favor for allowing it to some extend),
  configuring components like that is not 'the Wicket way'. Rather, you
  would do any configuration in your code. Contrairy to most alternative
  frameworks, Wicket is largely unmanaged, hence you are in charge of
  component and initialization yourself. Thus, you would do:
 
  MyComponent c = new MyComponent();
  c.setParam1(...)
  c.setXX(..
  add(c);
 
  To get a better idea, please take a look at Wicket's examples.
 
  Eelco
 
 
  On 11/3/05, David Leangen [EMAIL PROTECTED] wrote:
  
   Hello!
  
   I have read the doc and looked at the examples, but there are still a
   few things that I don't get. Probably, I have the Tapestry approach
   stuck too much in my head...
  
  
   How do I write a component that takes parameters?
  
   This is an example of what I'd like to do:
  
   span wicket:id=myComponent param1=someValue
   param2=ognl:com.package.SomeClass/
  
  
   public class MyPanel
   extends Panel
   {
   private String m_param1;
   private SomeClass m_someClass;
  
   public MyPanel( final String id )
   {
   super( id );
   }
  
   public void setParam1( final String param1 )
   {
   m_param1 = param1;
   }
  
   public String getParam1()
   {
   return m_param1;
   }
  
   public void setSomeClass( final SomeClass someClass )
   {
   m_someClass = someClass;
   }
  
   public SomeClass getSomeClass()
   {
   return m_someClass;
   }
   }
  
  
   Thanks for any advice you can give!
  
  
  
  
  
   ---
   SF.Net email is sponsored by:
   Tame your development challenges with Apache's Geronimo App Server. 
   Download
   it for free - -and be entered to win a 42 plasma tv or your very own
   Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
   ___
   Wicket-user mailing list
   Wicket-user@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/wicket-user
  
 
 
  ---
  SF.Net email is sponsored by:
  Tame your development challenges with Apache's Geronimo App Server. Download
  it for free - -and be entered to win a 42 plasma tv or your very own
  Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 


 --
 Living a wicket life...

 Martijn Dashorst - http://www.jroller.com/page/dashorst

 Wicket 1.1 is out: http://wicket.sourceforge.net/wicket-1.1


 ---
 SF.Net email is sponsored by:
 Tame your development challenges with Apache's Geronimo App Server. Download
 it for free - -and be entered to win a 42 plasma tv or your very own
 Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net

[Wicket-user] Help understanding component creation

2005-11-03 Thread David Leangen

Hello!

I have read the doc and looked at the examples, but there are still a
few things that I don't get. Probably, I have the Tapestry approach
stuck too much in my head...


How do I write a component that takes parameters?

This is an example of what I'd like to do:

span wicket:id=myComponent param1=someValue
param2=ognl:com.package.SomeClass/


public class MyPanel
extends Panel
{
private String m_param1;
private SomeClass m_someClass;

public MyPanel( final String id )
{
super( id );
}

public void setParam1( final String param1 )
{
m_param1 = param1;
}

public String getParam1()
{
return m_param1;
}

public void setSomeClass( final SomeClass someClass )
{
m_someClass = someClass;
}

public SomeClass getSomeClass()
{
return m_someClass;
}
}


Thanks for any advice you can give!





---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user