• 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: need help, editing an array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: need help, editing an array


  • Subject: Re: need help, editing an array
  • From: LD <email@hidden>
  • Date: Mon, 22 Aug 2005 07:11:32 +1000

Hi there,

On 22/08/2005, at 6:34 AM, Amedeo Mantica wrote:

I have an Array and i display his content using a WORepetition.
for each row, I display data into a textfield...

How can i modify the data into the array?

let's say you have the following bindings: MyRepetition: WORepetition { list = theArray; item = anObject; } MyTextField: WOTextField { value = anObjectValue; }

In your Java file you have:

/** @TypeInfo SomeType */
NSArray theArray; // assume populated with objects.
public SomeType anObject; //

public String anObjectValue() {
    return anObject.someStringValue();
}

Here's two choices/examples...

1) the items stored in the array must be mutable. i.e., SomeType values must be settable and not final.
public void setAnObjectValue( String aValue ) {
anObject.setSomeStringValue( aValue );
}


2) use an NSMutableArray.
public void setAValue( String aValue ) {
    int i = theArray.indexOfObject( anObject );
    SomeType newObject = new SomeType( aValue );
    theArray.replaceObjectAtIndex( newObject, i );
}

with regards,
--

LD


_______________________________________________ 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
References: 
 >need help, editing an array (From: Amedeo Mantica <email@hidden>)

  • Prev by Date: Re: ERXEntityClassDescription
  • Next by Date: LDAP
  • Previous by thread: need help, editing an array
  • Next by thread: LDAP
  • Index(es):
    • Date
    • Thread