Task: Implement an accordion, each accordion contains a webblock, within the webblock is a gallery, which is filtered on the accordion item value. On click on a gallery item, change the value of a boolean field, then refresh webblock, as the contained gallery styling is based on that boolean field.

Wordy, but I've created a sample OML which demonstrates my problem. 

When I click the gallery item, it updates the DB fine, but when I refresh the WebBlock to update the styles, the gallery items all change to that of the last accordion item. I think this is because my WebBlock input is

ListRecords1.List.Current.Accordions.Label

and on refresh it is therefore defaulting to them last item, rather than the item which is currently active in the accordion.

Any thoughts on how to get aroudn this?

Sample OML attached to replicate the issue I have...


Solution

Hi Steve,

Instead of refreshing the webblock you need to refresh the ListRecord. Also, in addition to save on the database, you need to update the the list that feeds the ListRecord so you can see the results on the screen.

In attachment your module with some changes.

Regards,

Marcelo

Solution

Marcelo Ferreira wrote:

Hi Steve,

Instead of refreshing the webblock you need to refresh the ListRecord. Also, in addition to save on the database, you need to update the the list that feeds the ListRecord so you can see the results on the screen.

In attachment your module with some changes.

Regards,

Marcelo

Thank you! All works & displays as I expected, however now OnClick, when it refreshes the ListRecord it removes the gallery structure. Any idea why/how I can rectify?

Revised OML attached with some additional records to show the problem.

(I did reply before, but then worked out something minor & edited, so this is a fresh upload)