Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Creating new Form to TablePage(Appointment another type of variable to Form Id)
Creating new Form to TablePage [message #1708600] Fri, 18 September 2015 04:06 Go to next message
barust Mising name is currently offline barust Mising nameFriend
Messages: 57
Registered: February 2014
Member
Hi,

For instance, if I have a TablePage with the primary key of type String and want to create a form with a Form Id of type String.
If you follow the recommendations of the tutorial to create a new form for the TablePage, you will see that it creates a default form with the primary key of type Long. Although I would like to take the form of type String.

I decide it so,
- Create a form without a primary key.
- After, I add a new variable CompanyNr to the form with the primary key of type String.

I have a question,
Is Form Wizard detect which type of variable primary key it appoints to the form?
Is this a bug or is it the way it should be?

Thanks.

[Updated on: Sat, 19 September 2015 06:39]

Report message to a moderator

Re: Creating new Form to TablePage [message #1708753 is a reply to message #1708600] Sun, 20 September 2015 08:37 Go to previous messageGo to next message
sherif samir is currently offline sherif samirFriend
Messages: 2
Registered: May 2015
Junior Member
i don't think the Form Wizard detect which type of variable primary key it appoints to the form, i tried before with Int and i change the type of setters and getters in my code, you can open a bug for this one.
Re: Creating new Form to TablePage [message #1708872 is a reply to message #1708753] Tue, 22 September 2015 07:04 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Yes the "Form Id" option of the "New Form" wizard is limited to Long and to Id ending with "Nr".
index.php/fa/23325/0/

Creating a new String variable after the form creation is the way to go (For example "PersonId" for this example).

What works, is that when you create a new menu (for example an EditPerson Menu) in the Table Page, the value contained in the selected primary key column (PersonIdColumn in this case) will be transferred to the form variable (String PersonId variable in this case).
@Order(10.0)
public class EditPersonMenu extends AbstractExtensibleMenu {

  @Override
  protected String getConfiguredText() {
    return TEXTS.get("EditPerson");
  }

  @Override
  protected void execAction() throws ProcessingException {
    PersonForm form = new PersonForm();
    form.setPersonId(getPersonIdColumn().getSelectedValue()); // <== Here
    form.startModify();
    form.waitFor();
    if (form.isFormStored()) {
      reloadPage();
    }
  }
}

  • Attachment: New_form.png
    (Size: 25.17KB, Downloaded 288 times)
Re: Creating new Form to TablePage [message #1709002 is a reply to message #1708872] Wed, 23 September 2015 08:50 Go to previous message
barust Mising name is currently offline barust Mising nameFriend
Messages: 57
Registered: February 2014
Member
IMHO, the solution to this problem should be this:

http://img3.tempfile.ru/14265/12d2f081e4/ef04d7832f0e55ae121e782d.png

Or keep in mind this problem. Crying or Very Sad
  • Attachment: NewForm.png
    (Size: 27.32KB, Downloaded 138 times)

[Updated on: Wed, 23 September 2015 09:06]

Report message to a moderator

Previous Topic:Scout context menu on ValueFields in RAP
Next Topic:Smartfield - Key Shortcut for Browse New
Goto Forum:
  


Current Time: Fri Apr 19 16:47:12 GMT 2024

Powered by FUDForum. Page generated in 0.02568 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top