[jira] [Commented] (ISIS-852) Derived property cannot be written properly

2014-10-09 Thread Dan Haywood (JIRA)

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

Dan Haywood commented on ISIS-852:
--

OK, so I've fixed this to be supported, and also updated the documentation page.

Thanks for flagging the issue.

docs: see staging: 
http://isis.staging.apache.org/more-advanced-topics/how-to-04-010-How-to-make-a-derived-property.html
(as I write this, still waiting for build to come through on main site...).




> Derived property cannot be written properly
> ---
>
> Key: ISIS-852
> URL: https://issues.apache.org/jira/browse/ISIS-852
> Project: Isis
>  Issue Type: Bug
>  Components: Viewer: Wicket
>Affects Versions: viewer-wicket-1.6.0
>Reporter: Thomas Koren
>Assignee: Dan Haywood
> Fix For: core-1.7.0
>
>
> when using the proposed modifyXxx syntax to make a derived property writable, 
> it is rendered as "disabled" in wicket viewer.
> {code:title=demo|borderStyle=solid}
> public LocalDate getDerivedDate() { ... }
> public void modifyDerivedDate(final LocalDate date) { ... }
> {code}
> when using the alternative setXxx syntax, the UI component is writable. but 
> in this case, the value of the derived property is not written to the 
> persisted property.
> {code:title=demo|borderStyle=solid}
> // {{ BeginAt (property)
> @javax.jdo.annotations.Persistent
> private DateTime beginAt;
> @Disabled
> @javax.jdo.annotations.Column(allowsNull = "false")
> public DateTime getBeginAt() {
> return beginAt;
> }
> public void setBeginAt(final DateTime beginAt) {
> this.beginAt = beginAt;
> }
> // }}
> // {{ DerivedDate (property)
> @NotPersisted
> @NotPersistent
> public LocalDate getDerivedDate() {
> return getBeginAt().toLocalDate();
> }
> public void setDerivedDate(final LocalDate beginDate) {
> setBeginAt(getBeginAt().withDate(beginDate.getYear(), 
> beginDate.getMonthOfYear(), beginDate.getDayOfMonth()));
> }
> // }}
> {code}
> it seems like the value set by the derived property gets overwritten by the 
> original/old value of the persisted property that is displayed in the wicket 
> component.
> therefore it might only be an issue, if original and derived properties are 
> members of the same entity and displayed via wicket viewer.
> some background:
> i try to use 3 ui components  (= derived properties: date, hour, minute) to 
> set a single persisted DateTime property.



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


[jira] [Commented] (ISIS-852) Derived property cannot be written properly

2014-10-09 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on ISIS-852:
--

Commit 1630539 from [~danhaywood] in branch 'site/trunk'
[ https://svn.apache.org/r1630539 ]

ISIS-852

> Derived property cannot be written properly
> ---
>
> Key: ISIS-852
> URL: https://issues.apache.org/jira/browse/ISIS-852
> Project: Isis
>  Issue Type: Bug
>  Components: Viewer: Wicket
>Affects Versions: viewer-wicket-1.6.0
>Reporter: Thomas Koren
>Assignee: Dan Haywood
> Fix For: core-1.7.0
>
>
> when using the proposed modifyXxx syntax to make a derived property writable, 
> it is rendered as "disabled" in wicket viewer.
> {code:title=demo|borderStyle=solid}
> public LocalDate getDerivedDate() { ... }
> public void modifyDerivedDate(final LocalDate date) { ... }
> {code}
> when using the alternative setXxx syntax, the UI component is writable. but 
> in this case, the value of the derived property is not written to the 
> persisted property.
> {code:title=demo|borderStyle=solid}
> // {{ BeginAt (property)
> @javax.jdo.annotations.Persistent
> private DateTime beginAt;
> @Disabled
> @javax.jdo.annotations.Column(allowsNull = "false")
> public DateTime getBeginAt() {
> return beginAt;
> }
> public void setBeginAt(final DateTime beginAt) {
> this.beginAt = beginAt;
> }
> // }}
> // {{ DerivedDate (property)
> @NotPersisted
> @NotPersistent
> public LocalDate getDerivedDate() {
> return getBeginAt().toLocalDate();
> }
> public void setDerivedDate(final LocalDate beginDate) {
> setBeginAt(getBeginAt().withDate(beginDate.getYear(), 
> beginDate.getMonthOfYear(), beginDate.getDayOfMonth()));
> }
> // }}
> {code}
> it seems like the value set by the derived property gets overwritten by the 
> original/old value of the persisted property that is displayed in the wicket 
> component.
> therefore it might only be an issue, if original and derived properties are 
> members of the same entity and displayed via wicket viewer.
> some background:
> i try to use 3 ui components  (= derived properties: date, hour, minute) to 
> set a single persisted DateTime property.



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


[jira] [Commented] (ISIS-852) Derived property cannot be written properly

2014-10-09 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on ISIS-852:
--

Commit 1b10065e7fefc591e7e510ecb7a5ea6dba17f485 in isis's branch 
refs/heads/master from [~danhaywood]
[ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=1b10065 ]

ISIS-852: updateable derived properties that have just a getter and a 
modifyXxx() method.


> Derived property cannot be written properly
> ---
>
> Key: ISIS-852
> URL: https://issues.apache.org/jira/browse/ISIS-852
> Project: Isis
>  Issue Type: Bug
>  Components: Viewer: Wicket
>Affects Versions: viewer-wicket-1.6.0
>Reporter: Thomas Koren
>Assignee: Dan Haywood
> Fix For: core-1.7.0
>
>
> when using the proposed modifyXxx syntax to make a derived property writable, 
> it is rendered as "disabled" in wicket viewer.
> {code:title=demo|borderStyle=solid}
> public LocalDate getDerivedDate() { ... }
> public void modifyDerivedDate(final LocalDate date) { ... }
> {code}
> when using the alternative setXxx syntax, the UI component is writable. but 
> in this case, the value of the derived property is not written to the 
> persisted property.
> {code:title=demo|borderStyle=solid}
> // {{ BeginAt (property)
> @javax.jdo.annotations.Persistent
> private DateTime beginAt;
> @Disabled
> @javax.jdo.annotations.Column(allowsNull = "false")
> public DateTime getBeginAt() {
> return beginAt;
> }
> public void setBeginAt(final DateTime beginAt) {
> this.beginAt = beginAt;
> }
> // }}
> // {{ DerivedDate (property)
> @NotPersisted
> @NotPersistent
> public LocalDate getDerivedDate() {
> return getBeginAt().toLocalDate();
> }
> public void setDerivedDate(final LocalDate beginDate) {
> setBeginAt(getBeginAt().withDate(beginDate.getYear(), 
> beginDate.getMonthOfYear(), beginDate.getDayOfMonth()));
> }
> // }}
> {code}
> it seems like the value set by the derived property gets overwritten by the 
> original/old value of the persisted property that is displayed in the wicket 
> component.
> therefore it might only be an issue, if original and derived properties are 
> members of the same entity and displayed via wicket viewer.
> some background:
> i try to use 3 ui components  (= derived properties: date, hour, minute) to 
> set a single persisted DateTime property.



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


[jira] [Commented] (ISIS-852) Derived property cannot be written properly

2014-08-13 Thread Jeroen van der Wal (JIRA)

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

Jeroen van der Wal commented on ISIS-852:
-

You're right! According to the documentation it should be possible. In Estatio 
we have never gone this route. Probably Dan can elaborate on this.

> Derived property cannot be written properly
> ---
>
> Key: ISIS-852
> URL: https://issues.apache.org/jira/browse/ISIS-852
> Project: Isis
>  Issue Type: Bug
>  Components: Viewer: Wicket
>Affects Versions: viewer-wicket-1.6.0
>Reporter: Thomas Koren
>Assignee: Dan Haywood
>
> when using the proposed modifyXxx syntax to make a derived property writable, 
> it is rendered as "disabled" in wicket viewer.
> {code:title=demo|borderStyle=solid}
> public LocalDate getDerivedDate() { ... }
> public void modifyDerivedDate(final LocalDate date) { ... }
> {code}
> when using the alternative setXxx syntax, the UI component is writable. but 
> in this case, the value of the derived property is not written to the 
> persisted property.
> {code:title=demo|borderStyle=solid}
> // {{ BeginAt (property)
> @javax.jdo.annotations.Persistent
> private DateTime beginAt;
> @Disabled
> @javax.jdo.annotations.Column(allowsNull = "false")
> public DateTime getBeginAt() {
> return beginAt;
> }
> public void setBeginAt(final DateTime beginAt) {
> this.beginAt = beginAt;
> }
> // }}
> // {{ DerivedDate (property)
> @NotPersisted
> @NotPersistent
> public LocalDate getDerivedDate() {
> return getBeginAt().toLocalDate();
> }
> public void setDerivedDate(final LocalDate beginDate) {
> setBeginAt(getBeginAt().withDate(beginDate.getYear(), 
> beginDate.getMonthOfYear(), beginDate.getDayOfMonth()));
> }
> // }}
> {code}
> it seems like the value set by the derived property gets overwritten by the 
> original/old value of the persisted property that is displayed in the wicket 
> component.
> therefore it might only be an issue, if original and derived properties are 
> members of the same entity and displayed via wicket viewer.
> some background:
> i try to use 3 ui components  (= derived properties: date, hour, minute) to 
> set a single persisted DateTime property.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (ISIS-852) Derived property cannot be written properly

2014-08-13 Thread Thomas Koren (JIRA)

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

Thomas Koren commented on ISIS-852:
---

not ideal, but I can live with that.

still I think the documentation[1] is quite misleading here.

[1] 
https://isis.apache.org/more-advanced-topics/how-to-04-010-How-to-make-a-derived-property.html

> Derived property cannot be written properly
> ---
>
> Key: ISIS-852
> URL: https://issues.apache.org/jira/browse/ISIS-852
> Project: Isis
>  Issue Type: Bug
>  Components: Viewer: Wicket
>Affects Versions: viewer-wicket-1.6.0
>Reporter: Thomas Koren
>Assignee: Dan Haywood
>
> when using the proposed modifyXxx syntax to make a derived property writable, 
> it is rendered as "disabled" in wicket viewer.
> {code:title=demo|borderStyle=solid}
> public LocalDate getDerivedDate() { ... }
> public void modifyDerivedDate(final LocalDate date) { ... }
> {code}
> when using the alternative setXxx syntax, the UI component is writable. but 
> in this case, the value of the derived property is not written to the 
> persisted property.
> {code:title=demo|borderStyle=solid}
> // {{ BeginAt (property)
> @javax.jdo.annotations.Persistent
> private DateTime beginAt;
> @Disabled
> @javax.jdo.annotations.Column(allowsNull = "false")
> public DateTime getBeginAt() {
> return beginAt;
> }
> public void setBeginAt(final DateTime beginAt) {
> this.beginAt = beginAt;
> }
> // }}
> // {{ DerivedDate (property)
> @NotPersisted
> @NotPersistent
> public LocalDate getDerivedDate() {
> return getBeginAt().toLocalDate();
> }
> public void setDerivedDate(final LocalDate beginDate) {
> setBeginAt(getBeginAt().withDate(beginDate.getYear(), 
> beginDate.getMonthOfYear(), beginDate.getDayOfMonth()));
> }
> // }}
> {code}
> it seems like the value set by the derived property gets overwritten by the 
> original/old value of the persisted property that is displayed in the wicket 
> component.
> therefore it might only be an issue, if original and derived properties are 
> members of the same entity and displayed via wicket viewer.
> some background:
> i try to use 3 ui components  (= derived properties: date, hour, minute) to 
> set a single persisted DateTime property.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (ISIS-852) Derived property cannot be written properly

2014-08-13 Thread Jeroen van der Wal (JIRA)

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

Jeroen van der Wal commented on ISIS-852:
-

I don't know if this is a bug, Isis is just not designed to enable editing of 
derived properties. The pattern we are using is disabling the edit button (by 
adding @Immutable) and only allow changes through an action. In your case:

{code}
@javax.jdo.annotations.Persistent
private DateTime beginAt;

public DateTime getBeginAt() {
return beginAt;
}

public void setBeginAt(DateTime beginAt) {
this.beginAt = beginAt;
}

public AbstractDomainObject changeBeginDate(LocalDate beginDate) {
setBeginAt(getBeginAt().withDate(beginDate.getYear(), 
beginDate.getMonthOfYear(), beginDate.getDayOfMonth()));
return this;
}
{code}

> Derived property cannot be written properly
> ---
>
> Key: ISIS-852
> URL: https://issues.apache.org/jira/browse/ISIS-852
> Project: Isis
>  Issue Type: Bug
>  Components: Core, Core: Objectstore: JDO
>Affects Versions: objectstore-jdo-1.5.0, core-1.5.0
>Reporter: Thomas Koren
>Assignee: Dan Haywood
>
> when using the proposed modifyXxx syntax to make a derived property writable, 
> it is rendered as "disabled" in wicket viewer.
> {code:title=demo|borderStyle=solid}
> public LocalDate getDerivedDate() { ... }
> public void modifyDerivedDate(final LocalDate date) { ... }
> {code}
> when using the alternative setXxx syntax, the UI component is writable. but 
> in this case, the value of the derived property is not written to the 
> persisted property.
> {code:title=demo|borderStyle=solid}
> // {{ BeginAt (property)
> @javax.jdo.annotations.Persistent
> private DateTime beginAt;
> @Disabled
> @javax.jdo.annotations.Column(allowsNull = "false")
> public DateTime getBeginAt() {
> return beginAt;
> }
> public void setBeginAt(final DateTime beginAt) {
> this.beginAt = beginAt;
> }
> // }}
> // {{ DerivedDate (property)
> @NotPersisted
> @NotPersistent
> public LocalDate getDerivedDate() {
> return getBeginAt().toLocalDate();
> }
> public void setDerivedDate(final LocalDate beginDate) {
> setBeginAt(getBeginAt().withDate(beginDate.getYear(), 
> beginDate.getMonthOfYear(), beginDate.getDayOfMonth()));
> }
> // }}
> {code}
> it seems like the value set by the derived property gets overwritten by the 
> original/old value of the persisted property that is displayed in the wicket 
> component.
> therefore it might only be an issue, if original and derived properties are 
> members of the same entity and displayed via wicket viewer.
> some background:
> i try to use 3 ui components  (= derived properties: date, hour, minute) to 
> set a single persisted DateTime property.



--
This message was sent by Atlassian JIRA
(v6.2#6252)