Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Process Service and Templates (problem loading formData)
Process Service and Templates [message #753740] Fri, 28 October 2011 10:44 Go to next message
Bertin Kiekebosch is currently offline Bertin Kiekebosch
Messages: 300
Registered: August 2011
Senior Member
Hi,

I have created a more complex screen with tabs on it. Each tab contains data out of a template. If I open the form it needs to load the data but it cannot find the form variables.

I guess it has something to do with the formData and the use of the template. The variable used in this processService are almost all coming from the template AbstractPersoonlijkBoxData. I included the ClientFormData and the AbstractPersoonlijkBoxData at the bottom.

I cannot find what is wrong, names seem to be correct. A simple form is working and things seem to be identical.

ProcessingException[ProcessingStatus[ERROR code=0 invoking MPXRid.shared.services.process.IClientProcessService:load / SQL with binds:
SELECT    PINUMBER,
          INITIALS,
          FIRSTNAME,
          LASTNAME,
          INFIX,
          TITLE
FROM      CLIENT
WHERE     ID = :clientNr
INTO      :piNummer,
          :initialen,
          :voornaam,
          :achternaam,
          :tussenvoegsel,
          :aanroep
IN  :clientNr => ? [BIGINT 15903] / Cannot find output for 'ValueOutputToken[piNummer parsed ':piNummer', replaced ':piNummer' into]' in bind base. When selecting into shared context variables make sure these variables are initialized using CONTEXT.set<i>PropertyName</i>(null)]]
	at org.eclipse.scout.rt.server.services.common.jdbc.internal.exec.StatementProcessor.createOutput(StatementProcessor.java:934)
	at org.eclipse.scout.rt.server.services.common.jdbc.internal.exec.StatementProcessor.<init>(StatementProcessor.java:152)
	at org.eclipse.scout.rt.server.services.common.jdbc.AbstractSqlService.createStatementProcessor(AbstractSqlService.java:785)



public class ClientFormData extends AbstractFormData {
  private static final long serialVersionUID = 1L;

  public ClientFormData() {
  }

  public ClientNrProperty getClientNrProperty() {
    return getPropertyByClass(ClientNrProperty.class);
  }

  /**
   * access method for property ClientNr.
   */
  public Long getClientNr() {
    return getClientNrProperty().getValue();
  }

  /**
   * access method for property ClientNr.
   */
  public void setClientNr(Long clientNr) {
    getClientNrProperty().setValue(clientNr);
  }

  public PersoonlijkBox getPersoonlijkBox() {
    return getFieldByClass(PersoonlijkBox.class);
  }

  public class ClientNrProperty extends AbstractPropertyData<Long> {
    private static final long serialVersionUID = 1L;

    public ClientNrProperty() {
    }
  }

  public class PersoonlijkBox extends AbstractPersoonlijkBoxData {
    private static final long serialVersionUID = 1L;

    public PersoonlijkBox() {
    }
  }
}



@FormData(value = AbstractPersoonlijkBoxData.class, sdkCommand = FormData.SdkCommand.CREATE, defaultSubtypeSdkCommand = FormData.DefaultSubtypeSdkCommand.CREATE)
public abstract class AbstractPersoonlijkBox extends AbstractGroupBox {

  @Override
  protected String getConfiguredLabel() {
    return Texts.get("Persoonlijk");
  }

  public AanroepField getAanroepField() {
    return getFieldByClass(AanroepField.class);
  }

  public AchternaamField getAchternaamField() {
    return getFieldByClass(AchternaamField.class);
  }

  public PiNummerField getPiNummerField() {
    return getFieldByClass(PiNummerField.class);
  }

  public TussenvoegselField getTussenvoegselField() {
    return getFieldByClass(TussenvoegselField.class);
  }

  public VoorlettersField getVoorlettersField() {
    return getFieldByClass(VoorlettersField.class);
  }

  public VoornaamField getVoornaamField() {
    return getFieldByClass(VoornaamField.class);
  }

  @Order(10.0)
  public class PiNummerField extends AbstractStringField {

    @Override
    protected String getConfiguredLabel() {
      return Texts.get("PiNummer");
    }
  }

  @Order(20.0)
  public class AanroepField extends AbstractListBox<Long> {

    @Override
    protected String getConfiguredLabel() {
      return Texts.get("Aanroep");
    }
  }

  @Order(30.0)
  public class VoornaamField extends AbstractStringField {

    @Override
    protected String getConfiguredLabel() {
      return Texts.get("Voornaam");
    }
  }

  @Order(40.0)
  public class VoorlettersField extends AbstractStringField {

    @Override
    protected String getConfiguredLabel() {
      return Texts.get("Voorletters");
    }
  }

  @Order(50.0)
  public class TussenvoegselField extends AbstractStringField {

    @Override
    protected String getConfiguredLabel() {
      return Texts.get("Tussenvoegsel");
    }
  }

  @Order(60.0)
  public class AchternaamField extends AbstractStringField {

    @Override
    protected String getConfiguredLabel() {
      return Texts.get("Achternaam");
    }
  }
}


Re: Process Service and Templates [message #753805 is a reply to message #753740] Fri, 28 October 2011 15:56 Go to previous messageGo to next message
Ivan Motsch is currently offline Ivan Motsch
Messages: 100
Registered: March 2010
Senior Member
Maybe can you also post the shared class "AbstractPersoonlijkBoxData".
But i assume it is generated as default box data and the box data is named PersoonlijkBox.

1. did you pass the sql statement the form data object?

2. Since the person box is a template box - which is great -
the INTO variables need to be qualified since the template box is "inside" the formdata.
Only fields directly contained anywhere in the form are accessible top-level on the form data.
All template fields have one indirection, so need to be qualified by their indirection anhcor, the box data.

More simple, change the INTO in the SQL as follows:

SQL.selectInto(
  "SELECT    PINUMBER,"+
  "          INITIALS,"+
  "          FIRSTNAME,"+
  "          LASTNAME,"+
  "          INFIX,"+
  "          TITLE"+
  " FROM     CLIENT"+
  " WHERE    ID = :clientNr"+
  " INTO     :persoonlijkBox.piNummer,"+
  "          :persoonlijkBox.voorletters,"+
  "          :persoonlijkBox.voornaam,"+
  "          :persoonlijkBox.achternaam,"+
  "          :persoonlijkBox.tussenvoegsel,"+
  "          :persoonlijkBox.aanroep",
  formData  <--- THIS IS THE BIND BASE
);


Does that help?

[Updated on: Fri, 28 October 2011 15:57]

Report message to a moderator

Re: Process Service and Templates [message #753810 is a reply to message #753805] Fri, 28 October 2011 17:13 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin Kiekebosch
Messages: 300
Registered: August 2011
Senior Member
Works perfect,

thanks for the quick respons.
Re: Process Service and Templates [message #753936 is a reply to message #753805] Sun, 30 October 2011 16:34 Go to previous message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 117
Registered: November 2010
Senior Member
You can also do it the other way around:

SQL.selectInto(
  "SELECT    PINUMBER,"+
  "          INITIALS,"+
  "          FIRSTNAME,"+
  "          LASTNAME,"+
  "          INFIX,"+
  "          TITLE"+
  " FROM     CLIENT"+
  " WHERE    ID = :clientNr"+
  " INTO     :piNummer,"+
  "          :voorletters,"+
  "          :voornaam,"+
  "          :achternaam,"+
  "          :tussenvoegsel,"+
  "          :aanroep",
  formData.getPersoonlijkBox() <--- THIS IS THE BIND BASE
);


If two form datas FirstFormData and SecondFormData share the same template, you can create a method handling the datas contains in the form data with a function working with an instance of AbstractPersoonlijkBoxData.

public void storePersoonlijkBoxData(AbstractPersoonlijkBoxData boxData) {
  //handle
}


Wiki-page (quite empty for the moment) to store informations on templates:
http://wiki.eclipse.org/Scout/Concepts/Template
Previous Topic:Javadoc / Eclipse help
Next Topic:Scout - Indigo SR1 - Unable to export war
Goto Forum:
  


Current Time: Tue Jul 29 02:51:33 EDT 2014

Powered by FUDForum. Page generated in 0.09918 seconds