NetTalk Central

Author Topic: Focus  (Read 8333 times)

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Focus
« on: January 25, 2013, 03:36:59 AM »
exist a function for set focus via code??

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Focus
« Reply #1 on: January 25, 2013, 04:45:02 AM »
yes, but you'll need to be a lot more explicit about the context.

cheers
Bruce

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Focus
« Reply #2 on: January 25, 2013, 05:33:36 AM »
i have a procedure for change password with this part of code:

if  Loc:CurrentPassword =Use:Password   
    loc:alert='Invalid New Password, is equal to Current password'
    loc:Invalid=true       
    EXIT
end

when occurs this error i need to set focus to Loc:CurrentPassword

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Focus
« Reply #3 on: January 25, 2013, 06:10:24 AM »
I haven't tested this, but I think;

p_web.SetValue('SelectField','Loc:CurrentPassword')

will do it.
(before the Exit obviously)

cheers
Bruce

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Focus
« Reply #4 on: January 25, 2013, 07:32:22 AM »
not work i have mi code in ValidateUpdate in memory form..

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Focus
« Reply #5 on: January 28, 2013, 09:14:34 AM »
Hi,
Shouldn't it be:

Loc:invalid = 'loc:Currentpassword' in stead of loc:invalid = true  ?

Anyway, loc:invalid must be equal to te field name that is in error.

Rene
Rene Simons
NT14.14

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Focus
« Reply #6 on: January 28, 2013, 01:27:59 PM »
thank you very much! worked...

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Focus
« Reply #7 on: January 30, 2013, 05:29:38 AM »
stopped working with version 7.04.. go back to 7.03

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Focus
« Reply #8 on: January 30, 2013, 09:34:57 PM »
I can't think of any change that would have affected it in 7.04. I guess post an example and I'll take a look.

cheers
Bruce

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Focus
« Reply #9 on: February 01, 2013, 05:38:44 AM »
i think that the  jQuery Dialogs has affected ..

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Focus
« Reply #10 on: February 06, 2013, 04:41:26 AM »
7.05 don't work Focus, only work in 7.03 and back

this is my code:

IF Loc:CurrentPassword = ''
    loc:alert='Invalid Current Password'
    Loc:invalid = 'Loc:CurrentPassword'
    exit
END

IF  Loc:NewPassword=''
    loc:alert='Invalid New Password'
    Loc:invalid = 'Loc:NewPassword'
    EXIT       
END

IF Loc:NewPasswordConfrmation = ''
    loc:alert='Invalid Confirmation Password'
    Loc:invalid = 'Loc:NewPasswordConfrmation'
    exit
END

if  Loc:NewPasswordConfrmation <> Loc:NewPassword
    loc:alert='Invalid Confirm New Password'       
    Loc:invalid = 'Loc:NewPasswordConfrmation'
    Exit
end

p_web._OpenFile(Users)
Use:UserId = p_web.GSV('UserId')
Access:Users.Fetch(Use:PK_Users)

if  Loc:CurrentPassword =Use:Password   
    loc:alert='Invalid New Password, is equal to Current password'       
    Loc:invalid = 'Loc:CurrentPassword'   
    EXIT
end

if Loc:CurrentPassword <> Use:Password       
    loc:alert='Invalid Current Password' 
    Loc:invalid = 'Loc:CurrentPassword'
ELSE
    Use:Password = Loc:NewPassword
    PUT(Users)
END
p_web._CloseFile(Users)

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Focus
« Reply #11 on: February 06, 2013, 05:27:19 PM »
if you can duplicate the effect in one of the examples (perhaps example 3) and post that here that would be great.

cheers
Bruce

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Focus
« Reply #12 on: February 07, 2013, 02:46:35 AM »
see attachment..

[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Focus
« Reply #13 on: February 08, 2013, 12:18:18 AM »
you always need to include the dictionary with examples (because when you convert a dict from C6 to C8 a unique dict is created.)

also always include data files if you can, because this makes the example "stand-alone" for future readers of this thread.

lastly it is really helpful if you include instructions on what to do when the app runs. Where to go, and what to type etc. Explain what you expect to see, and what you do see.

Cheers
Bruce

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Focus
« Reply #14 on: February 08, 2013, 02:17:57 AM »
again see the attactment, i include new procedure call ChangePassword.

[attachment deleted by admin]