• 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: Javascript focus on text field in repetition
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Javascript focus on text field in repetition


  • Subject: Re: Javascript focus on text field in repetition
  • From: Chuck Hill <email@hidden>
  • Date: Tue, 14 Feb 2006 10:27:54 -0800


On Feb 14, 2006, at 10:10 AM, John Huss wrote:

I'm trying to set focus on a text field that is inside a repetition in a table. I'd like to set focus on the first field in the last row of the repetition.

First I tried naming the field so I could focus on it. But naming the field (name="myfield") makes the repetition not work -- it repeats the first value in every row.

Yep, don't do that!  :-)


Then I considered accessing the element with an index, but since the repetition is dynamically generated, its hard to know what index to use.

list.count() - 1 should do it.

Or you can bind the item of the WORepetition to an ivar and then bind name to a method:
name=dynamicName;


public String dynamicName() {
    return "myfield" + indexValue;
}

Then access it with the name "myfield" + (list.count() - 1)


Chuck


--
Coming in 2006 - an introduction to web applications using WebObjects and Xcode http://www.global-village.net/wointro


Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects




_______________________________________________ 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: 
 >Javascript focus on text field in repetition (From: "John Huss" <email@hidden>)

  • Prev by Date: Re: Quick Image scale down
  • Next by Date: Re: Javascript focus on text field in repetition
  • Previous by thread: Javascript focus on text field in repetition
  • Next by thread: Re: Javascript focus on text field in repetition
  • Index(es):
    • Date
    • Thread