I’m looking for some coding help with Datasets. I would like to create a Window with a list of all users where the operator can select his name and a password box will popup. This way they do not have to type in their username but only their password (cumbersome touchscreen). I think I need to create a Dataset using the system.user.getUsers("") function? I think the Dataset needs to be a Custom Property of the Window? From there I can reference the Dataset to fill my Window with buttons that have the Username on them. When they click the button the Username is passed to a popup Window where they simply have to enter their password. I hope this makes sense? I’m just stuck on how to get the User data into the Dataset.
I use something like this to put users into a list component.
headers = [“username”]
for user in users:
usersOut = system.dataset.toDataSet(headers,userList)
event.source.parent.getComponent(‘List’).data = usersOut[/code]
I used that to put the users directly into a DropDown component
users=system.user.getUsers("") #Get users from the default User Source.
headers = [“Username”] #create a list that has headers, only one header
userList= #Create another list that will be the user names
for user in users: #iterate through the list of users
userList.append([user.get(user.Username)]) # add each row to the list (you need to tab this line for proper syntax as part of the for loop.
usersOut = system.dataset.toDataSet(headers,userList) # create a dataset object
event.source.parent.getComponent(‘DD_User’).data = usersOut #put the dataset into this DropDown Component