How to create MassAction like "update attributes"? - magento2

I created an mass action via this link: https://magecomp.com/blog/magento-2-add-custom-mass-action-in-product-grid/
And it works perfectly, however you get a different type of action than I want to create.
This is the type of mass action I have now:
And what I want is to open a new page just like on update attributes and then you can add attributes you need.
Where can I find .xml file and is there something I need to look out for? Link to a project that does the same would be appriciated.

Steps to Add Custom Mass Action in Product Grid in Magento 2:
Step 1: Go to the following path:
app\code\Vendor\Extension\view\adminhtml\ui_component\product_listing.xml
Step 2: After that, create the MassSalable.php file at the below path:
app\code\Vendor\Extension\Controller\Adminhtml\Index\MassSalable.php
Details can be found at: https://magecomp.com/blog/magento-2-add-custom-mass-action-in-product-grid/

Related

how to create a patch action with backpack for laravel

Hello every body i am new with both laravel and backpack , so i read the documentation backpack documentation , so i want to create a line action(action that apears in every entry) that change an attribut which is by the way a 1-n relation (assign action that assign an entity to a user). can somme one helps me, or just give me the best path to follow .
public function assign()
{
return view("welcome");
}
In Backpack v4 you should probably take a look at creating custom operations.
This example should be helpful to you. It shows how to create an Operation that includes a button on the line stack, and separate page for that operation.
Hope it helps.

I'm using sap.m.Wizard. But the number of steps aren't dynamically rendered

I'm trying to create a wizard using sap.m.wizard in which the number of steps can be dynamically rendered.
I'm unsure on how to proceed with this.
flow can be:
1-2-3-4-5
1-3-4-5
1-2-4-5
1-3-5
Problem I'm facing:
When we create the wizard dynamically,
if we click on item with 5 steps .. OKAY
Then we click on item with 7 steps .. OKAY
Then we click on item with 6 steps .. ERROR
"dynamic step removal not yet supported"
You can do like this
wizard.removeAllSteps();
wizard.addStep(step1);
wizard.addStep(step2);
wizard.addStep(step3);
wizard.addStep(step4);
wizard.discardProgress(wizard.getSteps()[0]);
You can choose which step you want to add in which order. This will work for you.

TYPO3 extension: how to find certain TS setting

I found in typo3 admin side(/typo3), you can have two ways to set up TS,
you can set up through template->root, I think TS here will affect the whole site.
you can set up through template->certain page, it will only affect this page.
So my question is:
If I want to find where(which page) has TS setting such as : code = LIST, how could I do?
Use Web > Template module it has tools, you can for an example use Template Analyzer for the search
Try querying the database in phpMyAdmin or similar. The following looks in Template Setup:
SELECT pid, config, constants
FROM sys_template
WHERE config LIKE '%code = LIST%'
Replace config with constants to look in Template Constants. pid is the page ID.
If it is not set in the TypoScript, it perhaps has been set in the plugin itself. Just check the plugin content element itself.
In the Template module, go to the page where the setting is in effect.
Use the TSOB (Typo Script Object Browser) to search for "list":
This must show you all TS for this page that contains "list".
If you don't see the setting you can run a cmd/ctrl-F Search over the entire results.
You would have to search for "[code] = LIST".
Which will lead you to the following entry:
Hovering over the label will produce the above tooltip. Copy the line number.
Now change to the Template Analyzer. Here, you can click through all cascading templates and search for the line number:
This is definitely the line that sets that value.
From the "Template hierarchy" tree you will easily find the template that contains the setting.

TYPO3/TemplaVoila: Unknown column 'belayout' in 'field list' when adding new Template Object

We're trying to implement a mobile version of our Typo3 site, but whenever I add a new Template Object and select something in "Make this a sub-template of", I get this error:
I'm not very good with typo3, so if anyone could point me in the right direction it would be great. Thanks.
Go to Install Tool > Database Analyser > COMPARE and mark the checkboxes to add missing fields and tables (you don't need to remove suggested things)
Repeat the operation as long as required, if some field can not be added by COMPARE, you need to include it manually via phpMyAdmin. Most probably in such case you'll need to resolve some conflict.
Next go to Extension Manager, find the TemplaVoila ext and search for Update button, to make sure that the config is saved correctly to the file.

Zend Framework Dynamically added fields of a form and populate

I have been attempting to create a form where a user can simply press a button and the form will add a new field for the user to use. I have 2 of these dynamically added field types.
Firstly a field where a user can upload files, by pressing the add button another field is pasted underneath the current field and is ready for use.
I have followed an old guide on how to get this done with a bit of ajax and jQuery.
This guide to be exact: http://www.jeremykendall.net/2009/01/19/dynamically-adding-elements-to-zend-form/
As you can see it's from 2009 and a bit outdated yet it still works under the current Zend Framework version 1.11.11
The problem however arises now that i want an edit / update version of the form. I need to populate it's fields but first of all i need to create enough fields for the data to be stored in. So when there's 3 files that have been uploaded it should create 2 additional fields and place the 3 file names in these fields ready to be edited and updated. Simply using $form->populate($stuff) is not going to work
I just have no idea how to accomplish this and the tutorial on dynamically added fields only goes as far as the addAction and not how to create the editAction under these conditions.
Is there any tutorial out there on how to create and manage forms such as these? I'm sure i am not the only one who's had the idea to builds these kind of forms?
I can add my code if there's a request for it but it's the same as the example from the guide, just a different set of elements in the form.
Adding a small example of it's use.
A user adds an item with 3 files, these files are uploaded along with a filename so in the database it appears like this : File_Id : '1' , File_Name : 'SomeFile' , File_location : 'somewhere/on/my/pc/SomeFile.txt'.
Now the user realizes he forgot a file or wants to delete a file from that list, he goes to the edit page and here i want the form to display the previously added filenames. So if there's 3 files it shows 3 and when there's 2 it shows 2 etc. How do i build a form to dynamically add fields based on the number of uploaded files and then populate them?
Any advice on how to handle this is well appreciated :)
You can make use of the semi-magic setXxx() methods of the form.
Inside the form:
public function setFiles($files) {
foreach ($files as $file) {
$this->addElement(/* add a file element */);
//do other stuff, like decorators to show the file name, etc.
}
}
In your controller:
$files = $model->getFiles();
$form = new Form_EditFiles(array('files' => $files));
By passing an array with key files you will make the form try to call the method named setFiles(), which you have conveniently provided above.
This should push you in the right direction, or so I hope at least.
If I understand you correctly you want to populate file upload fields, which is not possible because of security reasons.
Edit:
You can add Elements inside of the Controller via $form->addElement() (basicly just like the $this->addElement() statements in the Tutorial)