On 11/17/05, Johan Compagner <[EMAIL PROTECTED]> wrote:
> youre "SmartForms" are just what i described as and Array/List inside a
> button
>  so that a button knows what to valdate when it gets pressed.

Certainly, it is an attempt to generalize this solution. But you're
not fair when you say that it is just the same.

I'll try to code some things and then come back to the list with it.

I would like to be able to have such functionality by coding this as a
SmartForm user:
MyPage.html
....
<form wicket:id="globalForm" ..>
  <!-- Login "logical" "form" -->
  <span wicket:id="loginForm">
    <input type="text" wicket:id="login"/>
    <input type="password" wicket:id="password"/>
    ...
    <input type="button" wicket:id="loginButton"/>
  </span>

  <!-- Search "logical" "form" -->
  <span wicket:id="searchForm">
    <input type="text" wicket:id="searchCriteria"/>
    <input type="button" wicket:id="searchButton"/>
  </span>

  <!-- Main body "logical "form" -->
  <input type="text" wicket:id="globalField"/>
  ...
  <input type="button" wicket:id="globalButton"/>
</form>

MyPage.java
MyPage() {
  ....
  SmartForm globalForm = new SmartForm("globalForm");
  add(globalForm);
  SmartForm loginForm = new SmartForm("loginForm");
  add(loginForm);
  SmartForm searchForm = new SmartForm("searchForm");
  add(searchForm);

  // ... form configuration as usual, maybe use a CompoundPropertyModel ...
  loginForm.add(new TextField("login"));
  loginForm.add(new TextField("password"));
  loginForm.add(new Button("loginButton", "Log In"));

  // Indicate that the loginForm will not participate in the Global
Form validation process
  // So just the "loginButton" will have a validation/model update
action on the loginForm
  loginForm.setPropagateValidation(false);

  // ... same for search Form
  searchForm.add(new TextField("searchCriteria"));
  searchForm.add(new Button("searchButton"), "Search");
  // SearchForm do not participate in global validation
  searchForm.setPropagateValidation(false);

  // Main page form
  globalForm.add(new TextField("globalField"));
  ...
  globalForm.add(new Button("globalButton", "Submit page entries");
}


This would allow great "validation units of work" power, while keeping
it as simple as it is now for common use cases.

What do you think about it ?


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_idv28&alloc_id845&op=click
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to