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: Editable combobox  (Read 15426 times)
Tim S.
Posts: 26


« on: June 04, 2009, 09:25:41 pm »

Is there a way to get an editable combobox on input?
I would like the user to have the option of picking from a list or keying their own value if what they want is not on the list, without setting up a separate find/search option.

Thanks,
Tim S
Reuben B.
Four Js
Posts: 1119


« Reply #1 on: June 05, 2009, 02:05:24 am »

Is there a way to get an editable combobox on input?
I would like the user to have the option of picking from a list or keying their own value if what they want is not on the list, without setting up a separate find/search option.

Thanks,
Tim S

I'll let the developers comment on why QUERYEDITABLE attribute can't apply to Inputs.
A related widget request would be for an EDIT widget to have an auto-complete like drop-down list. 

Anyway you asked is their a way, using multi-dialog and queryeditable you could start with...

EDIT f01 = formonly.field1;
COMBOBOX f02 = formonly.field2, ITEMS=("AAA","BBB","CCC"), QUERYEDITABLE;
EDIT f03 = formonly.field3;

   DEFINE dummy STRING
   ...
   OPTIONS FIELD ORDER FORM
   OPTIONS INPUT WRAP
   ...   
   DIALOG ATTRIBUTES(UNBUFFERED)
      INPUT BY NAME field1, field3
      END INPUT
     
      CONSTRUCT BY NAME dummy ON field2
         AFTER FIELD field2
            LET field2 = FGL_DIALOG_GETBUFFER() 
      END CONSTRUCT
      ...
   END DIALOG   

... although I'd also look at using BUTTONEDIT + ON ACTION , and use presentation styles to control the position and appearance of the resultant drop-down list







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: 545


« Reply #2 on: June 05, 2009, 09:26:03 am »

Hi all,

By definition comboboxes are non-editable in Genero during INPUT.

QUERYEDITABLE was introduced to enable search criterion input in COMBOBOXES during CONSTRUCTs, otherwise you could not enter "Pa*" or ">123" ...


Anyway you asked is their a way, using multi-dialog and queryeditable you could start with...

EDIT f01 = formonly.field1;
COMBOBOX f02 = formonly.field2, ITEMS=("AAA","BBB","CCC"), QUERYEDITABLE;
EDIT f03 = formonly.field3;

   DEFINE dummy STRING
   ...
   OPTIONS FIELD ORDER FORM
   OPTIONS INPUT WRAP
   ...   
   DIALOG ATTRIBUTES(UNBUFFERED)
      INPUT BY NAME field1, field3
      END INPUT
     
      CONSTRUCT BY NAME dummy ON field2
         AFTER FIELD field2
            LET field2 = FGL_DIALOG_GETBUFFER() 
      END CONSTRUCT
      ...
   END DIALOG   


Sorry but I would not do that, because input semantics are different for CONSTRUCT fields...

For example, if field2 is an integer, the user can input ">123" ...

We should support EDITABLE comboboxes, as I suggest for a while now.

Extending EDITs with auto-completion drop-down list can also be an option, to be discussed.

Seb
Sebastien F.
Four Js
Posts: 545


« Reply #3 on: June 05, 2009, 10:01:58 am »

Bug database reference for EDITABLE comboboxes: #1553

Note that an equivalent request exists for TEXTEDIT and BUTTONEDIT, to make these non-editable.

Seb
Tim S.
Posts: 26


« Reply #4 on: June 05, 2009, 04:25:26 pm »

Reuben and Seb,

Thank you both for your input.

I have to agree with Seb about using a CONSTRUCT for INPUT. That was the exact concern I had while reading Reuben's suggestion.


We should support EDITABLE comboboxes, as I suggest for a while now.

Extending EDITs with auto-completion drop-down list can also be an option, to be discussed.

Seb

Seb,
Your description of extending EDIT's with auto-completion drop-down list sounds exactly like what I am trying to accomplish. Are there any plans for doing such a thing?


... although I'd also look at using BUTTONEDIT + ON ACTION , and use presentation styles to control the position and appearance of the resultant drop-down list


Reuben,
Do you have any samples of how to "use presentation styles to control the position and appearance"?
I don't recall seeing any in the documention or online tutorials.
 (But I will go look again just to be certain.)

Thanks again for your help,
Tim S
Paul S.
Posts: 45


« Reply #5 on: June 05, 2009, 10:20:15 pm »

Hi

Extending EDITs with auto-completion drop-down list can also be an option, to be discussed.
Seb

Auto-completion would be a great feature to have and soon (if possible) , I have a client who will not change from an
application written in FoxPro until Genero can do this.

Paul
Sebastien F.
Four Js
Posts: 545


« Reply #6 on: June 06, 2009, 10:04:54 am »

Paul,

Be sure I will raise this discussion again and push to have it in the next release.
For me it should have been implemented in 2.20.
But we had to focus on other features.
Hope you like our treeviews.

Seb
Reuben B.
Four Js
Posts: 1119


« Reply #7 on: June 08, 2009, 03:16:50 am »

Reuben and Seb,

Thank you both for your input.

I have to agree with Seb about using a CONSTRUCT for INPUT. That was the exact concern I had while reading Reuben's suggestion.


It is a fair point that Seb raised but I think I can count on one hand the number of COMBOBOX that were being for a datatype other than CHAR or STRING.

I've seen more CHAR(1)...COMBOBOX... ITEMS(("Y","Yes"),("N","No")) than SMALLINT ... ITEMS(("1","Yes"),("0","No")).

Also if you were allowing a user to edit a combobox, you couldn't have the (code,value) itemslist, it could only be a list of values.

If you have an EDITABLE COMBOBOX it would be quite plausible (but not very wise) for the user to enter >ABC or A*, and that would be the value you have to store in the field.  (thats another feature I'd like to see is something that only allows A-Z0-9 and a few other characters into an EDIT field).

The different semantic that would effect you is that a CONSTRUCT won't limit the number of characters you can type into the field.  Anyway you asked if there is a way, and that may give you a way until the functionality is potentially added in a future version.



...
Reuben,
Do you have any samples of how to "use presentation styles to control the position and appearance"?
I don't recall seeing any in the documention or online tutorials.
 (But I will go look again just to be certain.)


I'll collect a few examples together and put a working example somewhere but in the interim add the styles below as a starting point.  So when the user clicks on a buttonedit (use IMAGE="combo" on your BUTTONEDIT) and your zoom window opens (and hopefully it consists of just one table) then you get a list and not much else.

  <Style name="Window.naked2">
     <StyleAttribute name="windowType" value="modal" />
     <StyleAttribute name="position" value="field" />
     <StyleAttribute name="border" value="none" />
     <StyleAttribute name="windowSystemsMenu" value="no" />
     <StyleAttribute name="windowOptionClose" value="no" />
     <StyleAttribute name="windowOptionMinimize" value="no" />
     <StyleAttribute name="windowOptionMaximize" value="no" />
     <StyleAttribute name="sizable" value="no" />
     <StyleAttribute name="actionPanelPosition" value="none" />
     <StyleAttribute name="ringMenuPosition" value="none" />
     <StyleAttribute name="toolBarPosition" value="none" />
     <StyleAttribute name="statusBarType" value="none" />
  </Style>
  <Style name="Table.naked2">
     <StyleAttribute name="headerHidden" value="yes" />
  </Style>



The other technique I would consider is to have...

COMBOBOX f01 = formonly.field1, ITEMS=(<enter your own items>);
BUTTON x: additem, IMAGE="plus";

and your ON ACTION additem consists of
PROMPT "Enter new value" FOR new_value
...
CALL cb.addItem(new_value, new_value)
LET field1 = new_value  -- or DISPLAY new_value TO field1

to allow the user to enter a value, and then use the combobox methods to add this new item to the combobox items, and then set the value of the field to the new_value (or use DISPLAY if not UNBUFFERED)

It gives you a COMBOBOX and a mechanism for the user to enter a value that isn't in the COMBOBOX.

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines