[Silk UI Web] Issue refreshing section expandable

[Silk UI Web] Issue refreshing section expandable

  
Forge Component
(52)
Published on 15 Nov (4 weeks ago) by OutSystems R&D
52 votes
Published on 15 Nov (4 weeks ago) by OutSystems R&D

We are migrating from 9.0.1 to 10 and run across an issue with section expandable. We have a screen with a list records on it. The list is made up of webblocks with a section expandable in it. In the content of each section is a checkbox where users can mark the content of the section as read. After marking it as read the section should collapse. In the action we do an ajax refresh of the widget. In the old version the widget refreshed and would return to the collapsed state for the IsExpanded is False. After the upgrade the widget stays expanded and doesn't seem to be looking at the "IsExpanded" parameter. How can we have the same behaviour as before?

please advise.


Cheers,


Frank

Hi Frank,

Are you using an upgraded version from 9.1 to 10, or are you already using a recent version published in Forge for 10?

My regards

Hi Dinis,

We are using a recent version for 10. I've also reproduced the issue in my cloud environment which I've shared in the attached file. It's a simplified application with a button in the content section of the SectionExpandable. If you click the title to expand the section and click the button it refreshes to the expanded state, it shouldn't be expanded because the IsExpanded property is set to False. If you expand another SectionExpandable and click the button in that one first and then click on the button in the SectionExpandable you originally openend it isn't expanded.

Thanks Frank, we will take a took to see how can we fix the problem for a next release.

Hi,

I think we might have a similar problem: We have several expand sections. And on top a link: collapse all. On that we have an action where we set to false the variables linked to IsExpanded property and then we do an ajax refresh. If I expand a section manually then press the collapse all it doesn't work. We debugged and saw that after the ajax refresh the section expands again. If you think this is same problem can you tell me when the next release with the fix will be? Or do you know how can we achieve expand all/ collapse all functionality in another manner?

Thank you!


Hi,

Sorry for the late reply, I did some tests and unfortunatelly there is no easy way to workaround.

The quickest way I could find is to change the SectionExpandable Pattern and remove the logic that handles the Ajax Refresh.

Basically the SectionExpandable has it's own logic that restores their state after an ajax refresh, so they ignore the IsOpen parameter when it happens, the parameter is only used for the first render of the page.

I've attached an OML with both examples and the customized Block, hope it helps :)


Dinis Carvalho wrote:

Hi,

Sorry for the late reply, I did some tests and unfortunatelly there is no easy way to workaround.

The quickest way I could find is to change the SectionExpandable Pattern and remove the logic that handles the Ajax Refresh.

Basically the SectionExpandable has it's own logic that restores their state after an ajax refresh, so they ignore the IsOpen parameter when it happens, the parameter is only used for the first render of the page.

I've attached an OML with both examples and the customized Block, hope it helps :)


Thank you Dinis, the customized component works well for us :)


Hi Dinis,

During tests we found a small issue with the custom component. Inside it we have some containers that will be visible only if the user checks something. When this is the case the expandable section doesnt expand to show all of the content. I think commenting those lines affected other functionalities. I can imagine for this scenario we will have to customize ourselves the javascript in there.