I need two editable items to be mutually exclusive, such that when an admin user goes in to the edit interface and edits one, the other becomes greyed out (and blanked out).

Let's say I have something like this:

public sealed class MyPart : PartBase  
{
    [EditableTextBox]
    public string Text1 
    {
        get { return GetDetail(Names.Text1); }
        set { SetDetail(Names.Text1, value); }
    }

    [EditableTextBox]
    public string Text2
    {
        get { return GetDetail(Names.Text2); }
        set { SetDetail(Names.Text2, value); }
    }
}

In code, I can quite easily make these two text items mutually exclusive via the get/set functions, but how do I make them mutually exclusive in the N2 edit interface? Such that when the user types text into the Text1 box, the Text2 box becomes greyed out and read only and/or blanked out?

Is this achieved via a decoration/attribute in the code, or do I have to implement custom javascript?

If it is custom javascript, where and how do I plug my script into N2?

Thanks.

有帮助吗?

解决方案

Got an answer on the N2 forums here: http://n2cms.codeplex.com/discussions/277768

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top