java - Wicket TextField with default value -


what elegant way create textfield in wicket rendered default value besides manually setting "value" attribute of component using simpleattributemodifier?

for instance, works:

textfield<string> headline = new textfield<string>("headline", new propertymodel(backingobject, "headline")); headline.add(new simpleattributemodifier("value", "default value")); add(headline); 

but there better way?

propertymodel works both ways. instead of using attribute modifier, change headline so:

backingobject.setheadline("[desired initial text]"); 

you can anywhere, doesn't have after textfield declaration. of course, if don't want touch backingobject beforehand, won't work, i'm going assume that's not issue since didn't mention it.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -