TypeAhead without UiBinder

245 views
Skip to first unread message

Jan Povala

unread,
Aug 30, 2013, 9:38:16 AM8/30/13
to gwt-bo...@googlegroups.com
Hey guys,
I've been trying to get TypeAead work without UiBinder and got this error:

WARN  c.g.g.l.client.LogConfiguration - Exception caught: Exception caught: (TypeError) : Cannot read property '_' of null

I've started learning gwt-bootstrap recently so I guess it's just my lack of understanding. Here is my code:

MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
oracle.add("Hello");
oracle.add("World");
Typeahead searchTypeAhead = new Typeahead(oracle);
TextBox searchBox = new TextBox();
searchTypeAhead.setWidget(searchBox);
navbar.add(searchTypeAhead);

Could someone please give me hints how to go about it withou using UiBinder?
Thanks in advance!


Notice:  This email is confidential and may contain copyright material of Ocado Limited (the "Company"). Opinions and views expressed in this message may not necessarily reflect the opinions and views of the Company.

If you are not the intended recipient, please notify us immediately and delete all copies of this message. Please note that it is your responsibility to scan this message for viruses.

Company reg. no. 3875000.

Ocado Limited
Titan Court
3 Bishops Square
Hatfield Business Park
Hatfield
Herts
AL10 9NE

Bram

unread,
Sep 2, 2013, 7:23:45 AM9/2/13
to gwt-bo...@googlegroups.com

You can look up the generated UIBinder_Impl class for the UIBinder example in the .generated folder. 
I recently made a view with typeahead for cities , the generated code looks like this: 


    private com.github.gwtbootstrap.client.ui.Typeahead get_cityTypeahead() {
      return build_cityTypeahead();
    }
    private com.github.gwtbootstrap.client.ui.Typeahead build_cityTypeahead() {
      // Creation section.
      final com.github.gwtbootstrap.client.ui.Typeahead cityTypeahead = (com.github.gwtbootstrap.client.ui.Typeahead) GWT.create(com.github.gwtbootstrap.client.ui.Typeahead.class);
      // Setup section.
      cityTypeahead.add(get_cityTextBox());


      owner.cityTypeahead = cityTypeahead;

      return cityTypeahead;
    }


hth, 

Bram
Message has been deleted

M. Venkateswara Rao

unread,
Sep 4, 2013, 9:05:29 AM9/4/13
to gwt-bo...@googlegroups.com

            Typeahead suggestBox = new Typeahead();
            TextBox suggesttext=new TextBox();
            suggesttext.getElement().setAttribute("placeholder","Rest,Cate,Item,Loc");
            suggestBox.add(suggesttext);
            MultiWordSuggestOracle oracle = (MultiWordSuggestOracle)suggestBox.getSuggestOracle();
            oracle.add("Ab1");
            oracle.add("Ab2");
            oracle.add("Ab3");
            oracle.add("Ab4");
            oracle.add("Ab5");
            absolutePanel.add(suggestBox, 250, 179);

Jan Povala

unread,
Sep 4, 2013, 9:58:00 AM9/4/13
to gwt-bo...@googlegroups.com
Venkateswara, thanks a lot for the code. I got it working with the help of your code!



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

Jan Povala

unread,
Sep 9, 2013, 6:37:45 AM9/9/13
to gwt-bo...@googlegroups.com
sorrry for another question, but is it possible at all to make TypeAhead working for NavSeach... I've been trying different things: trying to encapsulate inside NavWidget, etc... but no luck... I wonder if it is possible.

thanks
Reply all
Reply to author
Forward
0 new messages