[Opensource] <html:select> and addAutoInPut()
Michael Rimov
rimovm at centercomp.com
Sat Jun 15 06:00:10 PDT 2002
At 01:50 AM 6/13/2002 -0400, you wrote:
>Hi:
>
>I am have a question about <html:select> and Response.addAutoInput()
>
>There is a table "relation" which simply restores catalog of
>relationship. I want to use expresso tag to populate the <select>
>options from the database. so I implement getValidValues(String
>fieldName) in dbobj "relation" like this:
>
>public class Relation extends SecuredDBObject{
> ..................
>/**
>* @returns Vector of Valid Value/Description pairs for Tables
>* @throws DBException If the values cannot be retrieved
>*/
>public Vector getValidValues(String fieldName) throws DBException {
>Vector myValues = new Vector();
>Relation oneRelation = null;
>for (Iterator e = this.searchAndRetrieveList().iterator();
>e.hasNext();) {
>oneRelation = (Relation) e.next();
>myValues.addElement(new ValidValue(
>oneRelation.getField("relation"),
>oneRelation.getField("relation")));
>System.out.println("relation" +oneRelation.getField("relation"));
>}
>return myValues;
>}
Actually, I'm just shooting from the hip here, but it looks like you need
to wrap your getValidValues code in a
if (fieldName.equals(<the field I want to create a valid value for>)) {}
block.
Also, make sure you set up the Field to be multivalued as per the
setupFields() function.
HTH!
-Mike
More information about the Opensource
mailing list