0

I'm extending a few page builder components. I need to disable the new inputs until the link url inside of Content has a value

page builder banner form

I can easily disable an input by using the value from another checkbox/select/input but the Link URL works different

This is what I have tried in the pagebuilder_banner_form.xml

<field name="test_input" sortOrder="96" formElement="checkbox">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="default" xsi:type="string">true</item>
                <item name="disabledValues" xsi:type="array">
                    <item name="none" xsi:type="string"></item>
                </item>
            </item>
        </argument>
        <settings>
            <dataType>boolean</dataType>
            <label translate="true">Test Input</label>
            <dataScope>test_input</dataScope>
            <imports>
                <link name="setDisabled">ns = ${ $.ns }, index = link_url:value</link>
            </imports>
        </settings>
        <formElements>
            <checkbox>
                <settings>
                    <valueMap>
                        <map name="true" xsi:type="string">true</map>
                    </valueMap>
                    <prefer>toggle</prefer>
                </settings>
            </checkbox>
        </formElements>
    </field>

I also tried <link name="setDisabled">ns = ${ $.ns }, index = link_url:value.default</link> which kinda works when I open the banner setting the first time but after I save it doesn't work any more.

1 Answer 1

0

Use like this:

<argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabledValues" xsi:type="array">
                        <item name="none" xsi:type="string">default</item>
                    </item>
                </item>
            </argument>

and

            <imports>
                <link name="setDisabled">ns = ${ $.ns }, index = link_url:value</link>
            </imports>
1
  • Thanks for the answer. Unfortunately, I'm not working with Magento anymore so I can't verify whether this solution works or not.
    – Gezzasa
    Oct 5, 2021 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.