Auto complete with json display bug

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
kyosuke
New User
Posts: 16
Joined: Mon Jan 18, 2016 5:50 am
First Name: alexis
Last Name: boisson
Company Name: tereva
Contact:

Auto complete with json display bug

Post by kyosuke »

Hello,

i create a universal display file to do a web service in JSON and use the autocomplete choice URL
so i follow this example http://www.profoundlogic.com/docs/display/PUI/Textbox
but i use RPGLE progamme to valuate PNAME and PRID
universal.JPG
universal.JPG (67.27 KiB) Viewed 727 times
rpgle.JPG
rpgle.JPG (33.04 KiB) Viewed 727 times
i also valuate the query parameter for create JSON with the paramete enter in textbox
and i map the URL /TST_JSON to my programe in PUIMAPP

so in my screen on the textbox i add in choice url my link
url.JPG
url.JPG (55.24 KiB) Viewed 727 times
kyosuke
New User
Posts: 16
Joined: Mon Jan 18, 2016 5:50 am
First Name: alexis
Last Name: boisson
Company Name: tereva
Contact:

Re: Auto complete with json display bug

Post by kyosuke »

so i make some test and its seems to work well
baignoire.JPG
baignoire.JPG (293.73 KiB) Viewed 725 times
but when i write "vasque double" the programe send me the good json but the auto complete div is not open and when i foce the div with display: block
it dosent display the good result it show me the last result
vasque.JPG
vasque.JPG (300.22 KiB) Viewed 725 times
so the JSON is good just the data in div is not good and its make it for some word but not all just a few.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Auto complete with json display bug

Post by Scott Klement »

Your Universal record for "content" looks wrong to me.

The problem that I see is that there is a comma at the end of your data. This is a problem because it is not legal in JSON to have a comma at the end of the data unless there is another element that follows it. So the following would be valid:

Code: Select all

[
  { data },
  { data },
  { data }
]
But the following would not be valid (and this is what yours would look like)

Code: Select all

[
  { data },
  { data },
  { data },      <-- extra comma at the end makes it NOT valid
]
The Universal display file has a feature to solve this problem automatically. Please remove the trailing comma from your "content" record. Without the comma it should look like this:

Code: Select all

{
   "PNAME": "[nom]",
   "PRID": "[num]"
}   < -- NO COMMA HERE
then change the "separator" property for the record format to contain a comma. the Universal display handler will automatically put a seperator between elements (but not after the last one).
comma.png
comma.png (10.12 KiB) Viewed 714 times
Let me know if that helps
kyosuke
New User
Posts: 16
Joined: Mon Jan 18, 2016 5:50 am
First Name: alexis
Last Name: boisson
Company Name: tereva
Contact:

Re: Auto complete with json display bug

Post by kyosuke »

I can't test it this week , but I will keep you informed
kyosuke
New User
Posts: 16
Joined: Mon Jan 18, 2016 5:50 am
First Name: alexis
Last Name: boisson
Company Name: tereva
Contact:

Re: Auto complete with json display bug

Post by kyosuke »

Hello,

I tried your solution and it still not work but i see a little difference, when JSON work he appear like that
fonctione.JPG
fonctione.JPG (138.37 KiB) Viewed 690 times


and when the he dont, like that
fonctione_pas.JPG
fonctione_pas.JPG (140 KiB) Viewed 690 times
Any idea?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Auto complete with json display bug

Post by Scott Klement »

There is an error in your JSON somewhere. You will need to discover where it is and fix it.
kyosuke
New User
Posts: 16
Joined: Mon Jan 18, 2016 5:50 am
First Name: alexis
Last Name: boisson
Company Name: tereva
Contact:

Re: Auto complete with json display bug

Post by kyosuke »

Hello,

Inded i tested my json in validator and i find error with a quote in a label

thank you for your time.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests