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: COMMENT attribute at Cell level in a Table  (Read 9553 times)
Enrico S.
Posts: 35


« on: October 04, 2016, 04:55:17 pm »

Hi, all.
Taking a look at the AUI, it seems there is no way to set a comment at cell level in AUI for the fileds of an INPUT/DISPLAY ARRAY driven by a Table widget.
It seems not possible with the actual structure of the AUI.

This may be useful, for example, when you have an imageColumn representing the status of a row (an order waiting for confirmation as well as waiting for payment, processed ... and so on).
Users could easily have the explication of shown symbols by pointing the mouse on each symbol (row by row), without need of a "legenda".

I figure that the comment displayed for a table field can be the actual (at column level) only if no cell-level comment has been programmatically set in the AUI for a specific node instead.

I would like to know your opinions about.

Regards.
Enrico



* Sample.png (18.28 KB, 579x179 - viewed 1380 times.)
Reuben B.
Four Js
Posts: 1049


« Reply #1 on: October 05, 2016, 11:34:30 pm »

The issue you have highlighted with the AUI Tree structure also occurs for any other attribute.

Other similar requests I have seen include

COMBOBOX - having different ITEMS on each row.
STYLE - having different STYLES on each row.
Active - enabling or disabled fields on each row.

Any potential solution for these and your similar issue with COMMENT, would probably be similar to what currently occurs with setCellAttributes/setArrayAttributes http://4js.com/online_documentation/fjs-fgl-manual-html/#c_fgl_ClassDialog_setArrayAttributes.html, whereby a separate array is maintained with the value.   This potential solution has problems when you add/remove rows keeping the arrays in sync.  Another potential solution would be to have something similar to IMAGECOLUMN whereby row level attributes are kept in the same array, this avoids the add/remove row complexity but would be harder to define.

Reuben




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


« Reply #2 on: October 06, 2016, 03:26:27 pm »

Possibly I'm seeing it wrong (if so my apologies Seb), but there's a way to avoid syncronization problems: why donīt you use a PHAMTOM column where you store the pretended comment?

I attach an example.
HIH
Nuno




* comArray.zip (7.37 KB - downloaded 703 times.)
Reuben B.
Four Js
Posts: 1049


« Reply #3 on: October 06, 2016, 11:10:24 pm »

Nuno,

Your solution suffers from the problem in that the attribute value is determined for the 4gl current row.  So if you select row 4, the comment attribute is changed to "This is cell no 04 Odd", now move the cursor outside the array, and bring it back over another row, say row 7, now wait a few seconds for the comment to appear in response to hover event, it will appear as "This is cell no 04 Odd" still, as no before row has been triggered to change the value.

A feasible solution might be to have a COMMENTCOLUMN attribute similar to IMAGECOLUMN pointing at the phantom column e.g.

f1 = formonly.celNo, COMMENTCOLUMN=celCom;
PHANTOM formonly.celCom;

but then what about other attributes with similar demands, do we also have STYLECOLUMN, ITEMSCOLUMN etc.


Reuben

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


« Reply #4 on: October 10, 2016, 04:40:18 pm »

No way to improve attributes at TableCell level on DOM in future releases (and possibly, but not necessarily, some related handling methods) ?
This seems to be the definitive solution.

Enrico
Roland W.
Posts: 12


« Reply #5 on: October 24, 2016, 07:40:28 am »

I'm wondering why I have to use a second array which holds the style attributes. Wouldn't it be easier if BDL would provide a more object oriented approach in the way that style attributes could be handled as a hidden field which holds the property of the original array? The getLength() is already used by different data types amongst others as arrays
In the end it could look like this:

DEFINE data DYNAMIC ARRAY OF RECORD
         pkey INTEGER,
         name VARCHAR(50)
       END RECORD

FOR i=1 TO data.getLength()  -- length from data array!
    LET attributes.pkey = i
    LET attributes.name = "some text"
    LET attributes.style = "blue reverse"
END FOR

The advantage of this approach would be that we could use different styles for each array cell and not dealing with two arrays which have to be synced if we add or remove rows in an input array.

If the hidden style is not an option it could also be possible to add a class for each array component such as data.setStyle() or something like this. Moreover it would be possible not only to set styles but also different ComboBoxes or Images for each array cell.
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines