You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Jo...@filternet.nl on 2014/07/20 22:55:24 UTC
optional field (property)?
Hi,
�
I am just starting with Isis.
I want a field (property) to be optional and coded:
�private String middleName;
�� �
� � @Named("tussen")
� � @javax.jdo.annotations.Column(allowsNull = "true")
� � @MemberOrder(sequence = "2")
� � @Optional
�
But in the user interface it is still mandatory.�
�
Can somebody help?
�
Tnx, johan.
Re: optional field (property)?
Posted by Dan Haywood <da...@haywood-associates.co.uk>.
On 20 July 2014 21:55, <Jo...@filternet.nl> wrote:
> Hi,
>
>
>
>
> I am just starting with Isis.
>
Hi Johan, welcome to the Isis mailing list.
>
> I want a field (property) to be optional and coded:
>
> private String middleName;
>
>
>
> @Named("tussen")
>
> @javax.jdo.annotations.Column(allowsNull = "true")
>
> @MemberOrder(sequence = "2")
>
> @Optional
>
>
>
> But in the user interface it is still mandatory.
>
>
>
> Can somebody help?
>
>
Isis currently requires annotations to be on the getter, not on the field;
see for example [1]. Are those annotations you've listed on the field ?
If so, that'll be the issue.
Also, the (Isis) @Optional annotation is not required if you have the (JDO)
annotation @javax.jdo.annotations.Column(allowsNull = "true").
Let me know if that fixes things or not.
Dan
[1]
https://github.com/apache/isis/blob/master/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItem.java#L392
>
>
> Tnx, johan.
>
>
>
>