Skip to content

Widget node depends with block parameter #7252

Closed
@gabs77

Description

@gabs77

On Magento 2.1.2, When we create specific widget, the node "depends" has some difficulties to turn well.

    <parameter name="url_type" xsi:type="select" visible="true" required="true">
            <label translate="true">Type Link Bloc</label>
            <options>
                <option name="product" value="product" selected="true">
                    <label translate="true">Product</label>
                </option>
                <option name="custom" value="custom">
                    <label translate="true">Custom</label>
                </option>
            </options>
        </parameter>
        <parameter name="id_path_product" xsi:type="block" visible="true">
            <label translate="true">Product</label>
            <depends>
                <parameter name="url_type" value="product"/>
            </depends>
            <block class="Magento\Catalog\Block\Adminhtml\Product\Widget\Chooser">
                <data>
                    <item name="button" xsi:type="array">
                        <item name="open" xsi:type="string" translate="true">Select Product...</item>
                    </item>
                </data>
            </block>
        </parameter>
        <parameter name="custom_url" xsi:type="text" visible="true">
            <label translate="true">Link Bloc</label>
            <depends>
                <parameter name="url_type" value="custom"/>
            </depends>
        </parameter>

Expected result

When the user select the type parameter as product, the custom link parameter has hidden and the product link has show.
When the user select the type parameter as custom, the product link parameter has show and the product link has hide.

Actual result

When the user select the type parameter as product, the custom link parameter has hidden. It's perfect.
When the user select the type parameter as custom, the product link parameter has always shown.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions