Page 1 of 2

select box issue

Posted: Wed Jan 03, 2018 10:52 am
by hfckve
We recently upgraded from a year-old+ version of PL to 5.1.2. The Atrium database changed and we had to change our code that populates it with menus, but otherwise things worked correctly, or seemed to. But now the select box dropdowns won't populate from the database, which is otherwise accessed correctly. In the select box we have

Code: Select all

choices database file           CSVLLSP
choices options field            (CASE SUBSTR(INTVAL,1,1) WHEN  ' ' THEN ''' ''' ELSE INTVAL END) || ':' || CNDTXT
choices values field              INTVAL
choices selection criteria     @@CND=1103585 and CNDTYP='VAL'


This no longer works. produces an empty dropdown. The database is accessed correctly, for example, when displaying a master table of records, and clicking thru to the detail.

There is nothing obvious in the change logs. Any suggestions? Thanks

Re: select box issue

Posted: Wed Jan 03, 2018 10:54 am
by hfckve
We upgraded to 5.12.0 rather.

Re: select box issue

Posted: Wed Jan 03, 2018 11:14 am
by Scott Klement
All you've really told us is that the drop-down is blank. The properties are interesting, but I cannot try them, as I do not have your database tables on my system.

Please tell us:

1) What is the SQL statement that Profound UI is generating. You can find this by looking in the PUISSNVP file while your screen is running. You may have to page through the file to find it, but the SQL statement will be in there.

2) What error message you are getting. This can be found in the HTTP response in your browser's web tools. Or you can use the showErrors() API or the pui.showLastError() API to see the errors in a popup.

showErrors:
http://www.profoundlogic.com/docs/pages ... Id=3276849

pui.showLastError:
http://www.profoundlogic.com/docs/pages ... d=32211589
http://www.profoundlogic.com/docs/displ ... load+event

Re: select box issue

Posted: Wed Jan 03, 2018 12:10 pm
by hfckve
Thanks. PROFOUNDUI/PUISSNVP has records with 3 fields, session id, name and value, not an SQL stmt. The name on the last record is "genie.I_21_64" which is the genie id of the last select box on the page. The value is 32002.

The ondbload property for I_21_64 is

Code: Select all

if (!response.success) {
  pui.showLastError();
}
The Firebug console output for the page shows

Code: Select all

genie?skin=VG_Base:1 This page includes a password or credit card input in a non-secure context. A warning has been added to the URL bar. For more information, see https://goo.gl/zmWq3m.

genie?skin=VG_Base:20 Uncaught TypeError: Cannot set property 'innerHTML' of null
    at displayTime (genie?skin=VG_Base:20)

genie.js?mtime=20171006161526:575 Refused to set unsafe header "Content-Length"
send.send @ genie.js?mtime=20171006161526:575

This worked before our upgrade. Other database access is still correct. Thanks.

Re: select box issue

Posted: Wed Jan 03, 2018 12:19 pm
by Scott Klement
The SQL statement would be in the "Value" (PUISNNVAL) field. What is in the value field of your genie.I_21_64 record?

Re: select box issue

Posted: Wed Jan 03, 2018 12:39 pm
by hfckve
The field is PUISNVVAL. Value is

Code: Select all

SELECT DISTINCT (CASE SUBSTR(INTVAL,1,1) WHEN  ' ' THEN ''' ''' ELSE INTVAL END) || ':' || CNDTXT, INTVAL FROM CSVLLSP WHERE @@CND=1104244 and CNDTYP='VAL'
This executes on the iSeries and produces

Code: Select all

 CONCAT                                                                        INTERNAL
                                                                                     VALUE
 R                        :Repetitive                                          R               
 D                        :Discrete                                             D       
 

Re: select box issue

Posted: Wed Jan 03, 2018 12:44 pm
by Scott Klement
Okay, that looks like a legitimate SQL statement. (Despite that you said earlier that there wasn't an SQL statement there.) Look at the response from the PUI00091xx program in your browser's developer tools. What does it say?

Re: select box issue

Posted: Wed Jan 03, 2018 12:52 pm
by hfckve
Where do I find output of

{code}
PUI00091xx program
[/code]

in browser dev tools? Browser is Chrome, dev tools seem to be Firebug

Re: select box issue

Posted: Wed Jan 03, 2018 1:04 pm
by hfckve

Code: Select all

javascript:showErrors(); 
in the URL bar says no errors have occurred. The query seems to be executing correctly.

Re: select box issue

Posted: Wed Jan 03, 2018 1:04 pm
by Scott Klement
Firebug?! That's an old, obsolete, plugin for Firefox. Chrome has it's own built-in tools.

In Chrome, press Ctrl-Shift-I (or, if you prefer to use the menu, click "More tools" then "Developer Tools"). Then click "Network" at the top. Then, navigate to the screen with the drop down that isn't working.

For a database-driven dropdown, there should be a call to PUI0009103, so you'll see that come up in the network tab when it tries to load the drop down. (It will only show up if the screen is loaded after you've already opened the network tab, so you may have to exit and re-visit the screen if you opened the tab too late.) Click on the PUI0009103 line in the network tab, and then select "Response".