Re: Getting the model

2016-04-06 Thread Ron Smits
t; label.add(onTag(tag -> if (getModelObject().doubleValue() < 0.0) > > > >>>> tag.put("class", "negative") )); > > > >>> > > > >>> +1 > > > >>> > > > >> > > > >> +1 > > > >> > > > >>> >

Re: Getting the model

2016-04-06 Thread Martin Grigorov
>>>> Sven > > >>>> > > >>>> > > >>>> > > >>>>> On 31.03.2016 21:16, Martin Grigorov wrote: > > >>>>> > > >>>>> Hi, > > >>>>> > > >>>>> On Thu, Mar 31, 2016 at 4:29 P

Re: Getting the model

2016-04-06 Thread Ron Smits
;>> > >>>>> Hi, > >>>>>> > >>>>>> you can access a component's model with #getDefaultModel() or - if > it > >> is > >>>>>> a > >>>>>> generi

Re: Getting the model

2016-04-01 Thread Tobias Soloschenko
ess a component's model with #getDefaultModel() or - if it >> is >>>>>> a >>>>>> generic component - with #getModel(). >>>>>> >>>>>> To properly 'bind' to a model you should delay invocation of >> #getObject() >&

Re: Getting the model

2016-04-01 Thread Martin Grigorov
gt;>> a > >>>> generic component - with #getModel(). > >>>> > >>>> To properly 'bind' to a model you should delay invocation of > #getObject() > >>>> as late as possible, so better overwrite #onComponentTag(): > >>>> > >

Re: Getting the model

2016-04-01 Thread Tobias Soloschenko
if (getModelObject().doubleValue() < 0.0) { >>>> add(new AttributeAppender("class", " negative")); >>>> >>>> Since you are in #onComponentTag() there is no reason to add a Behavior. >>> Just use the

Re: Getting the model

2016-04-01 Thread Martin Grigorov
, " negative")); >>> >>> Since you are in #onComponentTag() there is no reason to add a Behavior. >> Just use the tag: tag.append("class", "negative", " "); >> >> >> } >>> } >>&g

Re: Getting the model

2016-03-31 Thread Sven Meier
s no reason to add a Behavior. Just use the tag: tag.append("class", "negative", " "); } } Have fun Sven On 31.03.2016 16:06, Ron Smits wrote: I have searched but I dont find a clear way of getting the model when one is creating a custom component: public MoneyLabe

Re: Getting the model

2016-03-31 Thread Martin Grigorov
ce you are in #onComponentTag() there is no reason to add a Behavior. Just use the tag: tag.append("class", "negative", " "); > } > } > > > Have fun > Sven > > > > > On 31.03.2016 16:06, Ron Smits wrote: > >> I hav

Re: Getting the model

2016-03-31 Thread Martin Makundi
2016-03-31 17:06 GMT+03:00 Ron Smits <ron.sm...@gmail.com>: > I have searched but I dont find a clear way of getting the model when one > is creating a custom component: > > > public MoneyLabel(String id) { > super(id); > add(new AttributeAppender("cla

Re: Getting the model

2016-03-31 Thread Sven Meier
ComponentTag tag) { if (getModelObject().doubleValue() < 0.0) { add(new AttributeAppender("class", " negative")); } } Have fun Sven On 31.03.2016 16:06, Ron Smits wrote: I have searched but I dont find a clear way of getting the mod

Getting the model

2016-03-31 Thread Ron Smits
I have searched but I dont find a clear way of getting the model when one is creating a custom component: public MoneyLabel(String id) { super(id); add(new AttributeAppender("class", " number")); } public MoneyLabel(String id, Model bigDecimalModel) { super

Image subclass not getting its model object

2010-06-04 Thread Erwin Bolwidt
Hi, I'm trying to make an image subclass that shows an icon. Which icon it shows depends on its model object, which is a boolean. Problem is, I'm not getting the model object: it's always null. If I use a Label instead of InStockIconImage, it works: the label shows a boolean (true/false

Re: Image subclass not getting its model object

2010-06-04 Thread Erwin Bolwidt
depends on its model object, which is a boolean. Problem is, I'm not getting the model object: it's always null. If I use a Label instead of InStockIconImage, it works: the label shows a boolean (true/false). Any idea what could cause this? Thanks, Erwin Here's the icon: public class

Re: Image subclass not getting its model object

2010-06-04 Thread Ernesto Reinaldo Barreiro
a PropertyModel explicitly? Erwin On 6/4/10 9:15 AM, Erwin Bolwidt wrote: Hi, I'm trying to make an image subclass that shows an icon. Which icon it shows depends on its model object, which is a boolean. Problem is,  I'm not getting the model object: it's always null. If I use a Label

Re: Image subclass not getting its model object

2010-06-04 Thread Erwin Bolwidt
is, I'm not getting the model object: it's always null. If I use a Label instead of InStockIconImage, it works: the label shows a boolean (true/false). Any idea what could cause this? Thanks, Erwin Here's the icon: public class InStockIconImage extends Image { private static final String

Re: Image subclass not getting its model object

2010-06-04 Thread James Carman
:15 AM, Erwin Bolwidt wrote: Hi, I'm trying to make an image subclass that shows an icon. Which icon it shows depends on its model object, which is a boolean. Problem is,  I'm not getting the model object: it's always null. If I use a Label instead of InStockIconImage, it works: the label

Re: Image subclass not getting its model object

2010-06-04 Thread Ernesto Reinaldo Barreiro
Hi Erwin, On Fri, Jun 4, 2010 at 1:03 PM, Erwin Bolwidt ebolw...@worldturner.nl wrote: Hi Ernesto, Just got the 1.4.9 source code and I see what you mean. As a rule I always install the source code of any OpenSouce software I use: Javadoc could be wrong or outdated but source code will never