no, not exactly. if you havent set a model on the component (or set it to
null) and call getmodel() wicket will search upwards for a model that
implements the compound model interface. look up compound property models on
that wiki page.


Thanks, will do.

One last question:

f) And suppose I have a Label that has to be derived by say some string
> concatenation or formula and OGNL notation will not work.  Will new
> Label("foo", fooModel.getFoo() + "bar")kind of hardcoding conflict in
> some subtle way with the concept of detachable models?


write a simple model

private static class foomodel extends abstractreadonlymodel {
  private final imodel wrapped;
  public foomodel(imodel wrapped) { this.wrapped=wrapped; }
  public object getobject() { return wrapped.getobject()+"bar"; }
  public void detach() { wrapped.detach(); // important }
}

you do this a lot, so it is very helpful to create a superclass of the
above that helps with setting and detaching. i leave that as an excercise to
you.


Can I assume that doing all this may not be worth it if you are only trying
to derive a simple String value to put into a label - so the "hardcoding"
may be okay for most scenarios?
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to