[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: PASOE/REST/DOH Custom .map file

Status
Not open for further replies.
J

jts-law

Guest
Peter, Today I figured out how to get around this. Since my combo box is a single select, I will only ever have 1 value passed to the mapper service. This means I don't need the extent. I changed my map, method, and javascript convert method as follows and this looks to be working (although having just got it going today I haven't tested much). Note, as I continued testing I also found I had to change the contentType and add another query parameter. .map file: "/CustValueMapper": { "GET": { "contentType": "application/x-javascript", "entity": { "name": "CustList", "function": "CustValueMapper", "arg": [ { "ablName": "", "ablType": "INTEGER", "ioMode": "RETURN", "msgElem": {"type": "StatusCode", "name": null} }, { "ablName": "callback", "ablType": "CHARACTER", "ioMode": "INPUT", "msgElem": {"type": "QUERY", "name": "callback"} }, { "ablName": "search_value", "ablType": "CHARACTER", "ioMode": "INPUT", "msgElem": {"type": "QUERY", "name": "value"} }, { "ablName": "response", "ablType": "CHARACTER", "ioMode": "OUTPUT", "msgElem": {"type": "BODY", "name": null} } ] } } } ABL method: METHOD PUBLIC INT CustValueMapper(INPUT callback AS CHARACTER, INPUT search_value AS CHARACTER, OUTPUT response AS CHARACTER): oJTSConfig:Logit(5, "CustValueMapper() search_value: " + search_value). response = callback + "([0])". RETURN 200. END METHOD. JS method: convertValues(value) { let data = {}; // value = $.isArray(value) ? value : [value]; // for (let idx = 0; idx < value.length; idx++) { // data["values[" + idx + "]"] = value[idx]; // } data["value"] = value; // Not a multiselect so return single value return data; } I'm still working out the details for the actual ABL mapper method but basically it needs to find the record and return the index of it within the full temp table data used for the combo box. It would still be nice to figure out how to pass an array of data to an ABL extent field. Somebody will eventually need to use this for pre-fetching data for a combo box, dropdown, grid, etc. Louis

Continue reading...
 
Status
Not open for further replies.
Top