• 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 / WOBuilder Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JavaScript / WOBuilder Question


  • Subject: Re: JavaScript / WOBuilder Question
  • From: Chuck Hill <email@hidden>
  • Date: Sat, 3 Mar 2007 09:20:51 -0800

The advantage of my solution is that if you are using a page wrapper you just add this to your project once and then never think about it again.

Chuck


On Mar 3, 2007, at 3:56 AM, Mike Schrag wrote:

You can also use FocusTextField in Ajax.framework to do this, btw (though it doesn't use an onLoad -- it just drops a <script> tag in that focuses).

ms

On Mar 3, 2007, at 12:14 AM, Chuck Hill wrote:

Hi John,

I just happen to have it sitting in front of me. :-) Try this for you body tag. It should be 100% generic and work on any form.

<body onLoad="if (document.forms.length == 0) return; inputs=document.forms[0].getElementsByTagName('input'); for (inputIdx=0; inputIdx < inputs.length; inputIdx++) { anInput = inputs[inputIdx]; if (anInput.type.toLowerCase() == 'text') {anInput.focus(); break; }}">



Chuck


On Mar 2, 2007, at 9:08 PM, John Shepardson wrote:

I asked my first question a week ago and I would like to thank the list for
all of the help I received.


This is a really easy one and has to do with JavaScript in WOBuilder.

I have a WOTextField with one binding which is value myTextFieldValue

I want to activate this textfield by calling focus(); during the onload
event in JavaScript.
I tried to add a binding to the text field to call a JavaScript function for
the attribute onload, but it never fired.
After a little study, I deleted that binding and added the onload binding to
the <body> of the main.wo field, so now the event is firing, but I'm not
sure how to activate the textfield.


I have used
function activateTextFieldValue() { document. myTextFieldValue.focus();}
and
function activateTextFieldValue() { this.myTextFieldValue.focus ();}


But the text field remains not focused.

Could someone help me to write this function into my javascript file (I know
it runs because
function activateTextFieldValue() { alert("test");}
does work.


Thanks,

John


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net


This email sent to email@hidden


--

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:
40mdimension.com


This email sent to email@hidden


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net


This email sent to email@hidden


--

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 / WOBuilder Question (From: John Shepardson <email@hidden>)
 >Re: JavaScript / WOBuilder Question (From: Chuck Hill <email@hidden>)
 >Re: JavaScript / WOBuilder Question (From: Mike Schrag <email@hidden>)

  • Prev by Date: Re: Javamonitor help
  • Next by Date: Re: Javamonitor help
  • Previous by thread: Re: JavaScript / WOBuilder Question
  • Next by thread: wo tips
  • Index(es):
    • Date
    • Thread