Page 1 of 1

Get the display value of a text entry field?

PostPosted: Wed Dec 09, 2015 1:02 am
by joe26
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.

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

PostPosted: Wed Dec 09, 2015 3:39 pm
by Joas
There is a function for this under the application node:
Code: Select all
var displayValue = application.getValueListDisplayValue(valuelistName, realValue)

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

PostPosted: Wed Dec 09, 2015 6:16 pm
by joe26
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!