Re: [Wicket-user] styling options of AbstractChoice

2007-05-03 Thread Gerolf Seitz

thx, works like a charm

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


selectoptions is a quick way to do it. if you want total control then put
a repeater into the select and create your own options using selectoption.

-igor


On 5/1/07, Gerolf Seitz [EMAIL PROTECTED] wrote:

 hm, good point.
 but i still see one limitation with SelectOptions:
 how can i add a class attribute with a value depending on the
 option-model.
 i can't seem to achieve this with adding a behavior to SelectOptions,
 since the behavior binds to the wrong component.

 if i missed something, please let me know.

 tia,
   gerolf


 On 5/2/07, Igor Vaynberg [EMAIL PROTECTED]  wrote:
 
  or you can use Select, SelectOption, and SelectOptions in extensions
 
  -igor
 
 
  On 5/1/07, Gerolf Seitz  [EMAIL PROTECTED] wrote:
 
   afaik, there is no way to style options of an AbstractChoice (and
   it's descendants).
   i could imagine 3 ways to add this (although i don't know which
   would be the most wicket-like way)
  
   1) expand IChoiceRenderer
   add methods like String getClass(), String getStyle() to the
   IChoiceRenderer interface.
   this will definitely break existing code, and is probably not the
   best way to go
  
   2) create new interface IStyledChoiceRenderer extending
   IChoiceRenderer
   add the mentioned methods to the new interface.
   things to do in AbstractChoice.appendOptionHtml:
   +check, whether the renderer is instanceof IStyledChoiceRenderer
   +add class and/or style attribute if the returned string is not null
   and length0
  
   3) expand AbstractChoice
   add the mentioned methods (params like the method isDisabled()) to
   the class returning an empty string as the default implementation
   allowing to override these methods if needed.
  
  
   any thoughts from experienced users/devs?
  
   gerolf
  
   p.s.: i should probably add a jira issue.
  
  
   -
   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



-
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


[Wicket-user] styling options of AbstractChoice

2007-05-01 Thread Gerolf Seitz

afaik, there is no way to style options of an AbstractChoice (and it's
descendants).
i could imagine 3 ways to add this (although i don't know which would be the
most wicket-like way)

1) expand IChoiceRenderer
add methods like String getClass(), String getStyle() to the IChoiceRenderer
interface.
this will definitely break existing code, and is probably not the best way
to go

2) create new interface IStyledChoiceRenderer extending IChoiceRenderer
add the mentioned methods to the new interface.
things to do in AbstractChoice.appendOptionHtml:
+check, whether the renderer is instanceof IStyledChoiceRenderer
+add class and/or style attribute if the returned string is not null and
length0

3) expand AbstractChoice
add the mentioned methods (params like the method isDisabled()) to the class
returning an empty string as the default implementation
allowing to override these methods if needed.


any thoughts from experienced users/devs?

gerolf

p.s.: i should probably add a jira issue.
-
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] styling options of AbstractChoice

2007-05-01 Thread Igor Vaynberg

or you can use Select, SelectOption, and SelectOptions in extensions

-igor


On 5/1/07, Gerolf Seitz [EMAIL PROTECTED] wrote:


afaik, there is no way to style options of an AbstractChoice (and it's
descendants).
i could imagine 3 ways to add this (although i don't know which would be
the most wicket-like way)

1) expand IChoiceRenderer
add methods like String getClass(), String getStyle() to the
IChoiceRenderer interface.
this will definitely break existing code, and is probably not the best way
to go

2) create new interface IStyledChoiceRenderer extending IChoiceRenderer
add the mentioned methods to the new interface.
things to do in AbstractChoice.appendOptionHtml:
+check, whether the renderer is instanceof IStyledChoiceRenderer
+add class and/or style attribute if the returned string is not null and
length0

3) expand AbstractChoice
add the mentioned methods (params like the method isDisabled()) to the
class returning an empty string as the default implementation
allowing to override these methods if needed.


any thoughts from experienced users/devs?

gerolf

p.s.: i should probably add a jira issue.

-
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] styling options of AbstractChoice

2007-05-01 Thread Gerolf Seitz

hm, good point.
but i still see one limitation with SelectOptions:
how can i add a class attribute with a value depending on the option-model.
i can't seem to achieve this with adding a behavior to SelectOptions, since
the behavior binds to the wrong component.

if i missed something, please let me know.

tia,
 gerolf


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


or you can use Select, SelectOption, and SelectOptions in extensions

-igor


On 5/1/07, Gerolf Seitz  [EMAIL PROTECTED] wrote:

 afaik, there is no way to style options of an AbstractChoice (and it's
 descendants).
 i could imagine 3 ways to add this (although i don't know which would be
 the most wicket-like way)

 1) expand IChoiceRenderer
 add methods like String getClass(), String getStyle() to the
 IChoiceRenderer interface.
 this will definitely break existing code, and is probably not the best
 way to go

 2) create new interface IStyledChoiceRenderer extending IChoiceRenderer
 add the mentioned methods to the new interface.
 things to do in AbstractChoice.appendOptionHtml:
 +check, whether the renderer is instanceof IStyledChoiceRenderer
 +add class and/or style attribute if the returned string is not null and
 length0

 3) expand AbstractChoice
 add the mentioned methods (params like the method isDisabled()) to the
 class returning an empty string as the default implementation
 allowing to override these methods if needed.


 any thoughts from experienced users/devs?

 gerolf

 p.s.: i should probably add a jira issue.


 -
 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] styling options of AbstractChoice

2007-05-01 Thread Igor Vaynberg

selectoptions is a quick way to do it. if you want total control then put a
repeater into the select and create your own options using selectoption.

-igor


On 5/1/07, Gerolf Seitz [EMAIL PROTECTED] wrote:


hm, good point.
but i still see one limitation with SelectOptions:
how can i add a class attribute with a value depending on the
option-model.
i can't seem to achieve this with adding a behavior to SelectOptions,
since the behavior binds to the wrong component.

if i missed something, please let me know.

tia,
  gerolf


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

 or you can use Select, SelectOption, and SelectOptions in extensions

 -igor


 On 5/1/07, Gerolf Seitz  [EMAIL PROTECTED] wrote:

  afaik, there is no way to style options of an AbstractChoice (and it's
  descendants).
  i could imagine 3 ways to add this (although i don't know which would
  be the most wicket-like way)
 
  1) expand IChoiceRenderer
  add methods like String getClass(), String getStyle() to the
  IChoiceRenderer interface.
  this will definitely break existing code, and is probably not the best
  way to go
 
  2) create new interface IStyledChoiceRenderer extending
  IChoiceRenderer
  add the mentioned methods to the new interface.
  things to do in AbstractChoice.appendOptionHtml:
  +check, whether the renderer is instanceof IStyledChoiceRenderer
  +add class and/or style attribute if the returned string is not null
  and length0
 
  3) expand AbstractChoice
  add the mentioned methods (params like the method isDisabled()) to the
  class returning an empty string as the default implementation
  allowing to override these methods if needed.
 
 
  any thoughts from experienced users/devs?
 
  gerolf
 
  p.s.: i should probably add a jira issue.
 
 
  -
  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


-
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