0

我一直在努力禁用内容并忽略填充在选择字段中的数据,该选择字段构成 CQ5 对话框附带的多字段的一部分

下面是不工作的代码

    <medicineType
         jcr:primaryType="cq:Widget"
        fieldLabel="medicine Type : "
        name="./medicinetype"
        blankText="medicine Type"
        type="radio"
        xtype="selection">
        <options jcr:primaryType="cq:WidgetCollection">
          <inactive
            jcr:primaryType="nt:unstructured"
            text="medicine Lead"
            value="medicinelead" />
          <active
            jcr:primaryType="nt:unstructured"
            text="doctor Lead"
            value="doctorlead" />
        </options>
              <listeners jcr:primaryType="nt:unstructured" 
        selectionchanged="function(box,value){
        if(value == 'medicinelead'){
            var ans =     box.findParentByType('dialog').form.findField('./medicinedoctorset'); 
            ans.setDisabled(true);  
        ans.getEl().up('.x-form-item').setDisplayed(false);
            }
            "/>
    </medicineType>

    <medicinedoctorset
        fieldLabel="doctor cards"
        jcr:primaryType="cq:Widget"
        name="./medicinedoctorset"
        xtype="multifield">
        <fieldConfig
          jcr:primaryType="cq:Widget"
          type="select"
          options="/apps/doctor-api/components/medicineview/doctorcards.json"
          optionsRoot="doctorcards"
          optionsTextField="label"
          optionsValueField="id"
          xtype="selection" />
      </medicinedoctorset>
4

1 回答 1

0

不确定您到底想在代码中做什么,但在我看来,您正在尝试禁用特定的字段医学医生集。尝试将 id 添加到要禁用的字段,获取和禁用该字段为 CQ.Ext.getCmp("idOfTheFieldToBeDisabled").setDisabled(true); 希望这可以帮助。

于 2014-04-23T08:34:39.683 回答