cq5。在对话框中使用pathField xtype

问题描述:

我想在组件的对话框中使用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? – g*

+0

@ rakhi4110,我需要按f12页面? – g*

链接的答案介绍了如何实现动态路径字段(例如,允许根据当前网站设置不同根路径的路径字段)。如果你想创建一个单一的,正常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和使用的最小属性(可能带有示例)? – g*

+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 – g*