LazyLoading-Select with empty or invalid values

Currently (4.0.3) LazyLoading-Select doesn’t send changes to server when value is invalid or null! I added NullValidator to Select but it doesn’t work as empty values are not sent to server at all.

I want a Select that changes Select style to “Select-invalid” when user types invalid or empty value. In theory I could make this functionality listening optionstream requests and by making validators there, any suggestions?

If you wish to stay away from client-side coding, you’ll have to do with customfilter which makes client send every keystroke to server and lets your server-side code to react as you wish, see this message here:
http://forum.itmill.com/posts/list/331.page

I tried making optionstream listener with custom filter but it only moves real problem elsewhere.

Now it correctly changes styling when user types but problem is now that typed value != selects value.

Example if my select contains “123”, “234” and “345”. And i first select “234”
and then type “asdfasdga”. Value of select stays to “234” but my filter changes styling to invalid-style.

That is correct. You cannot select non-existent ("asdfasdga) value from any Container, to enhance “filterselect” component to work in such way requires client-side coding, see Select widget from client-side code under /WebContent/WEB-INF/lib/themes/base/script/base-ajax-components.js .

Your Select component should be fixed.
Imagine this scenario:

Layout with 2 LazyLoading-selects and save-button. Layout shows some data from database.

  1. User navigates to this layout and all Select’s gets their default values that are not null and are valid.
  2. User alters first select by writing something that Select doesn’t contain. Select goes red for few seconds but then gets it’s normal look even entered value is invalid.
  3. Users selects VALID value from Select number 2.

Now at this point, user has altered both Select’s but he is unaware that value for Select 1 is invalid and REAL VALUE is still the default value and server will save the default value again if he presses save-button.

Please note that Select with lazyloading activated is used only for finding data, hence the “red” expresses that no items found. It is not used for entering new data.

We really should thrown exception if developer tries to set both lazyloading and newitemsallowed to true. Entering new data and finding (/filtering) new data conflict with each other, you cannot use both.

I think you are looking for a component which works exactly like Select with lazyloading activated but instead of filtering capabilities, end user may enter new items to container. This is not that hard to do but requires some javascript coding with Toolkit 4.

If you do not wish to get into client-side coding, as a workaround I suggest you add e.g. “add new” button beside to your Select component which opens new window containing “new item value” textfield and “save” / “cancel” buttons.

I’m not adding new values. It’s another post.
This problem is that null values are not send to server.
Once again:
If I have select with “123”, “234”,“345” where “123” is selected.

Select.getValue() return now “123”.

Now if user writes “555” to that select it SHOWS 555 to user but
Select.getValue() returns “123”. This behavior is clearly a bug, shown value should always be same as REAL value when component doens’t have focus.

Null values should also sent to a server!
If user now clears that select to “” value and lets says clicks another select-component. Previous select component still shows “” but Select.getValue returns “123”.

That is true - this sounds like a potential bug.

What about that invalid-value. It’s a bug too. Imho it could be set so that if component loses focus when textfield contains invalid-filtering, value would automatically be set to “”.

Second that.

Filed bug reports for the both issues.

thanks a lot, I appreciate that!
What do you suspect, how long might it take before there is new 4.x.x build with these bugs fixed?
I’m just considering whether to copy Select and alter it myself or wait for official fixes.

Both of these bugs are easy to fix. I scheduled Toolkit version 4.0.4 for next week, we’ll postpone some other changesets for 4.0.5 which comes out most likely within few weeks after 4.0.4 is out, but this minor inconvenience for us.

Here’s 4.0.4-rc1, note that this is release candidate which is not fully verified (yet) to work. This build has both of your issues solved, I’ll keep it online until 4.0.4 final is out.

http://toolkit.itmill.com/itmill-toolkit-4.0.4-rc1.zip

Yes, it look like a bug.


ipod nano converter


dvd to ipod nano

Really? It won’t need too much time?


ipod nano converter


dvd to ipod nano