isis-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Haywood <...@haywood-associates.co.uk>
Subject Re: Using org.apache.isis.applib.value.DateTime on View Model (JAXB) always return Current DateTime
Date Mon, 20 Nov 2017 09:41:53 GMT
Use @XmlTransient annotation on the injected service fields so that jaxb
ignores them.

This is just standard jaxb behaviour, there's nothing specific to Apache
Isis here.

On Mon, 20 Nov 2017, 08:44 SE Song, <sesong11@gmail.com> wrote:

> Dear Dan Haywood
>
> When I change to @XmlAccessorType(XmlAccessType.FIELD), I no longer be able
> to Inject Service on my VM any more. It's another exception as bellow
>
> Error marshalling domain object to XML, due to illegal annotations on
> domain object class
> 'domainapp.modules.request.dom.vm.leaveform.LeaveFormVM'; 1 errors
> reported:  org.apache.isis.applib.services.factory.FactoryService is an
> interface, and JAXB can't handle interfaces.
>
> If I use  @XmlAccessorType(XmlAccessType.PROPERTY)  it throw another
> exception
>
> Error marshalling domain object to XML, due to illegal annotations on
> domain object class
> 'domainapp.modules.request.dom.vm.leaveform.LeaveFormVM'; 2 errors
> reported: Class has two properties of the same name "leavingDate"; Class
> has two properties of the same name "returningDate"
>
> On Fri, Nov 17, 2017 at 5:57 PM, SE Song <sesong11@gmail.com> wrote:
>
> > Thank so much for your quick respond, Now I use Joda LocalDate and
> > annotation. It work for now
> >
> > On Fri, Nov 17, 2017 at 5:09 PM, Dan Haywood <
> dan@haywood-associates.co.uk
> > > wrote:
> >
> >> take a look at
> >> http://isis.apache.org/guides/ugfun/ugfun.html#_ugfun_progra
> >> mming-model_view-models_jaxb_joda-datatypes
> >>
> >>
> >> On Fri, 17 Nov 2017 at 10:07 SE Song <sesong11@gmail.com> wrote:
> >>
> >> > Dear All
> >> >
> >> > On my JAXB VM I has a DateTime property as bellow
> >> >
> >> > @Property(editing = Editing.ENABLED)
> >> > @Getter @Setter
> >> > public org.apache.isis.applib.value.DateTime isisDateTime;
> >> >
> >> > When I click to change value on my UI, it always change my value to
> >> Current
> >> > DateTime.
> >> >
> >> > I also try another types such as joda LocalDate, LocalDateTime... It
> >> still
> >> > the same.
> >> >
> >> > So I create another setter to debug my code, then I see that my setter
> >> has
> >> > been called 3 times. First time it's correct value, but second and
> >> thirst
> >> > it change to current date.
> >> >
> >> > My Question is, why it has been call many times? why it always change
> my
> >> > value?
> >> >
> >>
> >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message