• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Linking Array elements to WOComponents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Linking Array elements to WOComponents
      • From: Jeffrey Schmitz <email@hidden>
References: 
 >Linking Array elements to WOComponents (From: Jeffrey Schmitz <email@hidden>)
 >Re: Linking Array elements to WOComponents (From: David LeBer <email@hidden>)

  • Prev by Date: Re: [SOLVED] Subject: strange behavior... using <DIV>
  • Next by Date: ANY DB2 Experts Here????
  • Previous by thread: Re: Linking Array elements to WOComponents
  • Next by thread: Re: Linking Array elements to WOComponents
  • Index(es):
    • Date
    • Thread