[ 
https://issues.apache.org/jira/browse/ISIS-899?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14151022#comment-14151022
 ] 

Jeroen van der Wal commented on ISIS-899:
-----------------------------------------

Hi Vladimir,

I don't see any call to the mementoservice to generate a string respresentation 
of the state of the objects, in Isis 1.6 you have to generate that first before 
instantiating the viewmodel.

In Isis 1.7.0-SNAPSHOT you just have to annotate the pojo with @ViewModel and 
the memento will be generated behind the curtains based on the setters:
{code}
@ViewModel
public class Address {

    public String title() {
        return "Address lkmsId:" + lkmsId;
    }

    private Street street;

    @MemberOrder(sequence = "3")
    public Street getStreet() {
        return street;
    }

    public void setStreet(final Street street) {
        this.street = street;
    }
    ...
}
{code}

{code}
@ViewModel
public class Street {
    ....
}
{code}

{code}
public class AsePublicService {
    @Render(Type.EAGERLY)
    public Address getAddress(@Named("Source System") final String 
sourceSystem, @Named("User") final String user, @Named("Agent") final String 
agent, @Named("LKMS-ID") final String lkmsId, @Named("Valid Location") final 
boolean validLocation) {
        final Address address = new Address();
        address.setHousenumber("12");
        Street street = new Street();
        street.setStreetname("5th Avenue");
        address.setStreet(street);
        return address;
   }
   ...
{code}

The isPersistent=true looks like a bug.

> Can't return a view model in Isis 1.6.0 over RO viewer.
> -------------------------------------------------------
>
>                 Key: ISIS-899
>                 URL: https://issues.apache.org/jira/browse/ISIS-899
>             Project: Isis
>          Issue Type: Bug
>          Components: Core: Viewer: RestfulObjects
>    Affects Versions: core-1.6.0
>            Reporter: Dan Haywood
>            Assignee: Dan Haywood
>             Fix For: core-1.7.0
>
>         Attachments: Address.java, AsePublicService.java, Street.java, 
> Wicket.png
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to