I have been struggling with trying to replicate a form I had in FMP, so far without success.
I have set up 3 tables as follows
Grants->grant_status->status
where:
grants is a list of activities (id is grant_id) and is my primary table,
status is a list of states that may apply to a grant (Emergency, Confidential, Donor Advised, On Hold),
none of which are mutually exclusive (id is status_id), and
grant_status is the n-m table holding grant_id and status_id to link them together. (id is grant_status_id)
I can get the appropriate status entries to show up in table form within a tabpanel (based on grant_status),
but I really want/need them to show up as a checkbox.
So far, no matter what I try, I only see the first value in the grant_status table for a given grant_id,
i.e. if both “Confidential” and “Donor Advised” are marked in the grant_status table, only “Confidential” will be checked.
The SQL looks fine, based on what I can see from a stacktrace; running it gives me the right rows, but no go on the interface.
I don’t really want to go to a calculated field since I need to have this be searchable; the same holds for html
(unless that can be made to work as a search field)
I would love some guidance on this, since my client will be very irked to lose this functionality.
Since no one has offered even a comment, I will follow up myself.
So far, I am finding working with checkboxes to be
a HUGE source of frustration.
Using checkboxes to store more than one value
for each record works fine in other apps (including
our whipping boy Filemaker), but making this work
in Servoy seems to be damn near impossible.
Following Johan’s suggestion, I went to a n-m approach
(as described above), but I have to use a calculated
field to have more than one value displayed (checked).
Of course, this screws the chance of doing searches,
since I am then back to having concatenated strings
in the calculation and wildcard matches don’t work.
In addition, I have to go override the find method to
do this, so I lose the ability to search on the rest of
the fields (as far as I can tell, since I have to go into
find mode, but I don’t have a way to pick up when
the user hits enter to actually do the search.
Can anyone tell me the value of checkboxes in Servoy?
The documentation on them is pretty thin (do a search
in any of the docs and find lots of mentions of “checking
the checkbox” for some option, but very little on how to
manage them in your own interface). Why do I have to
go through all of these contortions to make them work
as the users expect???
Excuse the venting, but I have been fighting with these
for over a week and so far have not made any real
progress. I would assume others are not trying to use
checkboxes for multiple values since no one has offered
any suggestions or comments.
It is possible to do this with an n-m table but here’s a sample solution using another approach.
It basically does following:
uses a global to capture the search criteria(popup dialog with all checkboxes)
converts content of the global into an array of the marked selections
loops through the array, creating find requests
(this would be an OR find, but you could make it more flexible using direct queries with filters that can be set by user in the popup dialog)
No need to create an n-m table.
Let me know if this would fit in into your conversion.
NB:
-for simplicity I’ve put the status in a custom valuelist
(but of course you can use a table instead)
please add some records(Ctrl+N) yourself. (there’s no data in the sample solution)