That was useful although my implementation is like this:

            int loopi = 0;
            for (TimetableEntry entry : timetableEntryFlash) {
                String loopex = loopi == 0 ? "" : ("_" + (loopi - 1));
                if (entry.getOnTime1() == null && entry.getOffTime1() != null) {
                    DummyField dField = new DummyField("fmtOnTime1" + loopex);
                    timetableForm.recordError(dField, "missing on time");
                }
                loopi++;
            }

so that I can validate data across rows as field pairs rather than as 
individual fields. I suspect at this point my time pairs should be a distinct 
component?

John
  ----- Original Message ----- 
  From: Shing Hing Man 
  To: Tapestry users 
  Sent: Wednesday, February 06, 2013 9:49 PM
  Subject: Re: how to recordError against a form field in a loop


  The following example might be useful.


  http://lombok.demon.co.uk/tapestry5Demo/test/crossvalidation

  Shing

  ________________________________
  From: John <j...@quivinco.com>
  To: users@tapestry.apache.org 
  Sent: Wednesday, February 6, 2013 9:28 PM
  Subject: how to recordError against a form field in a loop


  <input maxlength="5" size="5" id="fmtOnTime2_0" name="fmtOnTime2_0" 
type="text">

  How do I do something this in my page class

  void onValidateFromForm() {
  ...
  loop (var X) {
  validation_rule_fail {
  timetableForm.recordError(fmtOnTime2_X, messages.get("errmsg...."));
  }
  }
  } 

  ---------------------------------------------------------------------
  To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
  For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to