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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Widgets /

Discuss SilverStripe Widgets.

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

Use has_many in widget


Go to End


2 Posts   1774 Views

Avatar
x75

Community Member, 43 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, 1899 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 :)