2014-03-26 25 views
0

我想在組件的對話框中使用pathfield。cq5。在對話框中使用pathField xtype

根據link

我加

<myPathComponent 
     jcr:primaryType="cq:Widget" 
     fieldLabel="My path component" 
     plugins="customRootPathPlugin" 
     xtype="pathfield" /> 

我dialog.xml

我tryed型動物varians:

<?xml version="1.0" encoding="UTF-8"?> 
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 
    jcr:primaryType="cq:Dialog" 
    title="Example Component Dialog" 
    xtype="dialog"> 
    <items 
     jcr:primaryType="cq:Widget" 
     xtype="tabpanel"> 
     <items jcr:primaryType="cq:WidgetCollection"> 
      <tab1     
      <myPathComponent 
        jcr:primaryType="cq:Widget" 
        fieldLabel="My path component" 
        plugins="customRootPathPlugin" 
        xtype="pathfield" /> 

      /> 
     </items> 
    </items> 
</jcr:root> 
只在某些情況下後由組分雙擊我看到組分反應
<?xml version="1.0" encoding="UTF-8"?> 
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 
    jcr:primaryType="cq:Dialog" 
    title="Example Component Dialog" 
    xtype="dialog"> 
    <items 
     jcr:primaryType="cq:Widget" 
     xtype="tabpanel"> 
     <items jcr:primaryType="cq:WidgetCollection"> 

      <myPathComponent 
        jcr:primaryType="cq:Widget" 
        fieldLabel="My path component" 
        plugins="customRootPathPlugin" 
        xtype="pathfield" /> 


     </items> 
    </items> 
</jcr:root> 
<?xml version="1.0" encoding="UTF-8"?> 
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 
    jcr:primaryType="cq:Dialog" 
    title="Example Component Dialog" 
    xtype="dialog"> 
    <items 
     jcr:primaryType="cq:Widget" 
     xtype="tabpanel"> 


      <myPathComponent 
        jcr:primaryType="cq:Widget" 
        fieldLabel="My path component" 
        plugins="customRootPathPlugin" 
        xtype="pathfield" /> 



    </items> 
</jcr:root> 
<?xml version="1.0" encoding="UTF-8"?> 
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 
    jcr:primaryType="cq:Dialog" 
    title="Example Component Dialog" 
    xtype="dialog"> 



      <myPathComponent 
        jcr:primaryType="cq:Widget" 
        fieldLabel="My path component" 
        plugins="customRootPathPlugin" 
        xtype="pathfield" /> 




</jcr:root> 
<?xml version="1.0" encoding="UTF-8"?> 
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 



      <myPathComponent 
        jcr:primaryType="cq:Widget" 
        fieldLabel="My path component" 
        plugins="customRootPathPlugin" 
        xtype="pathfield" /> 




</jcr:root> 

。但也有出現空單:

enter image description here

我需要閱讀的解決我的問題是什麼?

+0

你有定義了「customRootPathPlugin」?您的開發者控制檯(F12)是否顯示任何錯誤? – rakhi4110

+0

@ rakhi4110我在哪裏可以知道定義或不定義我customRootPathPlugin? – gstackoverflow

+0

@ rakhi4110,我需要按f12頁面? – gstackoverflow

回答

0

鏈接的答案介紹瞭如何實現動態路徑字段(例如,允許根據當前網站設置不同根路徑的路徑字段)。如果你想創建一個單一的,正常pathfield插件對話框,下面的代碼就可以了:

<?xml version="1.0" encoding="UTF-8"?> 
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 
    jcr:primaryType="cq:Dialog" 
    title="Simple dialog" 
    xtype="dialog"> 
    <items jcr:primaryType="cq:WidgetCollection"> 
    <tabPanel 
     jcr:primaryType="cq:TabPanel" 
     xtype="tabpanel"> 
     <items jcr:primaryType="cq:WidgetCollection"> 
     <tab1 
      jcr:primaryType="cq:Widget" 
      anchor="100%" 
      title="General" 
      xtype="panel"> 
      <items jcr:primaryType="cq:WidgetCollection"> 
      <myPathComponent 
       jcr:primaryType="cq:Widget" 
       fieldLabel="My path component" 
       xtype="pathfield" /> 
      </items> 
     </tab1> 
     </items> 
    </tabPanel> 
    </items> 
</jcr:root> 
+0

是否可以在哪裏找到任何xtype-s和使用的最小屬性(可能帶有示例)? – gstackoverflow

+0

[Adobe文檔](http://dev.day.com/docs/en/cq/current/developing/widgets/xtypes.html)包含一個列表。 –

+0

http://dev.day.com/docs/en/cq/5-6/widgets-api/index.html?class=CQ.form.PathField – gstackoverflow

相關問題