OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – HTML, JavaScript, CSS, Design Questions Close dialog widget after form submission

This topic contains 6 replies, has 4 voices, and was last updated by  franconob 7 years ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #34672

    franconob
    Participant

    Hi there. I’m adding a new button to the navbar using the UI.clientButton macro and the following code:

    I didn’t have to create a new template, I’m using the default OroB2BAccountBundle:AccountUser:update.html.twig. The form displays just fine, and I’m able to submit the form and save the entity. But when I do that, the dialog remains opened, displaying an empty page and looking at the network console on Chrome, I see the following code:

    I found out that the previous code belongs to the OroUIBundle:actions:update.html.twig template.

    My question are:
    1) Should ORO close the dialog widget automatically?
    2) There is a datagrid with the id account-user-by-account-grid in the same page that is not being reloaded after form submission. What I’m doing wrong?
    3) What does the widget.trigger(‘formSave’) trigger does? Do I have to listen manually to this event?

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #34673

    Mike Kudelya
    Participant

    Hi

    I suggest you copy (only as test, further you must extend AccountUser bundle) your OroB2BAccountBundle:AccountUser:update.html.twig to AccountBundle/Resources/views/AccountUser/dialog/update.html.twig and set there following code after {% block content_data %}:

    #34674

    franconob
    Participant

    ok, it worked! Thanks!

    #34675

    vodvud
    Participant

    Hi Mike!

    I tried set code after {% block content_data %} but it doesn’t work.
    Because block content_data has been overwritten after save.
    https://github.com/orocrm/platform/blob/master/src/Oro/Bundle/UIBundle/Resources/views/actions/update.html.twig#L14-L26

    It works like this one

    and in action returned like this

    It is confused me, why I can’t use your way?

    #34676

    Mike Kudelya
    Participant

    Hi

    Here is my src/OroCRM/Bundle/AccountBundle/Resources/views/Account/view.html.twig with ‘Agregar usuario a cuenta’ button:

    and src/OroCRM/Bundle/AccountBundle/Resources/views/Account/dialog/update.html.twig:

    Try to override this files in orocrm and check popup will close or not.

    #34677

    prganvani
    Participant

    Can any one help me to solve this.
    when i render my custom create form just like orocrm_account_create but face
    —> Error: Invalid server response:
    this error how to solve this????

    #34678

    franconob
    Participant

    Hello prganvani, can you post more information about the error? Does it happen when submitting the form? If that’s the case, check the network tab in the developer tools in chrome or firefox. If the error message is just “Invalid server response”, you can check the web server logs to see if it says more about the error. If not, run the app in env=dev using app_dev.php in the url and check the network tab in the browser again.

Viewing 6 replies - 1 through 6 (of 6 total)

The forum ‘OroPlatform – HTML, JavaScript, CSS, Design Questions’ is closed to new topics and replies.

Back to top