Currently, I have a function defined within my DynaValidatorForm which
checks the elements of the form for data and returns the first element of
the form which contains data so that I can place a focus call on the first
field that has content like so:

        // Check if a field has content in it
        private boolean hasContent(String id) {
                return StringUtilities.hasContent((String) get(id));
        }

        // Retrun the first field with data in it
        public String getFirstSearchedField() {
                if (hasContent(LAST_NAME)) {
                        return LAST_NAME;
                }

                if (hasContent(FIRST_NAME)) {
                        return FIRST_NAME;
                }

                .
                .  // more of the same
                .

                // Default is last name
                return LAST_NAME;
        }


I would like to do this same type of thing for every form.  Is there any way
in struts to retrieve a container of elements defined for the form.

Also there needs to be a sort order for the items that should match what the
user see's from the form. How would one accomplish this?

Any Suggestions?

-Ben

 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to