ssossossossosso

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 10 months ago.

  • Creator
    Topic
  • #29069

    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
  • #29070

    Mike Kudelya
    Moderator

    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 %}:

    #29071

    franconob
    Participant

    ok, it worked! Thanks!

    #29072

    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?

    #29073

    Mike Kudelya
    Moderator

    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.

    #29074

    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????

    #29075

    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)

You must be logged in to reply to this topic.