Details
Description
This was seen in the icemobilespring demo in the Android container. When submitting the buttons form, the value of '[button type]undefined' would be returned. The form post was sending '[button type]undefined'. This was only seen in the container, and not seen when using the browser. This example has a different path for submitting the form when in the container:
MvcUtil.enhanceForm = function(theForm) {
//submitting the form will update
//the containing div with class ajaxzone
$(document).ready(function () {
$(theForm).submit(function () {
var updateRegion = $(this).closest("div.ajaxzone");
if (window.ice && ice.upload) {
window.ice.handleResponse = function (data) {
updateRegion.html(unescape(data));
var msgElem = $("#message");
if( msgElem.length > 0 ){
$('html, body').animate({ scrollTop:msgElem.offset().top }, 500);
}
}
ice.upload($(this).attr("id"));
return false;
}
...
When the code just before the 'if( window.ice ...) was commented out, so that the form submitted normally, the problem went away. So, the only different between this example working and not working, is that when in the container, the example posts through the ice.upload function. So that function, must be serializing the input type submit buttons incorrectly.
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
The javascript in submitFunction in native-interface.js was refactored to create a serialization tail end part to be appending to the post in the ice.upload function. There were several places in the code where ice.upload is called directly from javascript in the page, and these areas would not pass a serialization tail as an argument, hence the value of undefined.
A simple solution was to add a guard statement to the upload function to not append undefined values.