This topic contains 5 replies, has 2 voices, and was last updated by Andrey Yatsenko 5 years, 9 months ago.
Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.
- CreatorTopic
- June 25, 2018 at 1:23 am #30941
I’m trying to add new file import button to my view and when it submits should redirect to my controller.
Are they anyway to working on this?
- CreatorTopic
- AuthorReplies
- June 25, 2018 at 6:52 am #30942
Hi chathura,
Please clarify, do you want to use standard import dialog and just redirect the user after import completed to another route?
Or you just want to add a simple button with a redirect to the controller that is not related to standard import scenario.June 25, 2018 at 9:52 pm #30943Hi Andrey,
I want to add standard import button and when the user submits redirect to my own controller and then I can process with my custom import process.becouse from the import I’m going to update some table as well.
Thank you,
ChathuraJune 27, 2018 at 12:30 am #30944You can solve the problem from another direction.
1) enable standard import for an entity
2) create custom import strategy based on \Oro\Bundle\ImportExportBundle\Strategy\Import\AbstractImportStrategy or one of its child strategies.
There are plenty of examples of custom strategies in the core.
You probably will need to override or extend theafterProcessEntity($entity)
methodI’d recommend to start from
\Oro\Bundle\ImportExportBundle\Strategy\Import\ConfigurableAddOrReplaceStrategy
strategy as it’s fully functional.As an example, I guess you can use CustomerStrategy.php
June 27, 2018 at 10:31 am #30945Hi Andrey.
Thank you very much for your solution.One more thing.
If I want to add a simple upload button with a redirect to the controller that is not related to standard import scenario.
Then how can add button in view and redirect to the controller?
Thank you,
ChathuraJuly 2, 2018 at 10:27 pm #30946You can add buttons to “navButtons” block of entity templates, first check templates you want to extend, there can be placeholders so you can add buttons without extending template https://github.com/oroinc/platform/tree/master/src/Oro/Bundle/UIBundle#introduction-to-placeholders
If there are no placeholders defined in navButtons section, you can override the template on an application level, check the Symfony documentation how to do this https://symfony.com/doc/2.8/templating/overriding.html
- AuthorReplies
The forum ‘OroCRM’ is closed to new topics and replies.