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: Combobox in input array  (Read 23301 times)
Snorri B.
Posts: 103


« on: February 18, 2009, 05:30:20 pm »

Hi.

If I have a table in a form like:
Code
  1.  
  2. <t valk                                                                       >
  3. [nr|hopur     |hnafn                       |tbeink                          ]
  4. [nr|hopur     |hnafn                       |tbeink                          ]
  5. [nr|hopur     |hnafn                       |tbeink                          ]
  6. <                                                                             >
  7.  

and one field defined as a combobox:

Code
  1.  table valk:valk, unhidablecolumns, unmovablecolumns, unsizablecolumns;
  2.  nr=formonly.nr type int, noentry, title="Nr";
  3.  buttonedit hopur=formonly.hopur, upshift, autonext, action=lookup, title="Húsahópur";
  4.  buttonedit hnafn=formonly.hnafn, scroll, action=lookup, title="Nafn húsahóps";
  5.  combobox tbeink=formonly.tbeink, title="Tímabil, dags frá - dags til";
  6.  

Is it possble to have different values in tbeink for different lines? For example, in the first line of the array tbeink would have values 2,3,4 in the second line 1,3,4 etc. It seems impossible to
let cb = ui.ComboBox.forName("formonly[1].tbeink")

or similar. What I need to do is to populate the combo in each line depending on the values of another field in the same line.

Best regards,
-Snorri
Sebastien F.
Four Js
Posts: 509


« Reply #1 on: February 18, 2009, 05:50:54 pm »

Snorry,

No this is not possible today (I doubt we'll support that one day).
The item list is defined at the decoration node level, which is common for all cells in Tables.
You could actually use a BUTTONEDIT and open a new Window with DISPLAY ARRAY to let the user select items in the list.
You could then use the Windows style attribute position="field" / border="none".
https://4js.com/techdocs/genero/fgl/devel/DocRoot/User/PresentationStyles.html#STYATT_WINDOW

Seb
Snorri B.
Posts: 103


« Reply #2 on: February 19, 2009, 10:27:08 am »

Hi Seb and thank you for your prompt answer.

I think you should consider adding this feature. We are in the process of modernizing a lot of our code (using DIALOG etc.) and I foresee a lot of situations where this will be a problem. It is not uncommon to have combobox contents dependant on data in another field.

Best regards,
-Snorri
Sebastien F.
Four Js
Posts: 509


« Reply #3 on: February 19, 2009, 05:26:13 pm »

Snorri,

PNR (GDC team) suggested to have a new 'hidden' attribute at the combobox item nodes level, so you can define by program what items must be visible, according to the context. This could actually be used in simple INPUTs or CONSTRUCTs as well.

I think this idea is nice... would that help you?

Seb
Sebastien F.
Four Js
Posts: 509


« Reply #4 on: February 19, 2009, 05:33:16 pm »

You should of course fill the combobox item list with all possible values...
How many different values would you actually need to handle in you comboboxes used in INPUT ARRAY?
Would you need to add new items dynamically according to the context (i.e. row) ?

I don't know if people typically use comboboxes with a large number of items, but that's not the right usage, IMHO.
I believe a combobox should have 10, 20, maybe 50 items but more than this, the user end user gets condused.
If the list is large, you should use a BUTTONEDIT, and open a typical "zoom" window, to pick up an item from a DISPLAY ARRAY, with optional search features (CONSTRUCT).
By the way I would like to have non-editable BUTTONEDIT fields one day.

Seb
Snorri B.
Posts: 103


« Reply #5 on: February 19, 2009, 05:57:15 pm »

Seb,

I like the idea about the hidden attribute.

If I understand correctly, one would initialize the combo with all possible values and then one could in a before field block "hide" the items that should not be visible according to context?

The only consequence I see is that hiding items should not refresh the combo in a different line (if you hide the value that is beeing used there)

As I finished writing this I saw you had added a new post.

I agree 50 items is max for a combo although total of all possible values could be much higer. It would be best  if you would be able to access each combo individually (thus populating it dynamically for each row). I belive this could be problematic?

Regarding non-editable BUTTONEDIT fields: What about a much talked feature request, namely READONLY?

Best regs,
-Snorri
Sebastien F.
Four Js
Posts: 509


« Reply #6 on: February 19, 2009, 06:21:24 pm »

Seb,

I like the idea about the hidden attribute.

If I understand correctly, one would initialize the combo with all possible values and then one could in a before field block "hide" the items that should not be visible according to context?

Yes

The only consequence I see is that hiding items should not refresh the combo in a different line (if you hide the value that is beeing used there)

Good point, the values display in other rows should not be affected by item.hidden changes of course.
I let client teams check that (non-editable) comboboxes can display a value/text that is not in the list of items.
Depends on the underlying GUi toolkit (QT / Javascript / HTML).

As I finished writing this I saw you had added a new post.
I agree 50 items is max for a combo although total of all possible values could be much higer. It would be best  if you would be able to access each combo individually (thus populating it dynamically for each row). I belive this could be problematic?
Yes it is problematic because items are defined at the combobox node level, wish is unique for a table column.
Another option would be to add Item nodes below the Value nodes in TableColumns
We need to discuss this internally.

Regarding non-editable BUTTONEDIT fields: What about a much talked feature request, namely READONLY?

There was a long discussion about READONLY with different opinions.
So far my last suggestion was to add EDITABLE (or UNEDITABLE) attribute to BUTTONEDIT, as decoration node attribute.
READONLY would rather be a FormField (model) node attribute, but it's confusing with NOENTRY...

Seb
Snorri B.
Posts: 103


« Reply #7 on: May 31, 2011, 12:02:21 pm »

Any news on this?

Best regards,
-Snorri
Reuben B.
Four Js
Posts: 1049


« Reply #8 on: June 02, 2011, 11:54:14 am »

Hi Snorri,

I can't tell you if this is being progressed or not, but I can tell you the Bz number is 12086 "Using different COMBOBOX item list in INPUT ARRAY rows", and I am also on the list of requestors from my previous job.

The requirement I had at the time was entering products into an INPUT ARRAY for sales order/purchase order etc, the field after quantity was units of measurement.  Depending on the type of product the units of measurement were different i.e unit products were each/box/pallets etc, liquid products were millilitres/litres etc, length products were millimetres/meters, weight products were grams/kilograms/tonnes etc.  We wanted the units of measurement field to be a COMBOBOX with the 2-4 units of measure that were applicable to that product, however as the COMBOBOX items is the same for every row in the array we were faced with a choice.  Either a) a COMBOBOX with 20 or so items,or which only 2-4 valid are valid for this row, or b) we have a BUTTONEDIT/zoom window that will only list those 2-4 valid items.  We went with b) the BUTTONEDIT but would've used a COMBOBOX if you could manipulate the list of items that appeared as per 12086

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 #9 on: June 06, 2011, 11:45:47 am »

Hello,

I will trigger this discussion internally, to see if we can add the hidden attribute to combobox items in the next version.

We did not plan to work on this feature for now.

Seb
Snorri B.
Posts: 103


« Reply #10 on: June 06, 2011, 01:02:15 pm »

Thanks guys.

I hope the hidden attribute gets into the next version!

Best regards,
-Snorri
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines