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.

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

HasOneComplexTableField - Suppress editing


Go to End


4 Posts   1776 Views

Avatar
Krigu

Community Member, 7 Posts

29 April 2010 at 6:41am

Hi

I'm trying to disable the possibility to add/edit the datas of my "second object" in my HasOneComplexTableField. All I want is that the user can select one record from the second object of my one to one relationship. When I call setDisabled(true), I can't select a record anymore.

Any help would be appreciated

Thanks

Avatar
Willr

Forum Moderator, 5523 Posts

29 April 2010 at 11:47pm

Perhaps use the setPermissions(array()) to set the permissions to nothing. (no add / edit).

Avatar
swaiba

Forum Moderator, 1899 Posts

19 November 2010 at 2:36am

Hi,

I've added...

		$hasOneCTF = new HasOneComplexTableField($this,'Purchaser','Purchaser');
		$hasOneCTF->setPermissions(array('edit','show'));
		$fields->addFieldToTab("Root.Purchaser", $hasOneCTF);

..to allow users to edit a fixed has_one object. But it shows a radio button (that seems to act like a checkbox) on the left of the one record that would allow unsetting the relationship. Is it possible to remove this as the user should not be allowed to do this!

Any information is greatly appreciated!

Avatar
swaiba

Forum Moderator, 1899 Posts

19 November 2010 at 2:43am

gotcha...

$hasOneCTF->Markable = false;