Hello,
I am trying to hide the “OK” and “Close” buttons on a popup form and call the “save,close” action on a different button. Is there anyway to achieve this?
Thank you in advance for taking the time.
Hi,
On which kind of popup you want to acheive this ? Do you have an example ?
Regards
Hello, again.
I’m sorry if that wasn’t descriptive enough.
I meant this kind of form, the one that pops up after clicking
Hi,
This form is the view “permission-form
” but it’s a popup and not a classic view displayed by an action as a tab.
For this reason, you can’t modify it using a parameter.
From my point of view the only way to acheive this is to modify the widget.dialog.js
file directly. The problem is that this file is shared for all dialogs so becarefull with the impact of your modification.
Regards
@noredine there is no way to hide these buttons on a popup. They are part of the popup and depending on the source field, the behavior can be different. For exemple, when clicking on ‘+’ from a m2m, the “Ok” will save the record but from a o2m, the record is saved with the parent.
If this is a m2m, the [OK] button will call onSave actions define in the form.
If this is a o2m, no there is no way to change the [OK] button. Maybe you can achive your needs with onChange actions define on that o2m.
@p.belloy
I ended up using a separate button above the grid to call a pop up like so:
<button onClick="my-form-action"/>
The action
<action-view name="my-form-action" model="com.axelor.foo.bar.Mymodel" title="Form">
<view name="my-form" type="form"/>
<view-param name="popup" value="reload"/>
<view-param name="show-toolbar" value="false"/>
<view-param name="show-confirm" value="false"/>
<view-param name="popup-save" value="false"/>
<domain>self.parent.id = :_id</domain>
<context name="_id" expr="eval: id"/>
</action-view>
editing a row was a bit different
i disabled editing (canEdit=“false”)
<grid name="my-grid" model="com.axelor.foo.bar.Mymodel">
<button name="edit" onClick="my-form-action-edit" icon="fa-pencil"/>
<field name="name"/>
</grid>
action was
<action-view name="my-form-action-edit" model="com.axelor.foo.bar.Mymodel" title="Form">
<view name="my-form" type="form"/>
<view-param name="popup" value="reload"/>
<view-param name="show-toolbar" value="false"/>
<view-param name="show-confirm" value="false"/>
<view-param name="popup-save" value="false"/>
<view-param name="forceEdit" value="true"/>
<context name="_showRecord" expr="eval: id"/>
</action-view>
or something like this