Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Force refresh of ComplexTableField in CMS

Go to End



Community Member, 26 Posts

3 June 2010 at 4:34pm

Hi all,

IN a particular page of my current project I have two tabs that display ManyManyComplexTableFields. What I want to do is the following:

If the many-many relationship controlled by the first tab has data selected (ie it's not an empty set) then the second many-many relationship is auto populated with some related data from the first dataset (but only if the second dataset is empty. If it has any data in it at all then leave it alone).

I have the logic correct in my function to perform the populatio0n and this is tested and working correctly. However, in order for the second manymanycomplextablefield to reflect the updated dataset I have to move off the page in the CMS and then back onto it then select the appropriate tab.

I have tried to use the onBeforeWrite function but this doesn't trigger a refresh of the CTF in the second tab.

How can I trigger a refresh of a CTF programatically?