NetTalk Central

Author Topic: Form within a Form  (Read 5011 times)

Rob Kolanko

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Form within a Form
« on: April 13, 2012, 02:08:10 PM »
Hi,
I have tried to use a button to start a second NetWebForm from within a  NetWebForm . The second NetWebForm  updates only memory is used to upload an image file from the client. The first NetWebForm has the record information and allows the user to confirm that the uploaded image file will be saved with the record. I was happy to see the first NetWebForm still had the modified record fields when regenerated after serving second  NetWebForm, but the “Save” button no longer saves or inserts the record. Also the Validate p_stage was not sent in the NetWebForm. Is there anyway to "rearm" the save record for the first NetWebForm when generating the page and does not reload the record?
 I modified the web1 example to have a button that calls a second NetWebForm called FileUpload. When you return from the FileUpload form, the save button no longer saves the record but acts like the cancel button. The app is attached.

Thanks
Robert Kolanko


[attachment deleted by admin]
« Last Edit: April 14, 2012, 07:59:51 PM by Rob Kolanko »

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Form within a Form
« Reply #1 on: April 15, 2012, 05:54:13 PM »
Have you tried making the 2nd form a popup?


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Form within a Form
« Reply #2 on: April 15, 2012, 10:37:53 PM »
Hi Rob,

unfortunately you didn't include the dict in the example, so it won't compile here (*). Please post again, include the dict, and if applicable some data files as well...

(*) I know what you're thinking - I can just take the dict from example 1 that I ship. this doesn't work because on your machine that dict has been converted to C8, and the app as well. Part of the dict conversion includes the creation of GUID fields for each dictionary field, and the app now uses those GUID's. If I use the dict on my side, it converts here, gets all different GUID's and the app therefore doesn't "match" to the dict.

So always post the dict with an example app.

Thanks
Bruce

Rob Kolanko

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: Form within a Form
« Reply #3 on: April 16, 2012, 07:26:33 AM »
Hi Bruce,
Attached is the app and dct. I modified the example slightly. In the file upload NetWebForm, I entered the first NetWebForm  to return to for Cancel and Save. In Firefox, the application did return to the first NetWebForm, where as MSIE 8 returned to the browse. By qualifying the returning URL for file upload form, both browsers returned to the first NetWebForm. The original problem still exists.

Originally, I did try to make the second form a pop-up, but other issues occurred. Also I may wish to run the app with mobile devices.

Robert Kolanko


[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Form within a Form
« Reply #4 on: April 16, 2012, 10:08:02 PM »
Hi Rob,

ok - thanks for the example - I see what you're doing.
The short answer is, right now, you can't do this.

Primarily it's an issue in page mode, more than popup mode. In popup mode the first form "page" remains, when the other opens, so it's easier to "return" to it. In page mode it's a lot more complicated, and one of the reasons why you can't have 2 forms in the chain in page mode. (For example in page mode, if you go from a form to a lookup, you can't then go to the lookup's form). There are some exceptions, but the basic layout is gonna cause problems.

With regards to mobile - you're right, you'd need it in page mode there - on the other hand you should be aware that iOS devices at least do not have a "file upload" field at all. So that may be a spanner in that works as well.

I did change the app to popup mode, and there it does work ok. Just remember that once you are "in" popup mode, you have to stay in it. I see you had the first form set as a popup, but not the call to the second form. If they are both set it seems to be ok.

Cheers
Bruce


Rob Kolanko

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: Form within a Form
« Reply #5 on: April 17, 2012, 10:58:28 AM »
I will have to investigate why I abandoned the pop-up form. I think it was because I am unable to update the image field with the uploaded file on the original form after returning from the popup.

Robert Kolanko

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Form within a Form
« Reply #6 on: April 17, 2012, 09:26:07 PM »
hmm - updating the image sounds do-able.

cheers
Bruce