NetTalk Central

Author Topic: PWA/Disconnected app  (Read 3892 times)

jking

  • Sr. Member
  • ****
  • Posts: 397
    • View Profile
    • Email
PWA/Disconnected app
« on: March 14, 2019, 04:31:32 PM »
Bruce,

     I'm back on my PWA disconnected app for my coin collection, after a brief detour.  With NT 11.07, things are back to normal for me.  My main screen is a memory form that has two string variables, two buttons and a browse.  See image Form.png.  I enter  a coin type and coin date into the string variables and a browse filter (see Filter.png) filters the table as expected. 
     I don't like the look of the string variables at the top, so instead I want to call another form to enter these.  I created a second memory form called FilterForm and duplicated these string variables on it.  I call this form from the first button (magnifying glass) and fill in the two strings.  Upon returning to the main form, the original variables don't seem to be set and thus the filter does not  work.  Any thoughts on how I might accomplish this?

Thanks,

Jeff
     
« Last Edit: March 18, 2019, 11:37:01 AM by jking »

jking

  • Sr. Member
  • ****
  • Posts: 397
    • View Profile
    • Email
Re: PWA/Disconnected app
« Reply #1 on: March 18, 2019, 11:38:52 AM »
Bruce,

This really has me stumped.  I'm trying to use JS to set the variable on the original form to that I enter on the second memory form.  Nothing is working for me. 

Thanks,

Jeff

Rene Simons

  • Hero Member
  • *****
  • Posts: 649
    • View Profile
Re: PWA/Disconnected app
« Reply #2 on: March 18, 2019, 12:11:50 PM »
Hi Jeff,

You can zoom in on a field and click the "client-side" tab.
Here tick the "Send new value to the server"box on and click the "Server Code" button.
Double click the Add Server "Side Code Here" embed point and pick "source" as embed type.

Here you type p_web.ssv('<your clarion field equate>', your field name)

This way you park the value of the entered field in a session variable with the name of the equate.

This value is available using: myValue = p_web.gsv('<your clarion field equate>')

Hope this helps.

Ren
Rene Simons
NT14.14

jking

  • Sr. Member
  • ****
  • Posts: 397
    • View Profile
    • Email
Re: PWA/Disconnected app
« Reply #3 on: March 18, 2019, 04:19:48 PM »
Rene,

     I tried as you suggested.  See image coinSearchFilter.png.  I assume that when I return to the main form, I need to use coinSearch = p_wb.GSV('coinSearchFilter') in an embed.  I tried On Focus, and a few of the validate embeds, with no luck.

     Here is the setup I have:  I have the main form called CoinCollectorForm.  It has a field called coinSearch that I normally fill in directly and then use to filter the browse on this same form.  See the image tree.png for how this is in the PWA app tree.  The button on this form (magnifying glass) calls the second form, FilterCoinCollection.  Here I have a field called coinSearchFilter.  I set the server side code embed as you indicated.  Still, upon returning to the main form, the coinSearch field does not contain the value entered on the secondary form.  Any other thoughts?

Thank you,

Jeff

Rene Simons

  • Hero Member
  • *****
  • Posts: 649
    • View Profile
Re: PWA/Disconnected app
« Reply #4 on: March 19, 2019, 12:16:59 PM »
Hi Jeff,

As far as I understand, popups are not pages but "part of" pages.
As Bruce points out in topic http://www.nettalkcentral.com/forum/index.php?topic=7401.msg30095#msg30095
, you can take action when the part of the page where you clicked the search button gets focus (again).
Maybe if you assign the session vars you collected in your popup into the "fields" of the main screen when
that part gets focus, you will get further.

I could not find the focus part in the template settings but I know there is a routine somewhere in the source.
I have not experimented with this so I am merely guessing here.

Hope it helps a bit.

Ren
Rene Simons
NT14.14

jking

  • Sr. Member
  • ****
  • Posts: 397
    • View Profile
    • Email
Re: PWA/Disconnected app
« Reply #5 on: March 22, 2019, 07:05:50 AM »
Rene,

     Thanks, I'm still trying to get the secondary filter form work.  For now, I have used the placeholder feature and modified the filter fields by removing the prompts.  Now it looks better, see the attached image.  I'll continue to work on the secondary form.

Jeff

jking

  • Sr. Member
  • ****
  • Posts: 397
    • View Profile
    • Email
Re: PWA/Disconnected app
« Reply #6 on: March 23, 2019, 05:50:54 PM »
Bruce,

     I still struggle with this secondary filter form.  I'm not sure if I need to use session variables, since the forms, in a NT app, use these.  Or am I supposed to be using JS code to set the variable on the main form to the value of the variable on the secondary form.  I have tried both ways and have had no success.

Thanks,

Jeff
« Last Edit: March 24, 2019, 08:22:48 AM by jking »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11171
    • View Profile
Re: PWA/Disconnected app
« Reply #7 on: March 25, 2019, 02:29:14 AM »
send me the updated example Jeff so I can see what you are doing.

Cheers
Bruce

jking

  • Sr. Member
  • ****
  • Posts: 397
    • View Profile
    • Email
Re: PWA/Disconnected app
« Reply #8 on: March 26, 2019, 07:12:49 AM »
Bruce,

     Sent you the updated version.

Thanks!

Jeff