axelor / axelor-open-platform

Open source Java framework for business application development
http://axelor.com
Other
391 stars 298 forks source link

context in view action #96

Open abdelazizelesh opened 3 years ago

abdelazizelesh commented 3 years ago

I have 2 view actions with different context value to show and hide some fields based on context value in if conditions. The problem is that the grid columns are not changed until i do browser refresh ctrl+f5.

<action-view name="partner.active" title="All"
                 model="com.axelor.mymodule.base.db.Partner">
        <view type="grid" name="partner-grid"/>
        <view type="form" name="partner-form"/>
        <context name="_Active" expr="true"/>
    </action-view>

<action-view name="partner.inactive" title="All"
                 model="com.axelor.mymodule.base.db.Partner">
        <view type="grid" name="partner-grid"/>
        <view type="form" name="partner-form"/>
        <context name="_Active" expr="false"/>
    </action-view>

<grid edit-icon="false" name="partner-grid" title="Partner"
          canNew="false" canEdit="false" canArchive="false" canDelete="false" canMove="false" canSave="true"
          model="com.axelor.mymodule.base.db.Partner">
        <field name="name"/>
        <field name="status" selection="select.partner.status"/>
        <field name="subscription" if="_Active"/>
    </grid>

Please advice

abdelazizelesh commented 2 years ago

any solution for this issue