Hi Ben,
Thanks for ur mail. I want to get the length of the complete JSP page content that
counting the length of the text for each elements of the form.
can u suggest any idea?
Raghu
bensifuentes <[EMAIL PROTECTED]> wrote:
Currently, I have a function defined within my DynaValidatorForm which
checks the elements of the form and returns the first element which contains data so
that I can place a focus call on the field like so:
#=================================================================
# Code snip
#=================================================================
// 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 generically. Is there any way
in struts to retrieve a container of elements defined for the form. It seems to me the
problem would be determining the order.
There needs to be a sort order for the items that should match what the
user see's from the jsp. How would one accomplish this?
We use the tabindex with our tags within our jsp.
I was wondering if we can get access to it from the form? That would help determine
the display order of the elements if it were available.
Anyone know how to accomplish this?
-Ben