Programatically selecting all checkboxes in the rows of a table

Home Forum General Programatically selecting all checkboxes in the rows of a table

This topic contains 7 replies, has 0 voices, and was last updated by  Anonymous 8 years, 8 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #432

    Anonymous

    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?

    #5115

    ijobling
    Participant

    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

    http://www.perfectforms.com/Documentation/manual/html/fl_set_table_rows_behavior_comman.htm

    #5117

    Anonymous

    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.

    #5119

    ijobling
    Participant

    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 sure

    #5122

    Anonymous

    I have submitted a support ticket.

    #5123

    Anonymous

    Thanks Ian! Got your example…works perfectly. Do you know if there are any plans to adding a more straight forward loop control structure?

    #5125

    ijobling
    Participant

    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 release

    #5126

    Anonymous

    i, too, would love to see more looping controls.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.