Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
FocusOnLoad in LiftScreen
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Scaalp  
View profile  
 More options Mar 1 2012, 3:38 pm
From: Scaalp <pascal.wass...@gmail.com>
Date: Thu, 1 Mar 2012 12:38:05 -0800 (PST)
Local: Thurs, Mar 1 2012 3:38 pm
Subject: FocusOnLoad in LiftScreen

Hello,

is there a way to put the focus on a particular field when a form is
presented to the user using a LiftScreen ?
I didn't find an answer in this list when searching for "FocusOnLoad" or
"LiftScreen".

Thanks,
Pascal


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sören Kress  
View profile  
 More options Mar 2 2012, 5:30 pm
From: Sören Kress <soeren.kr...@gmail.com>
Date: Fri, 2 Mar 2012 14:30:54 -0800 (PST)
Local: Fri, Mar 2 2012 5:30 pm
Subject: Re: FocusOnLoad in LiftScreen

I didn't try it myself, but I guess you could add an attribute to your form
field, e.g. a specific class name (like 'focus') or you could set the
tabindex to 1 on that field. Then you should be able to identify that field
via JavaScript and set the focus.

Best regards
Soeren


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Pollak  
View profile  
 More options Mar 2 2012, 5:33 pm
From: David Pollak <feeder.of.the.be...@gmail.com>
Date: Fri, 2 Mar 2012 14:33:52 -0800
Local: Fri, Mar 2 2012 5:33 pm
Subject: Re: [Lift] Re: FocusOnLoad in LiftScreen

You could do something like:

override def screenTop = Full(Script(OnLoad(...)))

That would add a script to the page to do whatever you wanted.

--
Visi.Pro, Cloud Computing for the Rest of Us http://visi.pro
Lift, the simply functional web framework http://liftweb.net
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Scaalp  
View profile  
 More options Mar 3 2012, 4:08 am
From: Scaalp <pascal.wass...@gmail.com>
Date: Sat, 3 Mar 2012 01:08:47 -0800 (PST)
Local: Sat, Mar 3 2012 4:08 am
Subject: Re: [Lift] Re: FocusOnLoad in LiftScreen

Thank you for this map with many paths to explore (screenTop, Script,
OnLoad, ...).  With it, I should find my way to my goal.

Pascal

Le vendredi 2 mars 2012 23:33:52 UTC+1, David Pollak a écrit :


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Scaalp  
View profile  
 More options Mar 3 2012, 9:35 am
From: Scaalp <pascal.wass...@gmail.com>
Date: Sat, 3 Mar 2012 06:35:36 -0800 (PST)
Local: Sat, Mar 3 2012 9:35 am
Subject: Re: [Lift] Re: FocusOnLoad in LiftScreen

Hello,

following the path given by David, I reached my goal with the following
code :
override def screenTop = recipient.uniqueFieldId.map(id =>
<span>{Script(OnLoad(Focus(id)))}</span>)

But this seems a bit awkard to me, as I had to add a span, to transform the
Node returned by Script into the Elem needed by screenTop.  Maybe should
screenTop be of type Box[Node], instead of Box[Elem] ?

But I found another way that pleases me better : overwrite the toForm
method of my LiftScreen :
override def toForm = recipient.uniqueFieldId.map(id =>
Script(OnLoad(Focus(id)))).toOption ++: super.toForm

Pascal


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »