Get the display value of a text entry field?

Questions, tips and tricks and techniques for scripting in Servoy

Get the display value of a text entry field?

Postby joe26 » Wed Dec 09, 2015 1:02 am

Hello,

I'm attempting to get the display variable of a text field, that is populated in a type_ahead by a valuelist.
Using the Servoy Security Framework with multiple windows doesn't work, since the UUIDs are all new, so must use the element_name.

I've hit this before and wrote a work-around, but have that need again. Worked around, but trying to understand where I couldn't go before.

I can get the dataprovider, element name, form name, mixed with other functions, and it always circles around to the data value, not the display value.

Cannot see the forest from the trees...

The text field is of type TYPE_AHEAD.
The dataprovider is tied directly to the record.element_uuid.
The valuelist is ['name','uuid'].

var elementNames = security.getElementUUIDs(form_name);
for (var index = 0; index <= elementNames.getMaxRowIndex();index++){
elementNames.rowIndex = index;
if (elementNames.uuid == element_uuid){
element_name = elementNames.name;
break;
}
}

What do I need to call to get the display value of the text field?

thanks,
--Joe.
joe26
 
Posts: 172
Joined: Wed Jun 19, 2013 10:30 pm

Re: Get the display value of a text entry field?

Postby Joas » Wed Dec 09, 2015 3:39 pm

There is a function for this under the application node:
Code: Select all
var displayValue = application.getValueListDisplayValue(valuelistName, realValue)
Joas de Haan
Yield Software Development
Need help on your project? yieldsd.com
User avatar
Joas
Site Admin
 
Posts: 842
Joined: Mon Mar 20, 2006 4:07 pm
Location: Leusden, NL

Re: Get the display value of a text entry field?

Postby joe26 » Wed Dec 09, 2015 6:16 pm

I didn't see that this time around, but it doesn't give me the display value for global method-based valuelist. Something that didn't make it in the edit on my post.

"Retrieve a valuelist display-value for a real-value. NOTE: this doesn't return a value for a valuelist that depends on a database relation or is a global method valuelist."

I'll just cache the results from the method.

Thanks, Joas!
joe26
 
Posts: 172
Joined: Wed Jun 19, 2013 10:30 pm


Return to Methods

Who is online

Users browsing this forum: No registered users and 10 guests