CheckboxList for Companies

CheckboxList for Companies

  

Hi, I have few question to ask on the checkbox-list for companies.

I have a maintenance screen for companies where user can key in/edit/delete.

1.In user screen, i need to list all the companies in checkbox-list and let system admin to check the countries which user can access to.I should have a main checkbox which can help to select/unselect all the checkboxlist.Does anyone has idea how to do that? How should i store the data for the country?A record of userid with countries but the column size is 4000 characters with each country is separated with comma?

2. After the countries has been assigned to user, system admin may log out from system.But if he log in again, he should see that all the selected chekboxlist is with ticked together with the unticked checkbox.How should i do this in Ousystems?


3.I have a transaction screen which need to show transaction records according to countries user can access to when page load.For example, i have a user can access to French,Germany,China,England and USA.How should i do in Ousystems?I should SQL widgets?

Solution

To check / uncheck all you can assign a different server action to this checkbox, which handles the code for checking or unchecking all others.

Storing the data....
A record of userid with countries but the column size is 4000 characters with each country is separated with comma?

Please don't do this. Just create an Entity something along the lines of:

UserCountryAccess
Id
UserId
CountryId

If you want to persist the data you have to save it in the database anyways, you could get the data from the entities in which you stored the data and use them to check or uncheck the checkboxes.

For the last problem you could do something like a WHERE IN clause in your SQL statement, using the Country list from aggregating the UserCountryAccess entity.

Solution

Thanks Claring,