RE: Using html:options/ tag with multiple=true

2003-06-28 Thread Wendy Smoak
Eva wrote:
 I want the form to be prepopulated with the data which 
 I retrieved from the database, and those items previously 
 selected by the user highlighted .  I am unable to do this
 for the multi-select drop down lists.

I vote for the old type of get and set methods do not match problem:

public String[] getJurisdiction() { return this.jurisdiction; }
public void setJurisdiction(String j[]) { this.jurisdiction = j; }

I would try using setJurisdiction( String[] j) instead.

The Introspection/Reflection process is *very* picky when it comes to
recognizing JavaBeans properties.  Usually it's someone mixing String and
int properties, but I can see how it would be confused by String j[] and
String[] as well.

-- 
Wendy Smoak, Arizona State University
BTW, Lucifer just called and he needs a pair of ice skates :-)
James Turner in struts-dev, voting to release Struts 1.1 Final



Re: Using html:options/ tag with multiple=true

2003-06-28 Thread Eva Murray
Hi Wendy,
Thanks so very much for your reply.  It was in fact a big help, and in the
end, helped me to find the solution.

It turned out that the problem was actually with how I was populating the
form jurisdiction field.
Apparently the s.getJurisdictionF() method was returning an array which had
some null entries, and the null entries in the array caused everything to
choke.

I then re-tested with setJurisdiction(String j[])  versus
setJurisdiction(String [ ]j) and everthing worked just fine either way.
None the less, I'll keep the setJurisdiction(String [] j) to make sure I
don't run into other problems.


The UpdateAction Class
public ActionForward perform(
TestPageForm testPageForm = (TestPageForm) form;
Service s = (Service) ServiceUtility.getServiceByPk(id);
testPageForm.setJurisdiction(s.getJurisdictionF());
}

Thanks again
Eva

- Original Message -
From: Wendy Smoak [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Saturday, June 28, 2003 10:55 AM
Subject: RE: Using html:options/ tag with multiple=true


 Eva wrote:
  I want the form to be prepopulated with the data which
  I retrieved from the database, and those items previously
  selected by the user highlighted .  I am unable to do this
  for the multi-select drop down lists.

 I vote for the old type of get and set methods do not match problem:

 public String[] getJurisdiction() { return this.jurisdiction; }
 public void setJurisdiction(String j[]) { this.jurisdiction = j; }

 I would try using setJurisdiction( String[] j) instead.

 The Introspection/Reflection process is *very* picky when it comes to
 recognizing JavaBeans properties.  Usually it's someone mixing String and
 int properties, but I can see how it would be confused by String j[] and
 String[] as well.

 --
 Wendy Smoak, Arizona State University
 BTW, Lucifer just called and he needs a pair of ice skates :-)
 James Turner in struts-dev, voting to release Struts 1.1 Final





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