Issue with realValue in valuelist

Forum to discuss the new web client version of Servoy.

Issue with realValue in valuelist

Postby jay.rao » Mon May 14, 2018 11:19 am

Hi,

We have two different valuelists A and B, both the valuelists are made of Custom Values like A- Start|0, InProcess|10, Done|20 & B- i18n:globis.label.process|0,i18n:globis.label.complete|10 etc.
the dataprovider associated to components with the valuelists A and B are of type INTEGER in database.
Now the issue is when we debug the code at client-side the realValue for valuelist A is $scope.model.valuelist[].realValue = 10 while for B is $scope.model.valueslist[].realValue = "10" which causes problem with out custom components as it tries to match the datatype as well and in result sets the value to empty(component with valuelist B).
Is there any specifics that need to be done in order to keep the realValue same as defined in Custom Value property (of type int 10 instead of "10").


PS- we sometimes get the below error as well
ERROR com.servoy.j2db.util.Debug - The valuelist was already created for type: TEXT
for the dataproviders:
So it can't be used also for type: INTEGER for the dataprovider: status

Thanks in Advance,
Jay Rao
jay.rao
 
Posts: 59
Joined: Mon Apr 10, 2017 1:32 pm

Re: Issue with realValue in valuelist

Postby mboegem » Mon May 14, 2018 12:24 pm

Hi Jay Rao,

The problem is exactly what the error message tells you and what would have been my best guess if I wouldn't have had this information.

Somewhere in your solution, the valuelist is attached to a dataprovider of type TEXT.
In this case Servoy is converting the integer values of the valuelist to text values, so 10 becomes "10".

Maybe someone copied the element with dataprovider 'status' and the valuelist attached, and assigned a different dataprovider of type text to it.
But that's just one of the easiest explanations on why this could happen. The correct dataprovider could also have the wrong data-type, which in that case should be resolved in your database.

Quick way to find the exact cause:
Lookup the specific valuelist in the solution explorer, than right click an select the option 'search for references'
Unless you dynamically assigned this valuelist to an element with dataprovider of type TEXT, this should give you all an overview of all the places where the valuelist is used.

Hope this helps.
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1749
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 4 guests