t; label.add(onTag(tag -> if (getModelObject().doubleValue() < 0.0)
> > > >>>> tag.put("class", "negative") ));
> > > >>>
> > > >>> +1
> > > >>>
> > > >>
> > > >> +1
> > > >>
> > > >>>
>
>>>> Sven
> > >>>>
> > >>>>
> > >>>>
> > >>>>> On 31.03.2016 21:16, Martin Grigorov wrote:
> > >>>>>
> > >>>>> Hi,
> > >>>>>
> > >>>>> On Thu, Mar 31, 2016 at 4:29 P
;>>
> >>>>> Hi,
> >>>>>>
> >>>>>> you can access a component's model with #getDefaultModel() or - if
> it
> >> is
> >>>>>> a
> >>>>>> generi
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()
>&
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():
> >>>>
> >
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
, " negative"));
>>>
>>> Since you are in #onComponentTag() there is no reason to add a Behavior.
>> Just use the tag: tag.append("class", "negative", " ");
>>
>>
>> }
>>> }
>>&g
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
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
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
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
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
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
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
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
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
: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
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
18 matches
Mail list logo