Database-Driven Grid w/Multiple parameter values

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
mdruk1986
New User
Posts: 12
Joined: Fri Jan 08, 2016 5:54 pm
First Name: michael
Last Name: RICHARD
Company Name: sylacauga utilities board
Phone: 256 401 2501
State / Province: Alabama
Country: United States
Contact:

Database-Driven Grid w/Multiple parameter values

Post by mdruk1986 »

Hi all,
I have a display screen that i want to show transactions that are between two dates(Field ID's Date1,Date2), however i cannot get it to work. The selection criteria is as follows:

Code: Select all

YTDC='C' AND YDATE  >=? AND YDATE <=?
The parameter values are as follows:

Code: Select all

parameter value:  script: "1" + get("Date1").substr(6,2) + get("Date1").substr(0,2) + get("Date1").substr(3,2);
parameter value 2:  script: "1" + get("Date2").substr(6,2) + get("Date2").substr(0,2) + get("Date2").substr(3,2);
The event is fired from a onchange event for the Date2 field with the following code:

Code: Select all

applyProperty("Grid1", "parameter value", "1" + get("Date1").substr(6,2) + get("Date1").substr(0,2) + get("Date1").substr(3,2));
applyProperty("Grid1", "parameter value 2", "1" + get("Date2").substr(6,2) + get("Date2").substr(0,2) + get("Date2").substr(3,2));
applyProperty("Grid1", "field type", "grid");
getObj("Grid1").grid.refresh();
getObj("Grid1").grid.render();
If i remove the last AND clause from the selection criteria it works, however this is not what i need as that gives me records for everything greater than or equal to YDATE. Another note is that when i look at it in firebug, p1 is always equal to Date2 and p2 is 1. I have attached screen shots showing the firebug debugger and set up in visual designer. We are using version 5.3.2

Thanks for your help
Attachments
TransDesigner.jpg
TransDesigner.jpg (360.07 KiB) Viewed 3425 times
Trans1.jpg
Trans1.jpg (308.55 KiB) Viewed 3425 times
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: Database-Driven Grid w/Multiple parameter values

Post by Scott Klement »

In your network screen shot you can see it is returning only a "1" for parameter value 2. Since your code sets it to "1" followed by some substrings of "Date2", I'm guessing those substrings aren't working.

I would suggest debugging/troubleshooting your JavaScript code to determine what is going wrong.

1. Check if the get("Date2") is returning anything. If not, maybe the id of the widget is not "Date2", or maybe it is capitalized differently.

2. Check that the substr() code is correct.

3. Maybe split the code up so it's not all on one line, that'd make it easier to see what is wrong.

In any case, this looks like a bug in your code, not a bug in Profound UI.
mdruk1986
New User
Posts: 12
Joined: Fri Jan 08, 2016 5:54 pm
First Name: michael
Last Name: RICHARD
Company Name: sylacauga utilities board
Phone: 256 401 2501
State / Province: Alabama
Country: United States
Contact:

Re: Database-Driven Grid w/Multiple parameter values

Post by mdruk1986 »

Scott,
I used an alert to check the output and everything looked right. Any other ideas i can look into.

Thanks
User avatar
matt.denninghoff
Profound Logic Staff Member
Posts: 115
Joined: Wed Feb 10, 2016 3:53 pm
First Name: Matthew
Last Name: Denninghoff
Company Name: Profound Logic Software
State / Province: Ohio
Country: United States
Contact:

Re: Database-Driven Grid w/Multiple parameter values

Post by matt.denninghoff »

Are you saying you set the value of "parameter value 2" to something like this:

Code: Select all

script: alert("1" + get("Date2").substr(6,2) + get("Date2").substr(0,2) + get("Date2").substr(3,2));
and the alert box text was more than just a "1"?
mdruk1986
New User
Posts: 12
Joined: Fri Jan 08, 2016 5:54 pm
First Name: michael
Last Name: RICHARD
Company Name: sylacauga utilities board
Phone: 256 401 2501
State / Province: Alabama
Country: United States
Contact:

Re: Database-Driven Grid w/Multiple parameter values

Post by mdruk1986 »

Matt,
That is correct, as example the date picker "Date2" was selected to be "03/03/16" the alert would show "1160303". This is the format that the dates are stored in the AS400, CYYMMDD. However, to make debugging easier I changed the date fields on the display screen to textboxes and changed the parameter values script to: get("Date1") and it still acted the same.
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: Database-Driven Grid w/Multiple parameter values

Post by Scott Klement »

Are you saying that applyProperty() is stripping everything after the "1" from your value? In other words, if you do this, would it work better?

Code: Select all

getObj("Grid1").pui.properties["parameter value 2"] = "1" + get("Date2").substr(6,2) + get("Date2").substr(0,2) + get("Date2").substr(3,2);
If you use that instead of applyProperty() and it works, then it'd indicate a bug in the applyProperty() API, which should be reported to support@profoundlogic.com as a bug to be fixed.
mdruk1986
New User
Posts: 12
Joined: Fri Jan 08, 2016 5:54 pm
First Name: michael
Last Name: RICHARD
Company Name: sylacauga utilities board
Phone: 256 401 2501
State / Province: Alabama
Country: United States
Contact:

Re: Database-Driven Grid w/Multiple parameter values

Post by mdruk1986 »

Scott,
The problem was reproduced by the support team and they are working on it.
Thanks
User avatar
matt.denninghoff
Profound Logic Staff Member
Posts: 115
Joined: Wed Feb 10, 2016 3:53 pm
First Name: Matthew
Last Name: Denninghoff
Company Name: Profound Logic Software
State / Province: Ohio
Country: United States
Contact:

Re: Database-Driven Grid w/Multiple parameter values

Post by matt.denninghoff »

For reference, this is support issue 2497. It seems to be a bug with the applyProperty() API. It's in the developer queue waiting for a fix.
k2R400
Profound User
Posts: 62
Joined: Sat Feb 18, 2012 12:03 pm
First Name: Patrick
Last Name: THOMAS
Company Name: Oo2
Country: France
Contact:

Re: Database-Driven Grid w/Multiple parameter values

Post by k2R400 »

It's OK now for the "parameter value 2" of the apply applyProperty() ?
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: Database-Driven Grid w/Multiple parameter values

Post by Scott Klement »

This was fixed in Profound UI version 5.4.0
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest