This topic contains 7 replies, has 0 voices, and was last updated by Anonymous 11 years, 7 months ago.
- March 3, 2010 at 3:49 pm #432
I am trying to setup a behavior to loop through the records of a table and set all the checkboxes of a column to checked. Here is what I have:
I have a table with a checkbox column and text input column(read only). Outside of the table I have a checkbox with a behavior for the event “Checkbox Changes Field Data”. When that event fires a simple branch checks if the checkbox is checked and if it is, it runs a set field command. In the set field command I have selected All rows of the column containing the checkbox field and in the formula I just have “Checked (Yes)”.
When this behavior runs all of the rows are removed except the first one. The checkbox is atleast checked, but the rest of the rows are gone. Is there a different way I should be doing this?March 3, 2010 at 5:20 pm #5115
not sure what you are saying… you say ‘set all checkboxes to checked’ but then refer later to ‘all rows are removed’
butas per your other post, to work with tables, the SetTableRow script is the better way to handle such things – especially here if you are looking to delete a row, there is a specific action for this in the SetTableRow
/Documentation/manual/html/fl_set_table_rows_behavior_comman.htmMarch 3, 2010 at 5:38 pm #5117
I have a table, which gets populated automatically from a connect command. The table has a checkbox column, not checked by default, and a text input column which is read only displaying text. Basically, I am using the table object to allow the user to make multiple selections, in this case account numbers. I prefer to use this over the list object because I wanted to use a checkbox for the selection. I also wanted to have two buttons that would allow the user to select all or none. Right now I am at the point of creating the behavior for this “all” button. When the user clicks that button I want to go through each item in the table and set the column with the checkbox to checked. Vice versa for the “none” button.
With what I have tried so far with the set field command, it was removing all of the items in the list except the first one, which wasnt what i wanted. I also played around with the SetTableRow command but I wasnt able to figure out a way to get it to loop through all of the rows of the table and set the checkbox column to checked. There will be a variable number of rows in the table, depending on the person’s number of accounts.March 4, 2010 at 10:03 am #5119
send over export of your form via the support ticket where you have tried the ‘settablerow’ method and happy to have a look and point you in the right direction. there is so much you can do with this ‘SetTableRow’ that once you see what it can do you will find lots of other uses I’m sureMarch 4, 2010 at 2:33 pm #5122
I have submitted a support ticket.March 4, 2010 at 3:50 pm #5123
Thanks Ian! Got your example…works perfectly. Do you know if there are any plans to adding a more straight forward loop control structure?March 4, 2010 at 4:19 pm #5125
Not that I know of, but if you can see a ‘gap’ where you can’t do what you want, please get back to us and I may be able to see how you can do it, and if not can raise it as a ‘is this possible to consider’ for a future releaseMarch 5, 2010 at 2:43 pm #5126
i, too, would love to see more looping controls.
You must be logged in to reply to this topic.