2

I'm learning how to use Eclipse Scout and started with the tutorials found at Eclipse Scout Tutorials

I've proudly completed the first hello world tutorial and got stuck while trying to complete the Minicrm Tutorial

Everything went well until this step, when I needed to restart the server and any of the GUI clients to see that the table in the outline I just created is not well formatted. The problem: None of the clients show me the created table, they are all empty.

Empty Application

I ticked the visible field in every newly added column (all but the primary key column) and I don't see why no table is shown. I even tried to go on with the tutorial and setting the column width to 200 as desired, but still no table. I pasted the code for the Class CompanyTablePage below. A screenshot of the Scout Explorer is also provided. I really just started with Eclipse Scout and would appreciate any help or hints!

Thanks, Isa

 /**
 * 
 */
package org.eclipsescout.demo.minicrm.client;

import org.eclipse.scout.commons.annotations.Order;
import org.eclipse.scout.commons.annotations.PageData;
import org.eclipse.scout.rt.client.ui.basic.table.columns.AbstractLongColumn;
import org.eclipse.scout.rt.client.ui.basic.table.columns.AbstractStringColumn;
import org.eclipse.scout.rt.client.ui.desktop.outline.pages.AbstractPageWithTable;
import org.eclipse.scout.rt.extension.client.ui.basic.table.AbstractExtensibleTable;
import org.eclipse.scout.rt.shared.TEXTS;
import org.eclipsescout.demo.minicrm.client.CompanyTablePage.Table;
import org.eclipsescout.demo.minicrm.shared.CompanyTablePageData;
import org.eclipsescout.demo.minicrm.client.CompanyTablePage.Table.NameColumn;

/**
 * @author Isa
 */
@PageData(CompanyTablePageData.class)
public class CompanyTablePage extends AbstractPageWithTable<Table> {

  @Override
  protected String getConfiguredTitle() {
    return TEXTS.get("Company");
  }

  @Order(10.0)
  public class Table extends AbstractExtensibleTable {

    /**
     * @return the ShortNameColumn
     */
    public ShortNameColumn getShortNameColumn() {
      return getColumnSet().getColumnByClass(ShortNameColumn.class);
    }

    /**
     * @return the NameColumn
     */
    public NameColumn getNameColumn() {
      return getColumnSet().getColumnByClass(NameColumn.class);
    }

    /**
     * @return the CompanyNrColumn
     */
    public CompanyNrColumn getCompanyNrColumn() {
      return getColumnSet().getColumnByClass(CompanyNrColumn.class);
    }

    @Order(10.0)
    public class CompanyNrColumn extends AbstractLongColumn {

      @Override
      protected boolean getConfiguredDisplayable() {
        return false;
      }

      @Override
      protected boolean getConfiguredPrimaryKey() {
        return true;
      }

      @Override
      protected boolean getConfiguredVisible() {
        return false;
      }
    }

    @Order(20.0)
    public class ShortNameColumn extends AbstractStringColumn {

      @Override
      protected String getConfiguredHeaderText() {
        return TEXTS.get("ShortName");
      }

      @Override
      protected int getConfiguredWidth() {
        return 200;
      }
    }

    @Order(30.0)
    public class NameColumn extends AbstractStringColumn {

      @Override
      protected String getConfiguredHeaderText() {
        return TEXTS.get("Name");
      }

      @Override
      protected int getConfiguredWidth() {
        return 200;
      }
    }
  }
}

Scout Explorer

Isa
  • 1,121
  • 3
  • 10
  • 17

1 Answers1

2

it seems to me that you selected the wrong template when you created your Scout project.

Are you sure you choose "Outline based application" ?

Scout SDK Wizard - New Scout project - Scout Application Template

The different types are described here: type of application.

The main difference is located in Desktop#execOpened() of your scout application. You will need to change this implementation by hand.

Depending on the chosen template, the SDK add some default elements (a Form, an Outline...) during the project creation. You can add these elements after the project creation.

Jmini
  • 9,189
  • 2
  • 55
  • 77
matthias
  • 1,938
  • 23
  • 51
  • Hey Matthias, thank you for your answer. It might be that I've overlooked this step on the tutorial. I'll try to create a new project and tick your answer as correct if it works. But is there any way I could correct this without creating a new project? – Isa Sep 02 '14 at 13:45
  • 1
    Hi Isa, well yes of course it would be possible. However it would take much more time than just to recreate the project since you are early in development. Hope this helps – matthias Sep 03 '14 at 07:40
  • 1
    I agree with Matthias the easiest way is to select the appropriate template when you create the template. But there is no black magic and even if we have 3 templates, it is just a question of what do you want to do by hand and what do you want to generate. I edited the answer to add this information – Jmini Sep 04 '14 at 07:22