NetTalk Central

Author Topic: Refresh a field in another tab  (Read 5140 times)

broche

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Refresh a field in another tab
« on: April 06, 2019, 03:25:29 AM »
Hi All,

Cl 11
NT 11.07
String Th: 3.06

Want to refresh a field in another tab.  Looks like all the values are being picked up but the field does not refresh.
Field CustomerCode On Tab 0 - UploadLocation on tab - 4.

User enters code then tabs out of the field, server side code constructs a Directory and path
All looks good.

Brian.
Brian

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Refresh a field in another tab
« Reply #1 on: April 08, 2019, 02:22:18 AM »
you should be able to refresh a field on any tab.
I'm not sure why you posted here - was there a question?

cheers
Bruce

broche

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Re: Refresh a field in another tab
« Reply #2 on: April 13, 2019, 03:40:41 AM »
Sorry, by 'All Looks good' I meant that the field in question does have the correct data in it.  It just does not refresh the form.
I suppose what I am asking is how do I force the refresh for the field on the form.
When I look at the code I see

  do ValidateValue::btn_crcusdir  ! copies value to session value if valid.
  ! Start of "After Validate New Value"
  ! [Priority 4000]
  ! Set the File Locations if fields are empty
        IF CLIP(cus:UploadLocation) = ''
            Loc:uploadLocation = p_web.GSV('DataPath') &'\' &p_web.GetValue('cus:CustomerCode') &'\Uploads'
            p_web.Trace('XXX: ' &Loc:uploadLocation)
            cus:UploadLocation = CLIP(Loc:uploadLocation)
            p_web.Trace('XXX: ' &cus:UploadLocation)
        END
       
  ! End of "After Validate New Value"

  p_web.PushEvent('parentupdated')
  do Refresh::btn_crcusdir   ! Button "Send new value to server"
  do Refresh::cus:UploadLocation  !(GenerateFieldReset)
  do Refresh::cus:TemplateLocation  !(GenerateFieldReset)
  do Refresh::cus:CoverLoc  !(GenerateFieldReset)
  p_web.ntForm(loc:formname,'ready') ! 8.67 (in case the form was not the originator of the Ajax call)
  ! Start of "After Validate New Value, After sending replies"
  ! [Priority 5000]
   
The fields do not refresh

Thanks.
Brian

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Refresh a field in another tab
« Reply #3 on: April 14, 2019, 10:04:04 PM »
If the fields do not refresh then either;

a) the value in the (session) field is not what you expect or
b) the refreshing is not being applied to the window.

So the first step is in determining which of those it is. Probably Network tab in Developer Tools is where I would start to inspect the refresh arriving at the page to see what it is setting.

cheers
Bruce