Problem Adding Custom Buttons to the list view #939
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#939
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Steps to reproduce the issue
On an existing Admin View
Go to Custom Buttons Tab
Set Add Custom Buttons to YES
Click + to add a Custom Buttons entry
Complete the form (Icon, Name, Target Controller Method name, Target - list, Type (any).
Add a public function with the Controller Method name to the controller method name
Compile
Select an entry (use checkbox) on the list view
Click the new custom button
Expected result
Code in method should run
Actual result
The code does't run
System information (as much as possible)
Additional comments
I'm not sure if this has anything to do with it, as I don't know how the funtion actually gets 'called' in the list view, but the method is added to the controllers/profile.php (singular) file, not the controllers/profiles.php (multiple) file.
Also, there doesn't appear to be any explanation that I can find about the TYPE selector - what effect Default / Selection / Only Function has on the processing.
When using Target - Single, the button/code functions as it should (and seemingly independent of the TYPE selection.
Possibly just a quck explanation of how to set-up to get code to run in list view (what settigs to use) would be helpful (or an update of the existing video).
Okay so the three options give you three kinds of behaviour.
In reality the code you write in the controller and module is what makes these buttons work, all they do is post to the controller. This means you can always catch whatever was selected in the controller, and all the button does is give you an specific action to apply.
The normal controller code for selection:
Be sure to add it to the right controller: PHP List view (controller methods)
The normal controller code for function only:
Be sure to add it to the right controller: PHP List view (controller methods)
As you mabe noticed all these are list view buttons, the
single
, andboth
target options as minor changes in the GUI, but the controller side also works with a post method, and can look like this:Be sure to add it to the right controller: PHP (controller methods)
You will see in most of these controller methods, we validate access, and then call the module... which is basicly how any post should behave.
Anyway to me the actual issue is you need to know how to build your PHP scripting side, and be able to debug this untill it does what you want. What is true is I use this feature in a thousand ways and they have never given me any errors...
THANK YOU!!!!
That was a great explanation and helped a TON.
Although the problem was that I did not PHP List View (controller methods) and was just putting it in the first controller method box.
Once moved, and with your sample code here to get the id values, it all worked great.
THANKS!