Skip to Content
0
Former Member
Aug 09, 2016 at 04:02 PM

How to disable/hide one field based on the value of another field in dynamic attribute syntax

1446 Views

Dear All,

my requirement is to disable "deliver address" filed when the order status is "cancelled" or "cancelling" in backoffice. I think dynamic attribute is a good idea.

From the Dynamic Forms in UI Configuration,I create the following customization:

 <context type="AbstractOrder" component="editorAreaDynamicForms" module="platformbackoffice">
     <df:dynamicForms xmlns:df="http://www.hybris.com/cockpitng/component/dynamicForms">
         <df:attribute id="disabledeliveryAddress" triggeredOn="*" qualifier="deliveryAddress" disabledIf="status=='CANCELLED'" />
     </df:dynamicForms>
 </context>

But it doesn't work. "status=='CANCELLED'" is never triggered, status.equals("CANCELLED") also fails.

What I find, status is an object type (a single dropdown field) ,not simple text field.

Actually even all the samples in the official wiki page are all tested in simple fields.

The following is other example, if you manually input "CANCELLED" in the "status info" field, the "deliver address" filed will be disabled.

  <context type="AbstractOrder" component="editorAreaDynamicForms" module="platformbackoffice">
         <df:dynamicForms xmlns:df="http://www.hybris.com/cockpitng/component/dynamicForms">
             <df:attribute id="disabledeliveryAddress" triggeredOn="*" qualifier="deliveryAddress" disabledIf="statusInfo=='CANCELLED'" />
         </df:dynamicForms>
     </context>


Any experts have any ideas?

Thanks

Yan alt text

Attachments

6264-123.png (80.6 kB)