NetTalk Central

Author Topic: Refresh Question  (Read 6035 times)

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Refresh Question
« on: March 31, 2020, 08:37:10 AM »
Hi,

I have a memory form displaying a few fields, it also contains a browse, if is clicked on the browse I want to update the fields on the memory form.

This Solutions don't work for me:

"In the form,
goto the "browse" form field
in the "reset fields" list on the "client-side" tab, add all the form fields you want to reset.
cheers
Bruce."


Thanks

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Refresh Question
« Reply #1 on: March 31, 2020, 09:50:14 PM »
That's working here, so I guess I'd need to see an example of what you are doing to see where you are going wrong.

remember to set the session value for fields on the form if you want them to change on reset.

cheers
Bruce

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Refresh Question
« Reply #2 on: April 01, 2020, 04:20:04 AM »
attached example

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Refresh Question
« Reply #3 on: April 01, 2020, 04:53:02 AM »
I think you need to make a memory form and made it a "child" of the browse.
You will have
-MemoryForm
--Browse
---MemoryForm2
Dont forguet to add the fields you need to the browse view, The name field is not in there.
-----------
Regards
Alberto

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Refresh Question
« Reply #4 on: April 01, 2020, 06:00:09 AM »
included the field in the view but don't work

I don't understand when you say:

"I think you need to make a memory form and made it a "child" of the browse."

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Refresh Question
« Reply #5 on: April 02, 2020, 05:47:18 AM »
somebody have small sample for this?

thanks.

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Refresh Question
« Reply #6 on: April 03, 2020, 10:13:31 AM »
I was investigating your problem.
I realized that what you need is somethig like Hot Fields near de Browse.
I found a way to do it but not "completly".

Add the following code to the "After a Browse Row is Clicked" Browse embed point
Code: [Select]
  MAI:MailBoxNumber = p_web.gsv('MAI:MailBoxNumber')
  Access:MailBoxes.fetch(MAI:PrimaryKey)
  p_web.ssv('MAI:MailBoxName',MAI:MailBoxName)

This works ok with a problem, when you first open the form its blanked, because you didn clicked in any row.

Then I began to solved this in the browse and I cant found a way.

Then I tried to solve this in the form adding this code to the "PreUpdate" from embed point
Code: [Select]
        p_web.OpenFile(MailBoxes)
        MAI:MailBoxNumber = 0
        set(MAI:PrimaryKey,MAI:PrimaryKey)
        next(MailBoxes)
        p_web.ssv('MAI:MailBoxName',MAI:MailBoxName)

This will set the field in the valur of the first record of the browse but... what if you change the sort order or just filter the browse ?

Hope it helps you in the meantime when I hope Bruce can help us with this.
« Last Edit: April 03, 2020, 10:15:16 AM by michelis »
-----------
Regards
Alberto

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Refresh Question
« Reply #7 on: April 03, 2020, 12:42:22 PM »
thanks michelis for your time, my solution is the same as it publishes, but my browser is empty when a user calls it and then a user calls a form with a filter popup, then when it comes back in GotFocus update the fields and It works, but I think Bruce has other solutions because all the fields are in Browse and I think it is possible to capture these values ​​from a browse.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Refresh Question
« Reply #8 on: April 06, 2020, 01:20:40 AM »
Hi Osa,

Clicking on the browse updates the session value for the row identifier for the browse.
So in this case mai:MailBoxNumber

If you want your Form field to display something related to that session value, then you need to set it.
For example;

In CallDiv routine
after the line;
orof 'childnewselection'

Access:MailBoxes.Open()
Access:MailBoxes.UseFile()
MAI:MailBoxNumber = p_web.GSV('MAI:MailBoxNumber')
Access:MailBoxes.Fetch(MAI:PrimaryKey)
p_web.FileToSessionQueue(MailBoxes)
Access:MailBoxes.Close()

Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Refresh Question
« Reply #9 on: April 06, 2020, 02:54:52 AM »
Bruce,
May be a good idea to add this to the docs, I didnt found any reference on this.
Or better to add a check to the Browse template, something like:
"Activate HotFields Fetch"
Thanks again
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Refresh Question
« Reply #10 on: April 06, 2020, 03:00:34 AM »
Hi Alberto,

This has nothing to do with the browse, and you should not add and code to the browse to deal with this.
The code belongs in the _Form_ - where the "child new selection" is handled.

cheers
Bruce

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Refresh Question
« Reply #11 on: April 06, 2020, 04:47:48 AM »
thanks Bruce work in childnewselection, but what about when open a form the first record don't display a field, only after click on row.

thanks..

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Refresh Question
« Reply #12 on: April 06, 2020, 08:23:46 PM »
you've added the code to the ChildNewSelection event - so it works there.

If you want it to work at other times (like say when the form is opened) then add the code there as well..
like in the GenerateForm routine...

cheers
Bruce