Custom Buttons issue???? #340
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#340
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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
Build in the admin view a custom button with the following option:
Target Controller Method: addInvoice
Target: List
Type: Selection
Expected result
If I select no records in the list view it should give a popup that you need to select some records (just like Export Data)
Actual result
It's telling nothing. I can make an error message, but this means the the information is post, even there was no information
System information (as much as possible)
Additional comments
If this is not a issue (bug) how to solve the problem so that the behaviour is the same as Export Data (the selecting part).
Due to the variation and crazy dynamic nature of that area, I have not added any javascript to the page to monitor the button on click, you can do that with some custom scripting, or in the controller check if there are values, and if not then simple return an error message like we do in the Joomla Components area in JCB when you click on Export JCB Packages This is the code in the controller:
Adding these options manually allows for more options with the custom buttons.
Thanks fro the explenation. The custome button type: selection, is only for the selected lines (records)? If so, that it would be nice to show a general message or do nothing. This looks to me the nature of the button.
Is type:select id different, please explain.
Sure, you are right in that the wording selection in nature needs items selected 👍
That is not where the crazy dynamic nature is implied, but in the compiler.... look at the code here from line 3420 in the interpretation class of the compiler, you will see all custom buttons are build in this one method.
Custom buttons are used in both admin and site/custom admin views, so site and custom admin views, do not have items, but my have a list query that give the idea of a list to the compiler but in reality it is not a list and nothing is being selected.
I could push the boundary to try and catch the combination of
adminview && selection
and then simply addtrue
as the fifth value in theJToolBarHelper::custom
argument, which is what makes it validate that there is a selection made via JavaScript.But this is a little heavy with all the polymorphic madness of the method. Let me see what I can do.. was hoping to get of easy with this request :)
But even if I do add this, never rely on browser side validation without server side validation.
Okay test the staging branch 👍