Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#859 closed enhancement (wontfix)

[patch][cla] Some changes into ComboBox Widget to add static data feature (like access ComboBox)

Reported by: martin@… Owned by: bill
Priority: high Milestone:
Component: Widgets Version: 0.3
Keywords: ComboBox Cc: martin@…, mattimustang@…
Blocked By: Blocking:

Description

Hi, I add some variable and functions to add the wanted feature (static options) like Microsoft Access ComboBox?

I changed some functions and added some others
I also make some changes into the html template and the css

Attachments (8)

ComboBox_static.diff (21.0 KB) - added by martin@… 13 years ago.
The new combobox.js
HtmlComboBox.html (1.3 KB) - added by martin@… 13 years ago.
HtmlComboBox.css (880 bytes) - added by martin@… 13 years ago.
ComboBox_static.2.diff (7.0 KB) - added by martin@… 13 years ago.
The real diff file
ComboBox.js (17.9 KB) - added by martin@… 13 years ago.
Apparently I don't know how to make a .diff file... so I attach the js file. Sorry about that
ComboBox.2.js (20.9 KB) - added by martin@… 13 years ago.
ComboBox.diff (5.9 KB) - added by martin@… 13 years ago.
Diff from nightly build 2006-06-08
templates.rar (1.7 KB) - added by martin@… 13 years ago.
templates files (image, css, html)

Download all attachments as: .zip

Change History (22)

Changed 13 years ago by martin@…

Attachment: ComboBox_static.diff added

The new combobox.js

Changed 13 years ago by martin@…

Attachment: HtmlComboBox.html added

Changed 13 years ago by martin@…

Attachment: HtmlComboBox.css added

Changed 13 years ago by martin@…

Attachment: ComboBox_static.2.diff added

The real diff file

Changed 13 years ago by martin@…

Attachment: ComboBox.js added

Apparently I don't know how to make a .diff file... so I attach the js file. Sorry about that

comment:1 Changed 13 years ago by bill

Cc: martin@… added

Hi Martin,

  1. What are "static options"? Can you provide a testcase showing this? The Combobox already supports declarations using <select> and <option>. Are you talking about something different.
  1. We can't accept patches unless you have filed the CLA (www.dojotoolkit.org/icla.txt). Have you?

comment:2 Changed 13 years ago by martin@…

Hi cc,

"Static options" mean like a normal <select> tag but with possiblitlity to write on the input box (like as the combobox do actualy), but I had possibility to force user to use only the options in the combobox (like microsoft access combobox) Contrairly to you version, mine can permit to show all the options all the time with autocomplete in the input box. You can add options programmaticaly with addOptions and it has a validate function when the property "onlyValues" is set to true; when emptyValue is set to false, the combobox must not be empty when maxListLength is set to -1, it mean that it unlimited and I added "iOptionsMaxHeight" to allow to set maxheight in width instead of number of options I also added iOptionsMinWidth to allow to set a minimum width for the optionsListNode You can see an example there : http://www.webernic.com/test/test.html

Yes I filed the CCLA (ccla.txt and not icla.txt, because my work is the property of my employer and he signed it) His name is nicolas frechette and I sent it at martin@… and receive email from Dylan to welcome me on dojo.

N.B. the lastest version (06/01/06 14:16:47) I sent had errors, I make this mistake when I wanted to add the lastest changes from the nightly build

I send you the lastest patch

Changed 13 years ago by martin@…

Attachment: ComboBox.2.js added

comment:3 Changed 13 years ago by bill

Cc: mattimustang@… added

This is related to #730. We are planning to make a new widget (subclass of ComboBox?) that acts more like <select>, forcing user to use only the options in the combobox, and also when you submit the form, sending the hidden value rather than the label (displayed value)

ComboBox? keeps changing (a number of patches in the past two days), so after that new subwidget is checked in then let me get back to you, and ask for a patch to the latest code.

I did look at your diff file; there were a few issues I saw:

1) you hardcoded style information instead of using CSS 2) there are strange circle characters (non-ascii characters) 3) it seems strange that you would display an error message. if the user tries to type in an illegal value why not just ignore the keystrokes?

Thanks, Bill

comment:4 Changed 13 years ago by martin@…

Hi Bill, Ok thanks

about what you wrote to me :

  1. I hardcoded style information instead of using CSS because it's more fastest change style than changing className (I dont know if it only in IE, but i already tested it a year ago when I optimized my js code.. and changing style value is really more fastest than changing className.. but, I don't know if they are other way to do that more fastest than 1 year ago).
  1. maybe you found non-ascii characters because I'm on a french OS
  1. I'm not ignore the keystrokes because if a user tries to type in a world and mistype just one letter, he can retype the wrong letter he typed.

comment:5 Changed 13 years ago by bill

Milestone: 0.4

Hi, sorry for the delay. The other ComboBox? updates are mostly finished so if possible please send a patch against the latest code. (I think you use "svn diff" to make the patch)

The "static options" feature has already been checked in as the Select widget.

About CSS - We need the CSS information in a CSS file so that it's easier for users to customize the look and feel of the widget.

Contrairly to you version, mine can permit to show all the options all the time with autocomplete in the input box.

I don't really understand. The drop down list isn't filtered but you still have autocomplete?

You can add options programmaticaly with addOptions

OK

and it has a validate function when the property "onlyValues" is set to true;

that's what the new Select widget does, right?

when emptyValue is set to false, the combobox must not be empty

OK. Sounds like it should be called allowEmptyValue. But what happens if the combobox is empty? you can't submit the form?

when maxListLength is set to -1, it mean that it unlimited

OK

and I added "iOptionsMaxHeight" to allow to set maxheight in width instead of number of options

OK

I also added iOptionsMinWidth to allow to set a minimum width for the optionsListNode

OK

comment:6 Changed 13 years ago by bill

Owner: changed from anonymous to bill
Status: newassigned

comment:7 Changed 13 years ago by martin@…

-> Contrairly to you version, mine can permit to show all the options all the time with autocomplete in the input box.

-> I don't really understand. The drop down list isn't filtered but you still have autocomplete?

-> yep I still have an autocomplete. ? Well... what I wanted to do, it's make a "select box", but with autocomplete feature, and possibility to write other choices (or force user to add value in the selectbox)

I started a month ago to create a new dojo widget called "DropDownBox?", but your combobox is really like mine at some exception, it why I dropped it and started to use your code.
So... in the context of a "select box" with only a couple of choices (under 5) filtering isn't really needed



-> and it has a validate function when the property "onlyValues" is set to true;

-> that's what the new Select widget does, right?

-> I've never heared about new select widget, I'll look about that later.



-> when emptyValue is set to false, the combobox must not be empty

-> OK. Sounds like it should be called allowEmptyValue. But what happens if the combobox is empty? you can't submit the form?

-> I don't really know at this time, it's why I like open source ;) others can help us with that... at this time, I only focus the element until the value is valid.

But there a problem about that when we have 2 combobobx widget with 2 invalid value... we can easily fix it with global variables...
About canceling to submit the forms, we can easily know if the value is valid or not... so the user (programmer) can just call a function to valid if the value is valid or not before submit the form.



I aslo removed the show effect because I think it's not really necessary and it's better when the list is show immediatly when we want it.
I also rewrite some code to show and hide the list options because it was a little buggy... the list didn't always appeared, but for that you'll need the changes into the html file (HtmlComboBox?.html (1.3 kB) - added by martin@… on 06/01/06 12:45:41)
I'll build you a diff file with your lastest code... I'll send you in a couple of hour...

Changed 13 years ago by martin@…

Attachment: ComboBox.diff added

Diff from nightly build 2006-06-08

comment:8 Changed 13 years ago by anonymous

Hi bill, I sent you my patch from the lastest nightly build... wow there a lot of changes hehe ;)

Martin

comment:9 Changed 13 years ago by martin@…

Don't forget that my code is builded with new html and css... nothing big... but little changes

I'll send you a rar of theses files.

Changed 13 years ago by martin@…

Attachment: templates.rar added

templates files (image, css, html)

comment:10 Changed 13 years ago by bill

Owner: changed from bill to morris
Status: assignednew
Summary: Some changes into ComboBox Widget to add static data feature (like access ComboBox)[patch] Some changes into ComboBox Widget to add static data feature (like access ComboBox)

Morris, can you take a look at this?

comment:11 Changed 13 years ago by bill

Owner: changed from morris to bill

OK, I looked over this patch. There are a lot of changes and I don't think we can take all of them. Maybe you are better off just keeping your own version of the widget. Alternately, if you can provide smaller patches for individual features I can probably merge them.

The Select widget implements the "Static options" and "onlyValues" thing, so you should really check that out.

About the style changes -- Torrey controls the images and styling for the widgets so I am going to leave any styling changes to him.

The allowEmptyValue seems unnecessary because it can be implemented by making one of the Select list drop down choices be "".

The delay in showing the drop down select list is because the drop down select list is often fetched over ajax.

comment:12 Changed 13 years ago by dylan

Summary: [patch] Some changes into ComboBox Widget to add static data feature (like access ComboBox)[patch][cla] Some changes into ComboBox Widget to add static data feature (like access ComboBox)

Sounds like we need this to split into smaller patches?

comment:13 Changed 13 years ago by bill

Resolution: wontfix
Status: newclosed

Yeah, I'm gonna close this bug for now. If we had smaller patches we might be able to apply them but basically a lot of the changes are differences in opinion about how Comobobox should work, so we can't do anything about those.

comment:14 Changed 12 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.