Re: Extending Wicket's Button class to do some extra styling

2010-12-06 Thread Pedro Santos
sure

On Fri, Dec 3, 2010 at 12:21 PM, Stefan Droog sdr...@educator.eu wrote:

 Thanks for your reply but I prefer to add the image and label via

 add(new Image(..,...));
 add(new Label(..,..));

 Instead of replacing the body.

 Is that possible as well?

 Stefan


 2010/12/3 Alexander Morozov alexander.v.moro...@gmail.com

 
 
  class StyledButton extends Button {
 
   public StyledButton(...) {
super();
add(new SimpleAttributeModifier(class, positive));
   }
 
   @Override
   protected void onComponentTagBody(MarkupStream markupStream,
 ComponentTag
  openTag) {
replaceComponentTagBody(markupStream, openTag,  );
   }
 
  }
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Extending-Wicket-s-Button-class-to-do-some-extra-styling-tp3071023p3071104.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 




-- 
Pedro Henrique Oliveira dos Santos


Extending Wicket's Button class to do some extra styling

2010-12-03 Thread Stefan Droog
Hi all,

I want to extend Wicket's Button to do some extra styling (image/etc):

What I want to write in my markup is:

button wicket:id=myButton type=submit class=positive

So my own implementation of the button is responsible for adding the image
and the label.

The expected HTML output should be:

button type=submit class=positive
img src=/images/icons/tick.png/
Save
/button

What is the best approach to do this?

Thanks in advance,

Stefan


Re: Extending Wicket's Button class to do some extra styling

2010-12-03 Thread Alexander Morozov


class StyledButton extends Button {

 public StyledButton(...) {
   super();
   add(new SimpleAttributeModifier(class, positive));
 }

 @Override
 protected void onComponentTagBody(MarkupStream markupStream, ComponentTag
openTag) {
   replaceComponentTagBody(markupStream, openTag,  );
 }

}

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Extending-Wicket-s-Button-class-to-do-some-extra-styling-tp3071023p3071104.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Extending Wicket's Button class to do some extra styling

2010-12-03 Thread Stefan Droog
Thanks for your reply but I prefer to add the image and label via

add(new Image(..,...));
add(new Label(..,..));

Instead of replacing the body.

Is that possible as well?

Stefan


2010/12/3 Alexander Morozov alexander.v.moro...@gmail.com



 class StyledButton extends Button {

  public StyledButton(...) {
   super();
   add(new SimpleAttributeModifier(class, positive));
  }

  @Override
  protected void onComponentTagBody(MarkupStream markupStream, ComponentTag
 openTag) {
   replaceComponentTagBody(markupStream, openTag,  );
  }

 }

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Extending-Wicket-s-Button-class-to-do-some-extra-styling-tp3071023p3071104.html
 Sent from the Users forum mailing list archive at Nabble.com.

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