|
Re: Form ViewModel Customisation [message #1385646 is a reply to message #1385354] |
Tue, 10 June 2014 08:33 |
Jonas Helming 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
|
|
|
Powered by
FUDForum. Page generated in 0.02874 seconds