Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Display array multi-row selection  (Read 22942 times)
Michael Y.
Posts: 8


« on: October 10, 2012, 04:28:11 pm »

Is there something like an ON SELECT action in a display array during multi-row selection? I'd like to count the number of rows selected upon row selection (highlighting) of a new row. Thanks!
Sebastien F.
Four Js
Posts: 509


« Reply #1 on: October 10, 2012, 05:10:24 pm »

Hello Michael,

No there is no ON SELECTION trigger for row selection detection.
We have a request for this (#17474), but for now we don't think it's an important need, and it would make dialogs more complex.

Warning:
You could use BEFORE ROW but then when you toggle selection on the same row you don't get a BEFORE ROW trigger.

Maybe we should re-consider this problem.
In the meantime, can I ask why you want to display the number of selected rows?
Have you seen other applications displaying the number of selected rows?

Seb
Michael Y.
Posts: 8


« Reply #2 on: October 10, 2012, 05:33:15 pm »

Thanks for the prompt reply. We implemented a limit on the number of rows a user can select using something we built, before multi-row selection was available in 4js. An ON SELECT would be useful for letting the user know if they have gone over the limit upon trying to select a new row (with a warning window). Right now it warns the user in an accept action so we will stick with that for now. Thanks again for your insight!
Sebastien F.
Four Js
Posts: 509


« Reply #3 on: October 10, 2012, 05:45:06 pm »

IMHO, there should be no limit regarding row selection.
If the record list can potentially hold a lot of rows, you should rather limit the total number of rows fetched from the database.
I can't think of making a query to retrieve thousands of rows, fill an array with that, and then let the user scroll in that huge list to find the rows they are looking for...
Stop users from doing a "fetch-all": Use the database server features for that: put a WHERE clause in your SELECT, with filter from a CONSTRUCT or self-made SQL filter, and inform the users that they reached a limit after fetching 500 or 1000 rows.

Then, processing the selected rows should be done by displaying a popup window with progress bar and an [interrupt] button to let the user cancel the ongoing rowset treatment... already processed rows must be marked as processed, or de-selected, to let the user restart the process if wanted.
Reuben B.
Four Js
Posts: 1046


« Reply #4 on: October 11, 2012, 07:13:27 am »

Seb,

I think you've misunderstood something.  Imagine the following scenario, you have an array containing a list of employees and you can select at most 4 to go on a training course.  Without an ON SELECTION clause, it is not possible to warn the user when they select the 5th employee or to display a message along the lines of "You have selected 1 employee, there are 3 more spaces remaining".

The old style way of implementing this with an INPUT ARRAY and a column containing check-boxes, you can do that using ON CHANGE.

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Sebastien F.
Four Js
Posts: 509


« Reply #5 on: October 11, 2012, 09:14:46 am »

Reuben,
I understand this need, makes sense.
However, I am not sure row selection is the correct way to provide such feature.
I would rather use 2 lists with drag & drop, to build the list of employees that will attend the courses.
With this solution, you can clearly see the selected employees.
By using row selection instead, you would need to scroll in the long employee list to see what employees are selected.
Further, imagine you have to select say 50 employees, and after 48 row selections, you hit the down key by mistake => all selected rows are lost...
We must take care when suggesting ergonomic solutions.
As usual, I would first look at other applications to what solution is used in such case.
Seb
Reuben B.
Four Js
Posts: 1046


« Reply #6 on: October 17, 2012, 02:13:21 am »

Michael, (and others),

This is your opportunity to post examples of where you would use an ON SELECTION trigger in a multi-row-select array.  Looking at the list of requestors attached to the bug, Michael isn't the first to request this feature. 

Also if I look at alternative development tools, they do have the ability to fire events when a selection is made in a ListBox so it isn't a silly request by any means.

Looking at the current state of the request https://4js.com/en/support/issue/?id=17474, it doesn't look like it will happen soon so if you want it you have to speak up and provide good examples to convince our developers to implement.

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Kevin L.
Posts: 10


« Reply #7 on: October 18, 2012, 03:37:34 pm »

I'll expand on what Michael was looking for. In our applications we use a large number of coded values to more consistently categorize user selections. We refer to these as "lookups". Some fields allow you to select a single value and others allow you to select multiple values. We use the same form and input for both these single selection and multi-selection "lookups". In the past before the availability of the multi-select, we designed a mark/unmark action and placed a "check mark" beside the values that were selected. If we were dealing with a multi-select, the mark action would only allow you to select upto the maximum value and then give you a warning. Ideally we'd like to replace all this mark/unmark logic with the new mulit-selection array. I've included a screenshot of our existing "lookup" to give you guys an idea of what we have today. The new multi-selection works quite well. The only thing we were losing was the ability to detect if the user selected too many options for the field they are in. This is where the idea of the ON SELECT detection is coming from.


* lookup_example.PNG (45.56 KB, 573x621 - viewed 2328 times.)
Sebastien F.
Four Js
Posts: 509


« Reply #8 on: October 18, 2012, 04:02:42 pm »

What about keeping the green markers and have [mark] and [unmark] buttons that would modify the marker of the selected rows?
The end user can then do a multi-selection, and choose to mark or un-mark the change the status of the rows.
During the marking process, check the total number of marked rows and show an error if too many rows are marked.

Again: After selecting mutiple rows, a simple down/up keypress de-selects all rows.
You must consider multi-row selection as a temporary selection.
Your case requires persistent markers (with flag stored in the database I guess).

Seb
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines