For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 8 replies, 2 voices, and was last updated 12 years, 7 months ago by
support-michael.
-
AuthorPosts
-
TurgutGuneysuMemberOS: Win7 Home Premium SP1
MOBI: 2.3.1 and 2.5 m1 (happens in both)
2.5 m1 Settings: Apache Cordova 2.2 and iPhone 4/4S IOS: 5.0
APP: TestFormPresub.mobi and TestFormPresub_custom.js attached
Wireshark Output: shown below for each case.I created a small test program to illustrate a FORM related issue I have been dealing with.
PROBLEM:
The form has three fields:
f1 is filled by the user, f2 and f3 are programmatically filled. The result field is to just display the web page.There are two cases of behavior:
CASE-1:
I make use of the Pre and Post form submit processing.
f1 is filled by user. Then submit is pressed.
In the PRE-SUBMIT area of TestFormPresub_custom.js , code fills out f2 with date and f3 with time in ms format.
Form gets submitted, however, the URL line does NOT INCLUDE the contents of the f2 and f3 as parameters.
They are in there, but have no value in them, even though the screen has data in all three fields.
Incoming web page is code is displayed in the response area, just so I know I got a reply.Here is the display from Inspector showing the transmitted URL line with empty f2 and f3 parameters:
http://bakery-z.com/opt?f1=**********&f2=&f3=&result=&_=1375138416260CASE-2:
Same code with no changes.
The only difference is I just clear the response area so it does not get transmitted again.
Notice that all the screen fields are already filled in from the previous transmit.
Then I press submit.
The form gets transmitted HOWEVER with f1 without any content.
f2, and f3 in the URL as have their respective contents included.
Same display result is received in the response area.Here is the display from Inspector showing the transmitted URL line with empty f1 parameter:
http://bakery-z.com/opt/?f1=&f2=Mon+Jul+29+2013+18%3A14%3A50+GMT-0400+Eastern+Daylight+Time&f3=1375136090507&result=&_=1375136098188After many tests and troubleshooting, I decided to control the FORM submission process myself and wrote my code into the documentReadyHandler section. This way I do not make use of the PRE and POST form submit processes.
CASE-3:
All my action code is in the documentReadyHandler section.
I copy/paste the code from preFormSubmit section into documentReadyHandler section.
I add one line to fill the f1 field in the program.
The program fills out all three fields.
No screen entries are needed. The screen shows values for all three fields.
Then I submit the form using the phoneui.submitForm() function.Everything works as it should. The fields are included in the URL with proper values.
Here is the display from Wireshark showing the transmitted URL line:
http://bakery-z.com/opt?f1=******************&f2=Mon+Jul+29+2013+18%3A45%3A18+GMT-0400+(Eastern+Daylight+Time)&f3=1375137918355&result=&_=1375137925604This problem happens exactly the same way in both 2.3 and 2.5 m1 versions.
I could not capture the interaction for the iPhone APP because I have no way of intercepting the wireless transmissions with wireshark. However, I know that the problem exists on the phone since I have encountered it in another program I wrote. That is why I started investigating it.
Unless I am doing something wrong, I believe there might be a problem with handling program-filled field contents in the pre-formSubmit section of MOBI system.
Thanks to have a look and let me know.
Turgut
Attachments:
You must be logged in to view attached files.July 29, 2013 at 9:36 pm #341107
support-michaelKeymasterThanks for the detailed problem report and the example. I believe this is a bug in the phoneui.submitForm() function. Researching this now and will provide more info asap.
August 8, 2013 at 7:43 am #341341
TurgutGuneysuMemberHello Wayne / Support,
Any progress on this problem ?
Thanks,TG
August 8, 2013 at 4:25 pm #341363
support-michaelKeymasterHi TG,
Yes, a fix will be available in the next MobiOne 2.5 milestone-2 (late Aug). In the meantime if you need a quick fix I can describe the 1 line change in phoneui.js.
August 8, 2013 at 7:49 pm #341366
TurgutGuneysuMemberHello Wayne,
Would that be something I can implement and carry on with my development?
If so I would be interested.Thanks, TG
August 10, 2013 at 10:01 am #341403
TurgutGuneysuMemberHi Wayne,
Awaiting the one-line fix you mentioned.
Thanks,TG
August 12, 2013 at 10:08 am #341424
support-michaelKeymasterThe change we are making in the next update (2.5M1) is shown below. In the phoneui.js file’s submitForm() function we are moving the serialization of the form fields/inputs after the preSubmitForm_XXX() callback. You can find phoneui.js file under your project’s www/res folder. See attachment fix-bug24172.png
Attachments:
You must be logged in to view attached files.August 12, 2013 at 4:21 pm #341434
TurgutGuneysuMemberThank You Wayne,
This fixed the problem.TG
August 12, 2013 at 4:52 pm #341439
support-michaelKeymasterCool! Thx for the follow up.
-
AuthorPosts
