Tuesday, August 27, 2013

Re: SuggestBox with keydownhandler event - Question

On Monday, August 26, 2013 8:57:47 PM UTC+2, fedex wrote:
Hi everyone,

For my application, I am adding a suggestbox on the front interface so when user types in any letter corresponding list (we won't add the list to the interface. It will be shown as the user types in and changes correspondingly when the letters changes as we generally see in online websites) matching to that letter needs to appear on the front interface. I am using keydownhandler event to obtain this.As you can see the below code, I am making an RPC call to obtain the list of data from the oracle database . Suppose user has typed in letter 'D' the following query runs 
"String sql = "select NAME from DOM_REFERENCE_TABLE where DESCRIPTION = 'NationalAccountDetails' AND NAME LIKE upper ('" + tablename +"%') ORDER BY NAME ASC";

"Oh yes, Little Bobby Tables, we call him." — http://xkcd.com/327/
where tablename value is 'D', so it gets all  values starting with letter 'D' from database. This list will then be added to the oracle (MultiWordSuggestOracle) object as shown in the below code(see at Response of RPC call Tag). So, the problem is the list that needs to appear when user types in letter'D' doesn't happen for the first time but happens when user types in Next time. I guess you people understood what I am trying to say. As the list gets added to oracle with keydown event it is not showing at that time but it will show for next event. But I need the matching list to be shown in the same event. How can I achieve this? Any suggestions? Let me know I need to clarify more on this. Thanks in advance

There's an RPCSuggestOracle in the old GWT-Incubator project that you can use as a "template": https://code.google.com/p/google-web-toolkit-incubator/source/browse/trunk/src/com/google/gwt/widgetideas/client/RPCSuggestOracle.java
See also https://gerrit.googlesource.com/gerrit/+/master/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/RPCSuggestOracle.java, that might be helpful (as an approach to decouple the RPC requests from the UI/UX handling) 

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment