choices parameter value 2

Use this board to ask questions or have discussions with other Rich Displays users.
Bruno97
Profound User
Posts: 61
Joined: Wed Jul 16, 2014 8:35 am
First Name: BRUNO
Last Name: HAJJAR
Company Name: APLUS INFORMATIQUE
Phone: 0664771058
Address 1: 9 AVENUE HENRI MATISSE
Address 2: IMMEUBLE MATISSE
City: NICE
Zip / Postal Code: 06200
Country: France
Contact:

choices parameter value 2

Post by Bruno97 »

Hi all,

I am testing the auto-complete feature and everything works fine if the choices selection criteria includes only one question mark (?).
But as soon as I include 2 question marks and add a choices parameter value 2, I cannot get it to work.

My choices selection criteria looks like this :

Code: Select all

VAR1=? and VAR2=?
My choices parameter value looks like this :

Code: Select all

script: get("X1");
My choices parameter value 2 looks like this :

Code: Select all

script: get("X2");
Please someone help !

Thanks,
Bruno
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: choices parameter value 2

Post by Scott Klement »

What sort of problem do you have? Have you verified that the values that are extracted and sent are the correct ones (you'd do this with a Javascript debugger)? Can you explain more about what's happening?
Bruno97
Profound User
Posts: 61
Joined: Wed Jul 16, 2014 8:35 am
First Name: BRUNO
Last Name: HAJJAR
Company Name: APLUS INFORMATIQUE
Phone: 0664771058
Address 1: 9 AVENUE HENRI MATISSE
Address 2: IMMEUBLE MATISSE
City: NICE
Zip / Postal Code: 06200
Country: France
Contact:

Re: choices parameter value 2

Post by Bruno97 »

Thanks for the reply Scott,

Unfortunately, I'm a bit lost in the runtime.js code and I don't know what to look for ?
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: choices parameter value 2

Post by Scott Klement »

runtime.js is not meant for someone to read... Just look at the network monitor to see what values are being sent to the server for the parameter markers.
Bruno97
Profound User
Posts: 61
Joined: Wed Jul 16, 2014 8:35 am
First Name: BRUNO
Last Name: HAJJAR
Company Name: APLUS INFORMATIQUE
Phone: 0664771058
Address 1: 9 AVENUE HENRI MATISSE
Address 2: IMMEUBLE MATISSE
City: NICE
Zip / Postal Code: 06200
Country: France
Contact:

Re: choices parameter value 2

Post by Bruno97 »

I have a first list box containing Countries, a second one containing let's say... Districts.
I'm trying to implement Database-driven auto-complete on a textbox in which you type in the City name, without having to press the Enter key.

The js code I'm trying to write is supposed to send both variables (Countries and Districts) to the browser so the auto-complete feature works.
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: choices parameter value 2

Post by Scott Klement »

Thanks for that description. It gives me a much clearer idea of what you'd like to do -- but I still don't understand why your example isn't working, I don't know what's going wrong -- all I know at this point is that you say that you can't get it to work.

So I decided to try writing one of my own to see if I can make it work. I don't have your files, of course, so I had to make something up... this is what I came up with:

Code: Select all

 create table location (
   locid numeric(3, 0),
   locname char(50),
   cntry char(2),
   region char(1)
 )
Then to give me some sample data in the file, I did this:

Code: Select all

insert into location
values(1, 'Northern Canada', 'CA', 'N'),
      (2, 'Eastern Canada', 'CA', 'E'),
      (3, 'Western Canada', 'CA', 'W'),
      (4, 'Southern Canada 1', 'CA', 'S'),
      (5, 'Southern Canada 2', 'CA', 'S'),
      (6, 'Southern Canada 3', 'CA', 'S'),
      (7, 'USA North A', 'US', 'N'),
      (8, 'USA North B', 'US', 'N'),
      (9, 'USA North C', 'US', 'N'),
      (10, 'USA South A', 'US', 'S'),
      (11, 'USA South B', 'US', 'S'),
      (12, 'USA South C', 'US', 'S'),
      (13, 'Germany All', 'DE', 'N'),
      (14, 'Germany All', 'DE', 'S'),
      (15, 'Germany All', 'DE', 'E'),
      (16, 'Germany All', 'DE', 'W')
Maybe not the most realistic data in the world -- but should suffice for testing this program. So... now that I have a file that I can subset based on country/region, I created a screen like this:
paracomp-display.png
paracomp-display.png (6.15 KiB) Viewed 2669 times
The properties for te auto-complete look as follows (tried to make this match what you said you were doing):
paracomp-dataprop.png
paracomp-dataprop.png (12.6 KiB) Viewed 2669 times
This all worked nicely for me. I did not have any problems. When I select, for example, 'US - United States', 'South' and type 'US' into the textbox, my screen looks like this:
paracomp-display.png
paracomp-display.png (6.15 KiB) Viewed 2669 times
So all is working nicely... can you tell me what I need to do in differently in order to reproduce the problem you're having?
Attachments
paracomp-success.png
paracomp-success.png (15 KiB) Viewed 2669 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: choices parameter value 2

Post by Scott Klement »

I've attached the complete RPG, DDS and SQL code that I used for my test program if you want to give it a try...
Attachments
paracomp.zip
(1.83 KiB) Downloaded 257 times
Bruno97
Profound User
Posts: 61
Joined: Wed Jul 16, 2014 8:35 am
First Name: BRUNO
Last Name: HAJJAR
Company Name: APLUS INFORMATIQUE
Phone: 0664771058
Address 1: 9 AVENUE HENRI MATISSE
Address 2: IMMEUBLE MATISSE
City: NICE
Zip / Postal Code: 06200
Country: France
Contact:

Re: choices parameter value 2

Post by Bruno97 »

Thanks a lot Scott,

I'll give it a try tomorrow as it is already midnight here in France...
I will let you know anyways.

Bruno
Bruno97
Profound User
Posts: 61
Joined: Wed Jul 16, 2014 8:35 am
First Name: BRUNO
Last Name: HAJJAR
Company Name: APLUS INFORMATIQUE
Phone: 0664771058
Address 1: 9 AVENUE HENRI MATISSE
Address 2: IMMEUBLE MATISSE
City: NICE
Zip / Postal Code: 06200
Country: France
Contact:

Re: choices parameter value 2

Post by Bruno97 »

Hi Scott,

Your example is a bit different in a sense mine is sort of dynamic.

I have 3 fields :
Country : REPAYS
District : REDEPT
City : RELIB

These 3 fields have all Database-driven selection.

What I'm trying to do is :

1) I select a country (field REPAYS) in a select box.
In the onchange event I have this :

Code: Select all

applyProperty("REDEPT", "choices parameter value", get("REPAYS"));
applyProperty("REDEPT", "field type", "select box");
applyProperty("RELIB", "choices parameter value", get("REPAYS"));
applyProperty("RELIB", "field type", "textbox");
getObj("REDEPT").focus();
On the REDEPT (field #2, select box) choices parameter value, I have this :

Code: Select all

script: get("REPAYS");
This automatically populates the second select box, each time I select a new country.
This first step works fine.

2) I then select a district in the 2nd select box (field REDEPT).
On the onchange event, I wrote this in order to "send" both variables (country and district) to the city textbox, so the auto-complete feature could work :

Code: Select all

applyProperty("RELIB", "choices parameter value", get("REPAYS"));
applyProperty("RELIB", "choices parameter value 2", get("REDEPT"));
applyProperty("RELIB", "field type", "textbox");
getObj("RELIB").focus();
On the RELIB (field #3, textbox) choices parameter value, I have this :

Code: Select all

script: get("REPAYS");
And on choices parameter value 2, I have this :

Code: Select all

script: get("REDEPT");
Unfortunately, when I select a district, nothing happens in the network panel (js debugger).
The RELIB field gets the focus by the way.

Is there something wrong here ?

Bruno
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: choices parameter value 2

Post by Scott Klement »

You shouldn't need to use applyProperty() for the two 'parameter value' properties. They are set to -- script: get("someID") -- and this will run each time a user types a character into the autocomplete textbox. So you shouldn't need to apply these properties when the country/district changes, since it will re-get them when you type into the autocomplete.

Also, you say that when you select a district, nothing happens in the network panel... well, it shouldn't, since the autocomplete only fires off a network event when you type into the autocomplete box. It's different from a select box in that respect... a select box fires off the network event when it's rendered (so forcing it to re-render by setting it's field type will make it fire a network event to get it's data.) But, an autocomplete box runs an SQL statement when a keypress is received -- so applying it's field type won't help, you have to press a key in the text box.

Does that help?
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest