Search code examples
javaeclipseeclipse-scout

Table of StandardOutline not shown in GUI of Eclipse Scout


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


Solution

  • 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.