Thanks, this looks pretty nice. I think I might be able to provide some 
feedback using listeners, but it would be nice to see support errors per field 
in future release to reduce boiler plate code.


On 3/26/10 3:19 PM, "Greg Brown" <[email protected]> wrote:

FWIW, the look and feel of the Form class has been significantly improved for 
Pivot 1.5. Flag messages now appear in a color coded popup that is more 
strongly visually associated with the flagged field:

http://ixnay.biz/form.png

Messages can also be displayed inline such that they are always visible (i.e. 
they don't only appear on mouse over). Additionally, the flag icons are now 
more consistent with their Alert/Prompt equivalents.

G

On Mar 26, 2010, at 6:09 PM, Greg Brown wrote:

> This is unfortunately not supported. The Form container supports one flag per 
> field (where fields are defined by the form's sections). Form has no way of 
> knowing that you have multiple text inputs inside the box pane, so it can't 
> attach a flag to those text inputs. It can only show a flag for the fields it 
> knows about.
>
>
> On Mar 26, 2010, at 6:02 PM, Shahzad Bhatti wrote:
>
>> I am trying to build a form with multiple fields and would like to show all 
>> errors when form validation fails. From looking at samples, it looks like we 
>> can only have one Form.Flag per box pane such as following snippet from 
>> Forms.java
>>
>>       submitButton.getButtonPressListeners().add(new ButtonPressListener() {
>>           @Override
>>           public void buttonPressed(Button button) {
>>               String lastName = lastNameTextInput.getText();
>>               String firstName = firstNameTextInput.getText();
>>
>>               Form.Flag flag = null;
>>               if (lastName.length() == 0
>>                   || firstName.length() == 0) {
>>                   flag = new Form.Flag(MessageType.ERROR, "Name is 
>> required.");
>>               }
>>
>>               Form.setFlag(nameBoxPane, flag);
>>
>>               if (flag == null) {
>>                   errorLabel.setText(null);
>>                   Prompt.prompt("Pretending to submit...", window);
>>               } else {
>>                   errorLabel.setText("Some required information is 
>> missing.");
>>               }
>>           }
>>       });
>>
>> Is it possible to show error messages next to each field when form 
>> validation fails. I would appreciate for any examples. Thanks.
>>
>> ______________________________________________
>>
>> See  http://www.peak6.com/email_disclaimer.php
>> for terms and conditions related to this email
>


Reply via email to