NetTalk Central

Author Topic: Form Calling Form in Static Page Environment  (Read 3310 times)

springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Form Calling Form in Static Page Environment
« on: March 25, 2012, 01:43:02 PM »
NT 5.47
Clarion 6.3
Static Pages with Dynamic (NetTalk) content

I have a need to call a form (that is always inserting in a table) and upon saving, it calls another form (that is always inserting in a different table).

The html page has <!-- Net:UpdateHousehold --> and the UpdateHousehold webform has the Advanced Tab setting for Insert.  That form appears correctly and on Saving, it inserts a record in the Household file.  That webform calls another html page on saving.

The page it calls has <!-- Net:UpdateMember --> and the UpdateMember webform has the Advanced Tab setting for Insert.  The form appears, but it is not in Insert mode, and the PreInsert routine is not called, and upon clicking the Save button, the record is not inserted into the member file.

Upon saving, the UpdateMember calls another html page correctly.

It appears that the problem is that I am not in insert mode on the second form, and I have verified in the SetAction routine that I am entering with no action setting (p_web.GSV(UpdateMember_CurrentAction) contains no value.

How can I have the second form operate in insert mode and save the record?

Thanks,
Mike Springer

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: Form Calling Form in Static Page Environment
« Reply #1 on: April 01, 2012, 05:31:08 AM »
if the second form is only called in Insert mode, then you can set this on the Advanced tab of that form.

springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Re: Form Calling Form in Static Page Environment
« Reply #2 on: April 01, 2012, 01:19:14 PM »
Bruce,
That's what I thought, too.  But, I have the Insert Mode checked ON in the second form, but I don't find that the PreInsert embed is ever called and the data that is entered in the form does not result in a record being inserted.

The first form behaves correctly (insert checked ON on the Advanced tab, PreInsert embed is called, and the record is inserted).  But the second form does not go into insert mode (apparently).

Is there an embed and session value that I should look at that would give a clue as to what is happening?

Mike Springer

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: Form Calling Form in Static Page Environment
« Reply #3 on: April 01, 2012, 10:46:26 PM »
can you maybe build a small example of the problem Mike - preferably not your actual app - just tweak one of the shipping examples to show the effect.

cheers
Bruce

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: Form Calling Form in Static Page Environment
« Reply #4 on: April 03, 2012, 03:17:39 AM »
Hi Mike,

thanks for the example.
As you are using NetTlak 5, it's probably best if you make the following change to the netweb.clw file yourself. I'm not sure when the next NT5 build will be.

netweb.clw
NetWebServerWorker.SaveForm method
add the following line, at the end of the method, immediately before the
return ans
line

self.SetValue('_form:inited_',0)

I've made the same change in NT6 - that'll be in the 6.27 build.

cheers
Bruce

springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Re: Form Calling Form in Static Page Environment
« Reply #5 on: April 03, 2012, 04:27:20 AM »
Bruce,
You are 'da man!  That works perfectly!

When I get a chance after this deadline I'm on, I'll upload to the latest version of NT6.  In the meantime, you made my customer (and me) happy!
Thanks,
Mike