NetTalk Central

Author Topic: After completing field set focus to another field  (Read 5024 times)

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
After completing field set focus to another field
« on: June 25, 2016, 06:37:11 AM »
I have a form where The user selects a drop down on FIL:field1.
Once this dropdown is selected I unhide FIL:field2.
I want to set focus to that unhidden FIL:field2
In  FIL:field1 on the drop tab there is a field 'When accepted, set focus'
What do I need to enter in this field to set focus to FIL:field2?
I have tried FIL:field2 but the cursor jumps to the first field in the form
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: After completing field set focus to another field
« Reply #1 on: June 26, 2016, 11:55:59 PM »
Did you try
'FIL:field2'
including the quotes?

Vinnie

  • Full Member
  • ***
  • Posts: 183
    • View Profile
    • Email
Re: After completing field set focus to another field
« Reply #2 on: June 27, 2016, 02:35:54 AM »
Hi Terry.

I found that I had to change the position of this line.

p_web.SetValue('SelectField',Clip(loc:formname) & '.' 7 p_web.NoColon('NAMEOFYOUEQUATE'))

I moved this line between

!  [Priority 5000]

p_web.SetValue('SelectField',Clip(loc:formname) & '.' 7 p_web.NoColon('NAMEOFYOUEQUATE'))

! End of "After Validate New Value, After sending replies"

This  has been working great for some time so not sure if this has been fixed by now.
Cheers

Vinnie

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: After completing field set focus to another field
« Reply #3 on: June 27, 2016, 06:33:11 AM »
Thanks for the replies
Vinnie. I haven't tried your solution yet. I need to see if I can use the default system first.
Hi Bruce. Yes I should have enclosed in quotes  since the prompt did not state no quotes.
However
I have 3 places where I have done this
1. A checkbox where the field is unhidden.Focus is on the correct lookup button on the specified entry field
2. A drop list with no lookup but with extra possibilities. Focus is placed on the specified entry field
3. A string with a lookup. Here the focus remains on the string entry field, and not on the specified focus field. 
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: After completing field set focus to another field
« Reply #4 on: June 30, 2016, 06:38:03 AM »
I'd need to see examples Terry.

Cheers
Bruce

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: After completing field set focus to another field
« Reply #5 on: June 30, 2016, 12:12:30 PM »
Vinnie's solution (note: the 7 in his text should be an &) worked great for me. Placing that code AFTER the refresh call to display the hidden field that I wanted the focus set to was the answer.

Regards,

Mark

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: After completing field set focus to another field
« Reply #6 on: July 01, 2016, 02:03:30 AM »
Hi Bruce
Using Accounts Example(31)
I added 'INV:Paid' to INV:Customer field set focus in the UpdateInvoices Netwebform
compiled
Select Operations\Invoices
Change Invoice1
Select to change customer
Select Country South Africa from drop down
select Eco-Times systems as new customer
Focus still goes to Date not Paid checkbox
Attached App and Dct

Hi Vinnie and Markster thanks.
I checked the location of that line in the code from the attached App and it is already in  Priority 5000 after End of Validate New Value
  If loc:noFocus = false
    p_web.SetValue('SelectField',clip(loc:formname) & '.' & p_web.NoColon('INV:Paid'))
  End
Moving the line slightly lower to
  ! Start of "After Validate New Value, After sending replies"
  ! [Priority 5000]
 p_web.SetValue('SelectField',clip(loc:formname) & '.' & p_web.NoColon('INV:Paid'))
  ! End of "After Validate New Value, After sending replies"
without the noFocus check had no effect, focus still set to Date field
« Last Edit: July 01, 2016, 02:17:34 AM by terryd »
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186