dynamic list for a table column

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

dynamic list for a table column

#1

Postby xren » Wed Oct 29, 2014 3:12 pm

Hello,

Another question about table:

I would like to have a table column as a dynamic drop down list.
The list need to be build based on the login use's role.

Can this be done?

Thanks,
Laura
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Wed Oct 29, 2014 4:13 pm

You can build any type of dynamic drop down list - this part is relatively easy. But the more difficult question is how to get the user's role. I don't know how your logon mechanism is working, but the standard way to do this is to call the Logon Service and then build the roles there - and then a user can have any number of roles, not just one. If this is the way it's done on your system, then getting the user's role is difficult. After the logon has completed, the API just allows you to check whether a user has a named role e.g.

Code: Select all

system.securityManager.hasRole("Role1");
but there is no getRoles() method, so you can't loop through all roles.

How are you setting the user's role? Maybe we can think of another way.
0 x

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

#3

Postby xren » Thu Oct 30, 2014 12:41 pm

Hi Jon,

I can get the role, but when I try to build the list. It does not work. The dropdown list does not show for that column.

tables.xxxxx.column.list.buildList()

Should I loop through all the rows to call the above or it will do it once for all rows? (now neither works for me)

Xiaoli
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#4

Postby Jon » Thu Oct 30, 2014 1:36 pm

You only have to build the list for each row if the list has an additional field mapped to another table column. Otherwise it should be fine to just build the list once.

The fact that you don't see a dropdown implies that something is wrong with the list. You should check the list fields are correctly mapped, also you might check the debug option in the Dynamic List editor so you can see the SQL.

Regards
Jon
0 x

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

#5

Postby xren » Fri Oct 31, 2014 3:40 pm

Hi Jon,

You are right. it works now.

Thank you very much!
Xiaoli
0 x


Who is online

Users browsing this forum: No registered users and 4 guests