Skip to main content
5-Regular Member
December 21, 2015
Solved

How to save runtime information

  • December 21, 2015
  • 4 replies
  • 2664 views

Hi,

I would like to create a list with checkboxes and process the rows that were checked. In order to the that, I am using  the Repeater widget. I couldn’t use a simple grid because I need to enable accessibility of each checkbox during runtime (if the checkbox should be disabled or not) .As far as I understand that is not possible today in Grid widget.

Do you have any suggestions how and where should I cache the values of all the rows that were checked, besides using Thing properties or session parameters (because then a user can access these properties from different tabs)?

Moreover, is it recommended to save runtime information in mashup parameters?

Thank you

    Best answer by

    When you bind your data to the grid, make sure the property/column is a boolean.

    You can then edit the grid columns. Choose the column, check the Editable checkbox, as well as to make sure the Render is set to Boolean and that Format is Checkbox

    1.PNG2.PNG

    Then, to bind out the new edited data, you will need to wire the EditedTable to a service that will parse the data.

    If you are married to a repeater, I may be able to talk you through that one, but it gets more complicated.

    4 replies

    Answer
    December 23, 2015

    When you bind your data to the grid, make sure the property/column is a boolean.

    You can then edit the grid columns. Choose the column, check the Editable checkbox, as well as to make sure the Render is set to Boolean and that Format is Checkbox

    1.PNG2.PNG

    Then, to bind out the new edited data, you will need to wire the EditedTable to a service that will parse the data.

    If you are married to a repeater, I may be able to talk you through that one, but it gets more complicated.

    melisb5-Regular MemberAuthor
    5-Regular Member
    December 24, 2015

    Hi Jason,

    Thank you for your answer. Regarding the repeater, could you please elaborate?

    Currently my problem with the repeater is obtaining the runtime information from it. Meaning, where should I save the values of the rows that were checked, in order to use them later in the mashup that contains the repeater (besides Thing’s properties or session parameters)?

    Another question, is there a way to change grid's editable option on runtime?

    Thanks

    December 24, 2015

    There is not a way to change grid's editable option on runtime. You'd have to modify the grid widget.

    This gets a lot harder using a repeater.

    The basics: when data changes in a row, use the data change events on controls to update a copy of the data (an INFOTABLE) that is sitting somewhere in memory. You could put this on a thing, you could put it on a user(extension), perhpas best you could add it to the Session shape.

    Then the flow goes like this:

    On mashup load, copy the persisted data from wherever it is to this temporary location - presumably a session INFOTABLE property.

    Then, load the repeater data from the session. You will need an identifier value in there somewhere.

    As data changes in each individual mashup row, it needs to update the session INFOTABLE.

    When you are done making changes, you will need to have a button to "Save changes" which will really just copy the INFOTABLE from the session back to wherever it is being persisted.

    If you are just using checkboxes, this is a huge pain in the butt for something that can already be done with a grid.