Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SmartGWT.mobile: Helloworld tutorial modified to display TabeView

    PROBLEM: I cannot display data in my TableView:

    Please advise. Here's a snapshot of what the browser looks like. The expected two rows with no console errors.

    Click image for larger version

Name:	Untitled.jpg
Views:	135
Size:	136.6 KB
ID:	238387

    1. SmartGWT.mobile: June 1st snapshot
    2. Chrome: Version 50.0.2661.102 (64-bit)
    3. Serverside N/A
    4. No server errors
    5. No JavaScript errors
    6. I put in my custom code for TableView in the getColorsView method.

    Code:
         public Panel getColorsView() {
              Panel panel = new ScrollablePanel("Colors");
              TableView tableView = new TableView();
              
              ListGridField pk = new ListGridField("bdid");
              ListGridField bp = new ListGridField("bid_price");
              ListGridField ap = new ListGridField("ask_price");
              ListGridField by = new ListGridField("bid_yield");
              ListGridField ay = new ListGridField("ask_yield");
              tableView.setFields(pk,bp,ap,by,ay);
              RecordList recs = new RecordList();
              Record rec = new Record();
              rec.setAttribute("bdid", 1);
              rec.setAttribute("bid_price", 1);
              rec.setAttribute("bid_yield", 1);
              rec.setAttribute("ask_yield", 1);
              rec.setAttribute("ask_yield", 1);
              recs.add(rec);
              rec = new Record();
              rec.setAttribute("bdid", 2);
              rec.setAttribute("bid_price", 2);
              rec.setAttribute("bid_yield", 2);
              rec.setAttribute("ask_yield", 2);
              rec.setAttribute("ask_yield", 2);
              recs.add(rec);
              
              tableView.setData(recs);
              panel.addMember(tableView);
              return panel;
          }
          public Panel getColorsView1() {
              Panel panel = new ScrollablePanel("Colors");
              String[] colors = new String[]{ "blue", "red", "yellow", "green", "gray", "white", "black", "pink", "brown" };
              for (int i = 0; i < 50; i++) {
                  String color = colors[(int) (Math.random() * colors.length)];
                  Button button = new Button(color);
                  button.setTintColor(color);
                  button.addClickHandler(new ClickHandler() {
                      public void onClick(ClickEvent event) {
                          navigationStack.push(getSportsView(((Button)event.getSource()).getTitle()));
                      }
                  });
                  panel.addMember(button);
              }
              return panel;
          }
    Attached Files

    #2
    Just discovered the showcase examples, which has enlightened me.

    Comment

    Working...
    X