Skip to main content

Hi !

 

I have a strange behavior (at least it's strange to me) on one of my SmartForms (4.6.11).

 

Briefly, here's my goal :

I have a list view, displaying some smartbox values that are bound to a request. User can't edit the rows, nor add or remove them directly. The view has a button which clears the rows, and opens a subview. The subview is merely a CheckBoxList, in which the user checks the item he wants, and when he submits, all the checked items are passed to the parent liste view.

 

When submitting the form, a rule executes the Create method for all items that have been added, and Delete for all items that have been removed from the list view.

 

 

The "Create" part works well, but I can't get it to work as intended when I update.

 

The save rule is very simple :

 - Delete all items removed from the list view (i.e. all items that were present when the form loaded, but removed by the "Clear" when I click my button)

 - Create all items added to the list view (i.e. all items I checked in my subview)

 

But the actual behavior simply ignores all items that were removed. Same thing with a Foreach Loop bound to the "Removed" rows.

 

Is it normal, that "Clear" doesn't seem to mark the rows as "removed" ?

How could I workaround this issue ?

 

Hope that was clear enough. Any lead greatly appreciated :)

 

Regards

Hi nlucas

 

Not sure if this will fix your issue, but try adding a "Apply all changes to the Editable List" action after the Delete action. You may also need to make the list view editable, but remove all of the associated toolbar buttons and rules (basically you want to have the edit row visible in designer but not allow user to edit).


Hi,

 

Thanks for the answer !

 

Sadly, it didn't change anything. The rows are never considered "removed" when we use clear.

 

We had to use hidden fields : the first contains all the values in the list when the form is loaded, and the second contains the values of the list that has been modified. We also have a hidden CBL containing the values of the list when the form is loaded (we use it to foreach through it later).

At loading both are the same.

 

Each time we submit the subview qith the new values, the list gets updated, as well as the second hidden field.

 

When the form gets submitted, we then compare the list with the content of the hidden fields : 

 - each value of the list that is not in the first hidden field is to be created (Means that the value was not there at loading, but is here at submit)

 - each value of the hidden CBL that is not in the second hidden field is to be deleted (Means that the value was there at loading, but not anymore at submit)

 

Not the way I'm used to do thing, but it does the job :)

 

Hope this can help someone !


Reply