PDA

View Full Version : [FIXED IN 2.2.20101103.0] vvOut.columnData = 'Y' producing invalid JSON?



Hugo A. Cantor
10-05-2010, 09:32 AM
Hello,
vvOut_toJSON seems to be producing invalid JSON when vvOut.columnData is set to ‘Y’. I made a copy of program EXGRIDPGKY and set vvOut.columnData to ‘Y’ right before the call to vvOut_toJSON. I tested the program via the new "Test RPG Call" (great feature by the way) . The results showed two consecutive double quotes before the ‘sortable’ attributes of each of the column field objects within the "columns" array and a semicolon at the end of the "columns" array. Below is the part of the JSON response. I've attempted to set the color of the first two consecutive double qoutes and the semicolon to red.

Removing one of the DQ in the source of VVCODE's vvCode_columnModel procedure on line 115 and adding vvCode.withinComponent = 'Y' to vvOut_toJson right before the call to vvCode_columnModel fixed the problem.

-thanks

{"morePrev":"0","moreNext":"1","columns":[{"header":"<b>Cust#</b>","width":66,""sortable":true,"dataIndex":"CUSNO"},{"header":"<b>Customer Name</b>","width":225,""sortable":true,"dataIndex":"CNAME"},{"header":"<b>Cust Addr: Line 1</b>","width":225,""sortable":true,"dataIndex":"CADDR1"},{"header":"<b>Cust Addr: Line 2</b>","width":225,""sortable":true,"dataIndex":"CADDR2"},{"header":"<b>City</b>","width":175,""sortable":true,"dataIndex":"CCITY"},{"header":"<b>State</b>","width":55,""sortable":true,"dataIndex":"CSTATE"},{"header":"<b>Country</b>","width":140,""sortable":true,"dataIndex":"CCOUNTRY"},{"header":"<b>Zip</b>","width":110,""sortable":true,"dataIndex":"CZIP"},{"header":"<b>YTD Sales</b>","width":121,""sortable":true,"dataIndex":"CYTDSALES"},{"header":"<b>Activity Dt</b>","width":121,""sortable":true,"dataIndex":"CLASTACT"} ];,"DEMOCMAST":

sean.lanktree
10-05-2010, 10:07 AM
Thanks for reporting this Hugo (and for the solution). Just fixed this in our source too.

richard.milone
10-05-2010, 10:12 AM
This has been confirmed as a bug in 2.2.20100930.0. I'm moving this thread to the Bug Reports forum so it can be tracked properly.

sean.lanktree
10-05-2010, 10:20 AM
For anybody who wants to fix this before our next maintenance release, change the following.

Module VVOUT
Add the following line of code twice, after line# 280.00 and 636.00.


vvOut.withinComponent = 'Y';


Module VVCODE
Go to line number 115.00 and remove the last DQ+ from the statement. It should now look like...


DQ+'width'+DQ+':'+%char(width)+COMMA+


Now compile both as a module. Next, update the service program: UPDSRVPGM SRVPGM(VALENCE22/VVSRVPGM) MODULE(VVOUT VVCODE). Last, restart the server instance.