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.

Widgets /

Discuss SilverStripe Widgets.

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

Use has_many in widget


Reply


2 Posts   893 Views

Avatar
x75

Community Member, 42 Posts

20 November 2010 at 12:52am

Hi,

is there a way to use hay_many in a widget?

I can't find a way to get this to work in the gui.
DataObjectManager won't work. It displays a list, but when you try to add an entry, the popup opens and shows the 404 Page.
HasManyComplexTableField breaks the page completely.

Any other ideas?

Thanks
Johannes

Avatar
swaiba

Forum Moderator, 1805 Posts

27 November 2010 at 3:47am

Just an idea, but how about using a checkboxset field? You might have to do some magic to implode/explode the values into a "Text" field and then again explode it as required.

I've looked at the widgeteditor a bit to try (and talked to some other cleverer ss people) and do nice stuff you can use on forms, but it is restricted due to the way the id's of the fields are translated to be like multi-dimensional arrays - but hey it might be possible I just don't know how :)