Re: Linking Array elements to WOComponents
Re: Linking Array elements to WOComponents
- Subject: Re: Linking Array elements to WOComponents
- From: Arturo Perez <email@hidden>
- Date: Tue, 22 Mar 2005 13:45:49 -0500
David LeBer wrote:
On Mar 22, 2005, at 11:46 AM, Jeffrey Schmitz wrote:
I have a java array of
strings and I would like to be able to map individual elements of the
array to individual WOString components on a web page. ...
In short, is there a way to directly connect individual Java array
elements to individual WOComponents.
How are you identifying the objects in the array? By position?
(The following is offered in the vein of a hack from someone who likes
formatters.)
How about using a formatter? Set the value of the string to the index
and do something like
class hackArrayOfStrings extends java.text.Format {
private [] String arrayOfStrings;
public StringBuffer format(Object o,
StringBuffer sb,
ParsePosition pp) {
int idxOfString = Integer.intValue(o.toString());
sb.append(arrayOFStrings[idxOfString]);
return sb;
}
public void setArrayOfStrings(String [] x) {
arrayOfStrings = x;
}
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden