Modify model value before rendering

2008-06-12 Thread danielepiras

Hi,

I've an object with a boolean properties. I have mapped this object with a
wicket's label using a PropertyModel.
All work's fine but I read in the label true/false. Instead of this value, I
want to see another message (for example User enabled and User not
enabled. How can I do that?

Thank you very much for any help..
Daniele
-- 
View this message in context: 
http://www.nabble.com/Modify-model-value-before-rendering-tp17794855p17794855.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Modify model value before rendering

2008-06-12 Thread Martijn Dashorst
Either use a converter or create an adapter model that takes the
propertymodel and retrieves the nested model object, and returns the
appropriate string.

Martijn

On Thu, Jun 12, 2008 at 10:22 AM, danielepiras
[EMAIL PROTECTED] wrote:

 Hi,

 I've an object with a boolean properties. I have mapped this object with a
 wicket's label using a PropertyModel.
 All work's fine but I read in the label true/false. Instead of this value, I
 want to see another message (for example User enabled and User not
 enabled. How can I do that?

 Thank you very much for any help..
 Daniele
 --
 View this message in context: 
 http://www.nabble.com/Modify-model-value-before-rendering-tp17794855p17794855.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Modify model value before rendering

2008-06-12 Thread richardwilko

something like this might work (untested)

PropertyModel pm = new PropertyModel(this,){
@Override
public Object getObject()
{
return (Boolean) super.getObject() ? User 
enabled : User not
enabled;
}
};





danielepiras wrote:
 
 Hi,
 
 I've an object with a boolean properties. I have mapped this object with a
 wicket's label using a PropertyModel.
 All work's fine but I read in the label true/false. Instead of this value,
 I want to see another message (for example User enabled and User not
 enabled. How can I do that?
 
 Thank you very much for any help..
 Daniele
 

-- 
View this message in context: 
http://www.nabble.com/Modify-model-value-before-rendering-tp17794855p17795114.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Modify model value before rendering

2008-06-12 Thread Igor Vaynberg
or just write your own model in an inner class...

-igor

On Thu, Jun 12, 2008 at 1:45 AM, Martijn Dashorst
[EMAIL PROTECTED] wrote:
 Either use a converter or create an adapter model that takes the
 propertymodel and retrieves the nested model object, and returns the
 appropriate string.

 Martijn

 On Thu, Jun 12, 2008 at 10:22 AM, danielepiras
 [EMAIL PROTECTED] wrote:

 Hi,

 I've an object with a boolean properties. I have mapped this object with a
 wicket's label using a PropertyModel.
 All work's fine but I read in the label true/false. Instead of this value, I
 want to see another message (for example User enabled and User not
 enabled. How can I do that?

 Thank you very much for any help..
 Daniele
 --
 View this message in context: 
 http://www.nabble.com/Modify-model-value-before-rendering-tp17794855p17794855.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.3.3 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]