NetTalk Central

Author Topic: Can I update a DisplayField for every keypress ?  (Read 2690 times)

ViggoPoulsen

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • Email
Can I update a DisplayField for every keypress ?
« on: June 16, 2012, 11:02:21 AM »
Hi
I have a Display field on a memory form with this text (equate = SlutprisDisplay) :  p_web.GSV('VaegtIGram')

Somewere else on the same form I have a Number using this server code:  p_web.SSV('VaegtIGram', VaegtGram)
I have inserted SlutprisDisplay value for Reset.

Now when I type something in the number and leave the field the Display field updates as expected (accepted).
What I want instead is an update of the Display field every time I put in a new digit in the number.  Is this possible in NTWS ?  (I'm in the learning phase).

Best regards
Viggo Poulsen

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11191
    • View Profile
Re: Can I update a DisplayField for every keypress ?
« Reply #1 on: June 17, 2012, 11:11:52 PM »
I'm not sure if it'll accomplish what you want, but I've added an option to 6.34 called
"Send every keypress to server"
on the settings tab for each field.

I recommend using this sparingly (because obviously it generates a fair bit of extra traffic) but I can see it being useful in some circumstances.

Note that reformatting the incoming field "as they type it" is possible, but icky. By default the field is _not_ refreshed as they type (and this includes it not being refreshed when it's "accepted"). While you can refresh the field with embed code, you'd also need to set the focus back - refreshing the field causes a loss of focus in the browser.

cheers
Bruce

ViggoPoulsen

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • Email
Re: Can I update a DisplayField for every keypress ?
« Reply #2 on: June 18, 2012, 12:17:58 AM »
I can see your point with focus. I'll have to try it, to see if it is a problem.
My goal is that the user should use the keyboard (pc or mobile) as little as possible. Key in what you know and get the answer.
In fact I just saw an example of what may be even better than refresh for every keypress:
In Windows mail you have a search field top right. When you starts typing and take a short break the search is performed. I key in 'Netta' and immediately see the mail to/from you. This feeling of immediate action is just what I would like to make. Can this be made ? (timer, your update in 6.34 or something else) ?

Best regards
Viggo Poulsen

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11191
    • View Profile
Re: Can I update a DisplayField for every keypress ?
« Reply #3 on: June 18, 2012, 06:14:47 AM »
I think you have "auto complete" in mind Viggo.
Try the "Locators" example - the form in there has lots of Auto-complete options.

cheers
Bruce

ViggoPoulsen

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • Email
Re: Can I update a DisplayField for every keypress ?
« Reply #4 on: June 18, 2012, 06:58:34 AM »
Thank you. I'll try that.

Best regards
Viggo Poulsen

ViggoPoulsen

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • Email
Re: Can I update a DisplayField for every keypress ?
« Reply #5 on: June 18, 2012, 09:11:03 AM »
Hi Bruce
I have tried it now. This is not quite what I am looking for. The locator is linked to a browser, and you have to leave the field (tab, enter) to make it work. I think I will wait for 6.34 and see if this could work for me.

Best regards
Viggo Poulsen

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11191
    • View Profile
Re: Can I update a DisplayField for every keypress ?
« Reply #6 on: June 18, 2012, 10:03:07 PM »
Hi Viggo,

no - don't look at the locators in that example.
Go to the form for the browse, and see how the lookup fields work (if you type something). Try typing something in other fields as well.

The locators example contains the locators obviously, but I was interested in you seeing the auto-complete functionality (also in that example, on the form) not the locator.

cheers
Bruce

ViggoPoulsen

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • Email
Re: Can I update a DisplayField for every keypress ?
« Reply #7 on: June 18, 2012, 11:27:41 PM »
Ah, I see now. It looks good, so Back on the track :-)

Best regards
Viggo Poulsen