Enable Multi-Selection on Search fields (Info Windows) by default - how to deactivate it?

158 views
Skip to first unread message

Nicolas Micoud

unread,
Feb 13, 2024, 10:22:39 AM2/13/24
to iDempiere
Hi,

https://idempiere.atlassian.net/browse/IDEMPIERE-5921

I've just migrated to v11 on some instances and find something disturbing: BPartnerInfo panel is opened by default in multi-selection by default.
That can be really useful in some cases, but can lead to 'frightening' errors for users in most of the cases.
Eg: create a Sales Order and select several BPartners and validate.
That will raise a SaveError popup as mandatory fields (Organization, Warehouse) are not filled.

To disable that, I see no other way but to code it in a plugin to force multiSelection to be false.

Or am I missing something?

I haven't followed all the discussions, but wouldn't be better to determine the multiSelection value according to the editor (is false for WSearchEditor and true for WChosenboxSearchAssistant)?


Thanks,

Nicolas

Heng Sin Low

unread,
Feb 13, 2024, 9:28:27 PM2/13/24
to idem...@googlegroups.com
Well, I did ask for input from you and others in that ticket but there's none at that time ...

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/6ab21d66-2a41-4410-8bca-336c556b8bc9n%40googlegroups.com.

Nicolas Micoud

unread,
Feb 14, 2024, 12:48:58 AM2/14/24
to iDempiere
I see that - I didn't take the time to test/answer when it was asked - sorry.

It's never too late to do well, so if you're ok, where do you prefer talking about this? here or on the ticket?

Thanks,

Nicolas

Carlos Antonio Ruiz Gomez

unread,
Feb 14, 2024, 6:13:58 AM2/14/24
to idem...@googlegroups.com
Hi Nicolas, we discussed that in the ticket as you can see in the comments.

My conclusion was that in many windows the multi-selection works just
fine and insert several records.

But in some windows (I tend to think not the majority of windows) the
user is shown with harmless errors if they select multiple records.

The error shown is harmless, and I would expect that the user simply
learns that cannot add multiple records at once in such window - for
example sales order, because it requires org and warehouse (although
maybe if you define defaults for those fields maybe multi-record can work).

The point I made on the ticket is that the product info window has been
the same for many years, it works in some windows, it throws errors in
some windows, and I assume as nobody have complained that users just
learn where to use this and where not, and also that the errors thrown
are not causing damage.

So, IMO this is just about educating users, it sounds sad dropping
something that is useful in 90% of the cases because it shows a harmless
message in 10% of the cases (a message that can be avoided simply by not
using the feature).


BTW, in the mattermost discussion I wrote that my tests on sales order
worked fine, so maybe is something about your defaults that stop the
functionality to work.
According to our mattermost discussion:
https://mattermost.idempiere.org/idempiere/pl/5e9n5co19t8txgaxcarduebxjw
You asked how could this be configurable and I answered:
could be:
1 - replacing the WSearchEditor
2 - replacing the DefaultInfoFactory


BTW, the feature is not developed for "Chosenbox" - it is intended to
allow adding multiple records, specifically the use case was for adding
multiple invoices in the payment allocation tab, but when I checked I
found it can be useful in general.


Regards,

Carlos Ruiz


Am 13.02.24 um 16:22 schrieb Nicolas Micoud:
> Nicolas --

Nicolas Micoud

unread,
Feb 14, 2024, 12:26:33 PM2/14/24
to iDempiere
Hi Carlos,

Thanks for taking time to answer.
I agree disadvantages are acceptable and users can easily learn that in some windows they should not use the multi-selection.
At the end, there are not so much place where that should be turned off ; and that's easy to identify and code at my end.

Regards

Nicolas

Nicolas Micoud

unread,
Feb 16, 2024, 12:41:51 AM2/16/24
to iDempiere
Hi,

Here's how I handle it, if it can help

Add a class that extends WSearchEditor :

public class WSearchEditorTgi extends WSearchEditor

{

public WSearchEditorTgi(GridField gridField) {

super(gridField);


if (gridField != null) {

if (gridField.getGridTab() != null) {

// List all necessary tables

if (gridField.getGridTab().getAD_Table_ID() == MXXADossier.Table_ID)

multipleSelection = false;

if (gridField.getGridTab().getAD_Table_ID() == MInvoice.Table_ID)

multipleSelection = false;


// And / Or ?

if (gridField.getGridTab().getTabLevel() == 0) // TODO need to be tested

; // multipleSelection = false;

}

else if (gridField.getAD_Process_ID_Of_Panel() > 0) {

multipleSelection = false;

}

else if (gridField.getAD_InfoWindow_ID_of_Panel() > 0) {

multipleSelection = false;

}

}

}

}




which is called by my class which extends IEditorFactory

else if (displayType == DisplayType.Search) {

editor = new WSearchEditorTgi(gridField);

}


It's in our test instance since yesterday and it seems to do the job - I see no change since migration from v10 to v11.

Regards,

Nicolas
Reply all
Reply to author
Forward
0 new messages