Multiple-choice list box from table
- baudwalker
- Veteran Member
- Posts: 188
- Joined: 2015-02-03 08:08
- Location: Bellingen NSW Australia
Multiple-choice list box from table
Is the a way to set up a Multiple-choice list box, similar to what is available in the options list, but the selections are from a table field in stead of using the options list?
-
- Veteran Member
- Posts: 61
- Joined: 2017-03-12 09:24
Re: Multiple-choice list box from table
Yes, this page https://bigprof.com/blog/appgini/a-work ... gini-apps/
describes how to create a selection from table data
describes how to create a selection from table data
- baudwalker
- Veteran Member
- Posts: 188
- Joined: 2015-02-03 08:08
- Location: Bellingen NSW Australia
Re: Multiple-choice list box from table
Thank you for point this out I will see if it can be implemented in my situation
- baudwalker
- Veteran Member
- Posts: 188
- Joined: 2015-02-03 08:08
- Location: Bellingen NSW Australia
Re: Multiple-choice list box from table
This has been working fine, but now I have another project that I wish to populate multi-choice list by adding records to the table but with a further twist.
Each user will have a different list created by their own table entries. I would require something like {tablename}.{fieldname}.{user}.csv. can this be done?
Each user will have a different list created by their own table entries. I would require something like {tablename}.{fieldname}.{user}.csv. can this be done?
Re: Multiple-choice list box from table
Hi baudwalker,
I think I have a similar problem described here ( viewtopic.php?f=2&t=4098 ) - but have not gotten any solution so far.
There is some possibility I am considering at this time which I will describe in a second.
Some ideas first:
a) Why not follow the idea pbötcher's link (to the blog) holds, but extend the 'tags' table by another column 'customer'. Depending on how busy your table is, you might pull only those 'tags' from that table that match the customer and write those to the file.
b) You should take a look at the AG functions that are looking for that csv on your server. Probably it should be quite easy to change that function to use the name-extension you are suggesting. One drawback: That function will probably be overwritten when you regenerate your app in AG.
A quick check on one of my applications shows that this seems to be in the (not hooks directory) /tablename_dml.php file. Look for the function
There you find something like
You should be able to apply your suggestion there, something like this:
Remember: The file will be overwritten when the app is being recreated.
.... well, so only theory, not tested!
Olaf
I think I have a similar problem described here ( viewtopic.php?f=2&t=4098 ) - but have not gotten any solution so far.
There is some possibility I am considering at this time which I will describe in a second.
Some ideas first:
a) Why not follow the idea pbötcher's link (to the blog) holds, but extend the 'tags' table by another column 'customer'. Depending on how busy your table is, you might pull only those 'tags' from that table that match the customer and write those to the file.
b) You should take a look at the AG functions that are looking for that csv on your server. Probably it should be quite easy to change that function to use the name-extension you are suggesting. One drawback: That function will probably be overwritten when you regenerate your app in AG.
A quick check on one of my applications shows that this seems to be in the (not hooks directory) /tablename_dml.php file. Look for the function
Code: Select all
function YourTablename_form(
Code: Select all
if(is_file(dirname(__FILE__).'/hooks/YourTablename.YourFieldName.csv')) {
$YourFieldName_data = addslashes(implode('', @file(dirname(__FILE__).'/hooks/YourTablename.YourFieldName.csv')));
Code: Select all
if(is_file(dirname(__FILE__).'/hooks/YourTablename.YourFieldName.csv')) {
$mi = getMemberInfo();
$username = $mi['username'];
$YourFieldName_data = addslashes(implode('', @file(dirname(__FILE__).'/hooks/YourTablename.YourFieldName.' . $username . '.csv')));
.... well, so only theory, not tested!
Olaf
Some postings I was involved, you might find useful:
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
- baudwalker
- Veteran Member
- Posts: 188
- Joined: 2015-02-03 08:08
- Location: Bellingen NSW Australia
Re: Multiple-choice list box from table
Thank you Olaf
That looks like what I require.
The database is very active on certain day with about 1000 users. Each may have their own .csv file.
I will have a go at you idea in a few days and see how I go.
Barry
That looks like what I require.
The database is very active on certain day with about 1000 users. Each may have their own .csv file.
I will have a go at you idea in a few days and see how I go.
Barry