You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This sort of relates to [https://github.com//issues/126] but could also be classed as a new issue. I can close and comment on the other one if that is the case.
When using BetterButtonNestedFormon an order object I am setting the order as archived and entering an invoice number, I then save the object that I was viewing from the custom action. This saves the object but gives errors. In updateBetterButtonsActionsI have a check to only show the archive button if the order is not archived and when I click the action to archive it I get the error "Action archive doesn't exist or is not a BetterButtonNestedForm". I assume this is because the button is not included as the order is now archived. I guess I can get around this by making sure to add a button that has the same type and action name but does nothing if the order is already archived, but this doesn't sounds like a great way or doing it.
Ideally it should be able to do one of 2 things:
On the saving of the BetterButtonNestedFormit updates the entire page so the archive button is not rendered on the page ( will have to happen before I close the dialog)
On save it redirects to the same page or another page. I can do a Controller::curr()->redirect('admin/orders'); from the custom action but this redirects the iframe in the ssdialog and not the parent page. I dont mind if it redirects back to the list page and shows all orders or the existing page but with updated information.
Is there already a work around to get past this issue? As updating the record you are viewing with a BetterButtonNestedFormseems like a fairly common task, but I note your example doesnt save data just send a message.
Cheers Adrain
The text was updated successfully, but these errors were encountered:
Just use BetterButtonBetterNestedForm::create() instead of BetterButtonNestedForm::create(). Make sure your actions return a string with a success message, it’ll get added to the parent form (the one outside the dialog) and perform a hard refresh
This sort of relates to [https://github.com//issues/126] but could also be classed as a new issue. I can close and comment on the other one if that is the case.
When using
BetterButtonNestedForm
on an order object I am setting the order as archived and entering an invoice number, I then save the object that I was viewing from the custom action. This saves the object but gives errors. InupdateBetterButtonsActions
I have a check to only show the archive button if the order is not archived and when I click the action to archive it I get the error "Action archive doesn't exist or is not aBetterButtonNestedForm
". I assume this is because the button is not included as the order is now archived. I guess I can get around this by making sure to add a button that has the same type and action name but does nothing if the order is already archived, but this doesn't sounds like a great way or doing it.Ideally it should be able to do one of 2 things:
BetterButtonNestedForm
it updates the entire page so the archive button is not rendered on the page ( will have to happen before I close the dialog)Controller::curr()->redirect('admin/orders');
from the custom action but this redirects the iframe in the ssdialog and not the parent page. I dont mind if it redirects back to the list page and shows all orders or the existing page but with updated information.Is there already a work around to get past this issue? As updating the record you are viewing with a
BetterButtonNestedForm
seems like a fairly common task, but I note your example doesnt save data just send a message.Cheers Adrain
The text was updated successfully, but these errors were encountered: