Small bug on MS3 - ejGridAdvanced.mipage

MiServer is Dyalog's APL-based web development framework

Small bug on MS3 - ejGridAdvanced.mipage

Postby woody on Tue Dec 20, 2016 5:59 pm

Greetings MS3 development team.

I spotted this little bug while testing the current release of MS3 (MiServer 3.0).

1. Edit the grid
2. Change value in a cell
3. Click SAVE icon (or click away to another cell)
4. SYNTAX ERROR

FYI.

Cheers,

//W

MS3-GRID-BUG.JPG
Woodley Butler
Automatonics, Inc.
"Find your head in the APL Cloud"
http://www.APLcloud.com
User avatar
woody
 
Posts: 144
Joined: Tue Dec 28, 2010 12:54 am
Location: Atlanta, Georgia USA

Re: Small bug on MS3 - ejGridAdvanced.mipage

Postby Brian|Dyalog on Sun Dec 25, 2016 4:34 am

Hi Woody!

This was an interesting issue because it looked like the code expected the data to have been already parsed as JSON and converted to APL form, but, instead we were just getting a character vector of the raw JSON. I think this may have been a result of the work we did a while back to rationalize event handling across all types of elements (HTML, jQuery widgets, Syncfusion widgets, and other widget libraries).

The interesting problem is how to distinguish data that should be interpreted as JSON versus something that someone might, for instance, type into a text input field. Is '"Test"' JSON or just a character vector with double quotes? So, I've added some additional intelligence when we know we're generating JSON data in the client that the server can leverage to translate things properly.

I've made the change and pushed it to the master MiServer branch on GitHub.

/Brian
User avatar
Brian|Dyalog
 
Posts: 116
Joined: Thu Nov 26, 2009 4:02 pm
Location: West Henrietta, NY

Re: Small bug on MS3 - ejGridAdvanced.mipage

Postby gil on Mon Dec 26, 2016 7:59 am

I haven't looked at the innards of MS3, but wouldn't the http header define the content type?
When would you need to guess the type?
gil
 
Posts: 71
Joined: Mon Feb 15, 2010 12:42 am

Re: Small bug on MS3 - ejGridAdvanced.mipage

Postby Brian|Dyalog on Mon Dec 26, 2016 5:39 pm

Hi Woody,

jQuery's ajax() function, which we use for handlers and callbacks, defaults to a MIME type of 'application/x-www-form-urlencoded; charset=UTF-8'. We could potentially set other MIME types (like 'application/json'), but that would require some recoding of the server side of event and callback handling.

/Brian
User avatar
Brian|Dyalog
 
Posts: 116
Joined: Thu Nov 26, 2009 4:02 pm
Location: West Henrietta, NY


Return to MiServer

Who is online

Users browsing this forum: No registered users and 1 guest