1

MVVM Combobox Dynamic Loading

asked 2013-11-11 16:25:46 +0800

juergenmw gravatar image juergenmw
79 1

updated 2013-11-11 23:03:22 +0800

Hi

I am using the MVVM pattern and I try to use a ComboBox that is capable of suggesting matching entries based on a DB query. So eg. if the user enters "a" the combobox should fetch data from the DB ("SELECT .... WHERE name like 'a%'") and display them.

I tried to use the onChanging event to get informed whenever a user types something. I was able to retrieve the ComboBox value by using

@BindingParam("v") String value, @ContextParam(ContextType.TRIGGER_EVENT) InputEvent event

in the related method with the @Command annotation. The problem is, the behavior of the ComboBox then is kind of weird due to the NotifyChange command that is needed to inform the MVVM about the changed list.

Is there a standard way to achieve this or maybe ComboBox is the wrong input type?

Thanks in advance!

delete flag offensive retag edit

Comments

A few questions, Underlining technology is JPA? Or better explained, Do you create real objects after the sql query or is the result from sql directly into the combobox? Then do you use a model or not?

chillworld ( 2013-11-12 11:02:28 +0800 )edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-11-11 16:25:46 +0800

Seen: 32 times

Last updated: Nov 11 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More