Re: Display a String when null

2008-05-05 Thread Jeremy Thomerson
new PropertyModel(this, > "ipLocationInfo.country"))); > > The country information is sometimes null and then i would like to display > "unknown" instead. Is this easily managed or do i have to change the > country > value of the ipLocationInfo object? > &g

Re: Display a String when null

2008-05-05 Thread Igor Vaynberg
gt; country > >> value of the ipLocationInfo object? > >> > >> Regards Alex > >> > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > >

Re: Display a String when null

2008-05-05 Thread Igor Vaynberg
john's example is better because it is refactorable. my 2c. -igor On Mon, May 5, 2008 at 7:44 AM, Vit Rozkovec <[EMAIL PROTECTED]> wrote: > Hi! > Maybe there is a better way, but I would do: > > >add(new Label("country", new PropertyModel(this, >"ipLocationInfo.country")

Re: Display a String when null

2008-05-05 Thread AlexTM
;> country >> value of the ipLocationInfo object? >> >> Regards Alex >> > > > ------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > &

Re: Display a String when null

2008-05-05 Thread Vit Rozkovec
Hi! Maybe there is a better way, but I would do: add(new Label("country", new PropertyModel(this, "ipLocationInfo.country") { @Override public Object getObject() { String country = (String) super.getObject(); country = coun

Re: Display a String when null

2008-05-05 Thread John Ray
reate your own model. add(new Label("country", new AbstractReadOnlyModel() { public Object getObject() { String country = getIpLocationInfo().getCountry(); if (country != null) return country; else return "Unknown"; } })); --

Display a String when null

2008-05-05 Thread AlexTM
ot;unknown" instead. Is this easily managed or do i have to change the country value of the ipLocationInfo object? Regards Alex -- View this message in context: http://www.nabble.com/Display-a-String-when-null-tp17062912p17062912.html Sent from the Wicket -