Hello, when using this on a database value list with on column not shown, but returned and the either column shown, but not returned, I get no results…
Thanks
Patrick
Servoy 2.1b5
Hello, when using this on a database value list with on column not shown, but returned and the either column shown, but not returned, I get no results…
Thanks
Patrick
Servoy 2.1b5
I’m afraid I don’t understand the question.
Could you reformulate ?
THX
If I do this
var test = application.getValueListItems('name_of_value_list')
var test1 = test.getMaxRowIndex()
I always get test1 = 0 if the value list is set to
column_1: return in dataprovider yes, show in field no
column_2: return in dataprovider no, show in field yes
The value list shows values as expected, just the method doesn’t.
This only happens when the valuelist is nowhere shown on any form, only defined?
no. at least the problem remains after I attached that value list in question to a field.
I think it happens when the value list comes over a relation. I do get values for value lists that derive directly from a table.
From the explanation/sample “Get all values from a custom or database type value list”, related valuelist is not possible.
and will not be?
I can understand that it is a problem if you want to access something that depends on a record (relation) and you don’t even know which record we are talking about since we might be somewhere else.
I just use relations pretty often for value lists with a global on the left side. So actually, I am retrieving all values from a table but with some condition to it…
not planned, you can loop over the related foundset records already.
I just had that problem again. You ask a field for its value list and want to get its values. In my test case it was a related value list, so there are no values.
Now this
not planned, you can loop over the related foundset records already.
doesn’t help, because I don’t know the relation used. I either need to get access to the relation or to get the values using getValueListItems. Otherwise I am not able to solve my task in an abstract way…
Couldn’t this be done somehow? I think it is confusing to developers that in some cases getValueListItems() simply does not return anything, although these values show just fine…
Its very hard if not even impossible.
For example there are many orders_to_orderdetails relatedfoundsets (since every order record has one) and the function getValuelistItems does not have any context about what related valuelist you are talking.
Ok, although I don’t exactly understand why it it so hard since the value list is filled with those values, maybe something like application.getValueListRelationName() could be done? Then I could loop…
In Servoy 3.5b4 the foundset itself will have a function getRelationName() which returns the relation name if the foundset object is a related foundset
Now that is a really helpful functionality (I have to do this in a plugin today)! But it doesn’t help in my situation.
I want to be able to get the items of a value list, of which I only know the name. getValueListItems() does that well for “normal” value lists, but not for related. To get items from a related value list, I can walk over the foundset. But how do I figure out which relation is used in the value list?
That’s why I suggest something like application.getValueListRelationName(String relationName). Maybe it could be worth to create a method node for its own for dealing with value lists, so not the whole application node is full of value list stuff.
If I may add this wish, while you are at this kind of thing: it’d be very helpful to have a method getServerName() and getTableName() in the relations node. So when I have a relation, I can get its server and table names…
If I may add this wish, while you are at this kind of thing: it’d be very helpful to have a method getServerName() and getTableName() in the relations node. So when I have a relation, I can get its server and table names…
Just realized that with the introduction of JSFoundSets, this is already possible in 3.5…