NetTalk Central

Author Topic: Refresh form fields after a pop-up form closes  (Read 206 times)

jking

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
    • Email
Refresh form fields after a pop-up form closes
« on: March 12, 2024, 07:31:46 PM »
Hello all,

     Using NT 14.19.  I have a form that displays many fields from a table called surgery.  Two fields are also displayed at the bottom, from another table (enrollment), in view only mode, as seen in the attached image.  The custom button on this form calls a "browse less" form as a pop-up, on the enrollment file.  On this form, the two fields can be edited.  Upon returning to the calling form, the fields are not updated.  I would like them to update as soon as returning from the pop-up.  I have tried calling a Do refresh::My:Field from the GotFocusBack embed without success.  How can I refresh the two fields or the entire form when retuning from the pop-up?

Thanks,

Jeff King
« Last Edit: March 12, 2024, 07:37:38 PM by jking »

rjolda

  • Sr. Member
  • ****
  • Posts: 272
    • View Profile
    • Email
Re: Refresh form fields after a pop-up form closes
« Reply #1 on: March 13, 2024, 02:57:35 AM »
Hi Jeff,
Are you on a form or a MemoryForm?  The way I look at this is that a regular form is an almost linear progression of stages - as opposed to an ACCEPT LOOP which we are used to working with in windows.  As such, the embeds and thinks that we want to do ( like close a form and update another's fields) does not work the way we expect.  Bruce has said it, and I have found that using your forms and tables on a MemoryForm (personally I think that this name is misleading but it serves the purpose) allows me to be able to do those kind of things.  The MemoryForm allows you to have something analogous to the Accept Loop functioning in that you can open and close controls and STAY WITHIN the MEMORY FORM PAGE and do this and that until you are done doing what you want to do.  This is just the nature of the way browsers and internet work. For example, I have a browse and I want to have several drop down filters for it.  The best way to get it done is on a Memory Form. Can move info and update other controls ( tables...) and stay on the same page.   If you haven't started working with MemoryForms, I suggest that you start.  Take your related forms and browses and simply put them into a Memory Form.  Then you can work with them and move information between them much easier.
Ron

jking

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
    • Email
Re: Refresh form fields after a pop-up form closes
« Reply #2 on: March 13, 2024, 09:52:14 AM »
Hi Ron,

     Thanks for your input.  I have tried both the regular table based form and the memory form.  Still, I don't see how to refresh the two fields on the main form, after closing the pop-up form.  I'll keep working on this.

Jeff
« Last Edit: March 13, 2024, 10:10:42 AM by jking »

osquiabro

  • Hero Member
  • *****
  • Posts: 668
    • View Profile
    • Email
Re: Refresh form fields after a pop-up form closes
« Reply #3 on: March 13, 2024, 12:02:59 PM »
as bruce says share example, i think that you need to change the value of your field  to session value in your popup form p_web.ssv('My:Field', yournewvalue ) and then refresh in GotFocusBack

jking

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
    • Email
Re: Refresh form fields after a pop-up form closes
« Reply #4 on: March 13, 2024, 03:05:56 PM »
Osquiabro,

     I have this working now.  I am doing the refresh in the GotFocusBack/End embed as follows:

      do refresh::Enr:BCS_Status
      do refresh::Enr:BCS_Upstaging
      do refresh::Enr:DCISionRT_Upstaging

For some reason, this embed was not "firing" earlier in my testing.  Works as expected now.

Thanks,

Jeff