textbox autocomplete return value

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
CAPL_INFO
Profound User
Posts: 38
Joined: Wed Jul 19, 2017 4:54 am
First Name: Nadine
Last Name: Gauthier
Company Name: CAPL
Country: France
Contact:

textbox autocomplete return value

Post by CAPL_INFO »

Hi,

Is there a way to retrieve return data value from a textbox autocomplete with javascript (data return by "choice values field" to the server)

Thanks
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: textbox autocomplete return value

Post by Scott Klement »

The value in the textbox will be placed into whatever variable is bound to the 'value' property. This will be returned to the server when the screen is submitted.

Is that what you're asking?
CAPL_INFO
Profound User
Posts: 38
Joined: Wed Jul 19, 2017 4:54 am
First Name: Nadine
Last Name: Gauthier
Company Name: CAPL
Country: France
Contact:

Re: textbox autocomplete return value

Post by CAPL_INFO »

not exactly,
The value property appears on the screen but the value return to the server may be different.
example : appear on screen the name of articles but return the id of article selected
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: textbox autocomplete return value

Post by Scott Klement »

Okay, I think I understand.

The "Choice Values Field" is returned in the "value" property. But, what is shown on the screen is the "Choice Options Field". You want the value on the screen (the value from the Choice Options Field) to be sent to your server-side program.

To do that, I would:

1) Create a textbox bound to a character field large enough to contain the entire "Choice Options Field".
2) Mark this textbox as "hidden" so the user cannot see it.
3) Set the ID of the hidden textbox to something that makes sense (I used id = "hiddenTextbox")
4) Make sure you know the ID of the "normal" textbox (the one that has autocomplete.)
5) In the "normal" textbox's "onselect" event code this:

Code: Select all

pui.set("hiddenTextbox", pui.get("normalTextbox"));
The Onselect event runs when the user makes a choice from the auto complete list. So each time that happens, it gets the value that was selected in the normal textbox (the value you see on the screen) and sets the hidden textbox to that value. When the screen is submitted to the server, the server-side program can read the field that was bound to the hidden textbox to get the value.
CAPL_INFO
Profound User
Posts: 38
Joined: Wed Jul 19, 2017 4:54 am
First Name: Nadine
Last Name: Gauthier
Company Name: CAPL
Country: France
Contact:

Re: textbox autocomplete return value

Post by CAPL_INFO »

Hi,

In fact, i want to know if i can retrieve the textbox1.cl value of auto complete textbox by an official way.

Thanks.
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: textbox autocomplete return value

Post by Scott Klement »

Hello,

What do you mean by the "textbox1.cl value"? I'm not familiar with that.

-SK
CAPL_INFO
Profound User
Posts: 38
Joined: Wed Jul 19, 2017 4:54 am
First Name: Nadine
Last Name: Gauthier
Company Name: CAPL
Country: France
Contact:

Re: textbox autocomplete return value

Post by CAPL_INFO »

Hello,

it's the value return when user select an item on list.
textbox1.cl.value represent data return by "choice values field" to the server.
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: textbox autocomplete return value

Post by Scott Klement »

When the user selects an item on the list, the 'choice value' is placed in the 'value' property. This is already submitted to the server automatically.

With regards to the 'textbox1.cl' value. I assume based on your clarification that you are doing something like this?

Code: Select all

var textbox1 = getObj("TextBox1");
Then, textbox1.cl looks like the value you need? I would strongly discourage you from using 'cl' in that case.

Profound UI uses a 'minify' type of tool to reduce the size of our JavaScript code. This makes it smaller, load faster, and use less memory. Minifying the code involves (amongst other things) changing the variables that we use internally into shorter names. These names are generated on-the-fly, and can be different each time it is minified.

In your case, I suspect its resulting in the name 'cl'. However, if you install a patch or update to the next version of Profound UI, it may have a completely different name. This means that with every update you make to Profound UI, you will have to change your code.
CAPL_INFO
Profound User
Posts: 38
Joined: Wed Jul 19, 2017 4:54 am
First Name: Nadine
Last Name: Gauthier
Company Name: CAPL
Country: France
Contact:

Re: textbox autocomplete return value

Post by CAPL_INFO »

Scott Klement wrote:When the user selects an item on the list, the 'choice value' is placed in the 'value' property. This is already submitted to the server automatically. my answer : not necessarily, it can be different

With regards to the 'textbox1.cl' value. I assume based on your clarification that you are doing something like this?

Code: Select all

var textbox1 = getObj("TextBox1");
yes

Then, textbox1.cl looks like the value you need? I would strongly discourage you from using 'cl' in that case.
that's why i said officially
Profound UI uses a 'minify' type of tool to reduce the size of our JavaScript code. This makes it smaller, load faster, and use less memory. Minifying the code involves (amongst other things) changing the variables that we use internally into shorter names. These names are generated on-the-fly, and can be different each time it is minified.

In your case, I suspect its resulting in the name 'cl'. However, if you install a patch or update to the next version of Profound UI, it may have a completely different name. This means that with every update you make to Profound UI, you will have to change your code.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests