Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Form ViewModel Customisation
Form ViewModel Customisation [message #1385354] Thu, 05 June 2014 19:13 Go to next message
Annamalai Mising name is currently offline Annamalai Mising nameFriend
Messages: 126
Registered: July 2009
Senior Member
Hello There

I was working with the Form View Model to customise the Form Editor. To
start with, i should congratulate the ECP Team to provide this wonderful
feature when compared to customisation in 1.3.

Now coming to my problem. I hav a class called as Person. And Person is
extended by Student and Staff. Now person has First Name and Last Name.
I wanted First Name and Last Name to be grouped Horizontally.

So i created a View Model for Person Class and then created a Horizontal
Layout and moved FirstName and LastName into it.

I expected that when i open Student or Staff, i would see FirstName and
LastName grouped together Horizontally. But that wasnt the case. Then i
realised that i have to create 2 view models 1 for student and 1 for
staff and then it works.

Therefore what i concluded is that Parent Class View Model isnt applied
to Child Class. Is my conclusion correct and isnt this a bug.

Regards
Malai
Re: Form ViewModel Customisation [message #1385646 is a reply to message #1385354] Tue, 10 June 2014 08:33 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Yes, your conclusion is correct. Combining views along an inheritance
relationship is unfortunately not as simple as it seems. In your case,
you probably want to see the attributes of the super class first and
then the attributes of the sub class. But this is not the only way to
go. Therefore, by default, we create a view model for every entity.
However, it is possible to programatically include things from super
classes. We have several custom solutions for this in place. I think the
best solution is to add something like a "referenced view" to the view
model. This could point to the super class. It would allow to specify,
where the attributes of a super class would be rendered within the layout.

Am 05.06.2014 21:13, schrieb Annamalai:
> Hello There
>
> I was working with the Form View Model to customise the Form Editor. To
> start with, i should congratulate the ECP Team to provide this wonderful
> feature when compared to customisation in 1.3.
>
> Now coming to my problem. I hav a class called as Person. And Person is
> extended by Student and Staff. Now person has First Name and Last Name.
> I wanted First Name and Last Name to be grouped Horizontally.
>
> So i created a View Model for Person Class and then created a Horizontal
> Layout and moved FirstName and LastName into it.
>
> I expected that when i open Student or Staff, i would see FirstName and
> LastName grouped together Horizontally. But that wasnt the case. Then i
> realised that i have to create 2 view models 1 for student and 1 for
> staff and then it works.
>
> Therefore what i concluded is that Parent Class View Model isnt applied
> to Child Class. Is my conclusion correct and isnt this a bug.
>
> Regards
> Malai
Previous Topic:View Model NullPointerException
Next Topic:[EMF Forms]Text Box Sizes
Goto Forum:
  


Current Time: Mon Apr 19 19:53:03 GMT 2021

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

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

Back to the top