<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">All,<div><br></div><div>Looking for some ideas/suggestions here (perhaps I am missing a trick here?).</div><div><br></div><div>Wicket binds html layout/styling to Java objects which define the component behaviour:</div><div><div><div><br></div><div><div>public class Home extends WebPage {</div><div><br></div><div><font class="Apple-style-span" color="#FF0000">&nbsp;&nbsp;@In Foo foo;</font></div><div><br></div><div>&nbsp; public Home(final PageParameters parameters) {</div><div>&nbsp; &nbsp; add(new LoginForm("login"));</div><div>&nbsp; }</div><div>}</div><div><br></div><div>is doable, as we use a component instantiation callback (provided by Wicket) to make foo a proxy which asks Seam for the component *every time* the object is accessed. This is pretty ugly though, and I would prefer to use injection/disinjection.</div><div><br></div><div>However, if we want to do:</div><div><br></div><div><div>public class LoginForm extends Form {</div><div>&nbsp; &nbsp; public LoginForm(String id) {</div><div>&nbsp; &nbsp; &nbsp; super(id);</div><div>&nbsp; &nbsp; &nbsp; add(new TextField("username", new PropertyModel(identity, "username")));</div><div>&nbsp; &nbsp; &nbsp; add(new PasswordTextField("password", new PropertyModel(identity, "password")));</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp;&nbsp; &nbsp; &nbsp;</div><div><font class="Apple-style-span" color="#FF0000">&nbsp;&nbsp; &nbsp; &nbsp;@Begin</font></div><div>&nbsp; &nbsp; &nbsp; protected void onSubmit() {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; // Authenticate, and display feedback to user</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>&nbsp; }</div><div>}</div><div><br></div><div>then no lifecycle callback will help.</div><div><br></div><div>As you can see the new operator is used almost exclusively. This means we can't use a proxy based interceptor system. So, AFAICS we have to use byte code enhancement to apply an interceptor, I guess either at compile time or through a custom classloader.</div><div><br></div><div>So,</div><div><br></div><div>1) is it worth it (this is starting to get very fiddly)?</div><div>2) is there a better way?</div><div><br></div><div>Thanks :)</div></div></div></div></div></body></html>