2017-02-09 73 views
0

我正在嘗試sensenet功能,我的重點是內容類型內的參考字段。內容類型實例化:參考字段的摘錄值

我定義了&成功安裝了以下內容類型。

<?xml version="1.0" encoding="utf-8"?> 
<ContentType name="EmployeeCT" parentType="GenericContent"handler="SenseNet.ContentRepository.GenericContent" xmlns="http://schemas.sensenet.com/SenseNet/ContentRepository/ContentTypeDefinition"> 
<DisplayName>Employee Record</DisplayName> 
<Description></Description> 
<Icon>Content</Icon> 
<AllowIncrementalNaming>true</AllowIncrementalNaming> 
<AllowedChildTypes>EmployeeCT</AllowedChildTypes> 
<Fields> 
<Field name="Manager" type="Reference"> 
    <DisplayName>Manager</DisplayName> 
    <Description></Description> 
    <Configuration> 
    <AllowMultiple>false</AllowMultiple> 
    <AllowedTypes> 
     <Type>EmployeeCT</Type> 
    </AllowedTypes> 
    <SelectionRoot> 
     <Path>/Root</Path> 
    </SelectionRoot> 
    <!--<DefaultValue>/Root/Path1,/Root/Path2</DefaultValue>--> 
    <ReadOnly>false</ReadOnly> 
    <Compulsory>false</Compulsory> 
    <VisibleBrowse>Show</VisibleBrowse> 
    <VisibleEdit>Show</VisibleEdit> 
    <VisibleNew>Show</VisibleNew> 
    </Configuration> 
</Field> 
</Fields> 
</ContentType> 

問題是我找不到&選擇經理的員工。

請任何幫助,

謝謝。

回答

1

以前保存過的EmployeeCT類型的內容嗎?因爲您將其設置爲唯一允許的類型作爲「管理器」字段的值。

我檢查了我的本地網站上的代碼,它的工作原理。首先,我必須保存員工記錄以爲經理創建內容,然後我可以將其選爲新員工記錄的經理。