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.

General Questions /

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

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

Force refresh of ComplexTableField in CMS


Reply


967 Views

Avatar
PapaBear

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?

Cheers
James.