using boolean for properties doesn't make any difference but setting
@Column#allowNulls="false" has the desired effect too remove Null (black
square) as an option in the GUI

using boolean for parameters does limit the GUI to a binary choice.

Will try all the default setting options once I know what to set it too,
but using the last option doesn't do anything, the other two will no doubt
give a result.

Thx

On Sat, May 28, 2016 at 3:27 AM, Dan Haywood <[email protected]>
wrote:

> If you don't want null Booleans, use boolean primitive instead.
>
> With respect to default values, I don't think that the Isis metamodel looks
> at the JDO @Column#defaultValue, no.  But you can specify a default value
> in a couple of ways.
>
> Assuming:
>
> private boolean myFlag;
> public boolean isMyFlag() { return myFlag; }
> public void setMyFlag(boolean myFlag) { this.myFlag = myFlag; }
>
> then you could (a) use a defaultXxx supporting method:
>
>
> public boolean defaultMyFlag() { return true; }
>
>
> or using a created() callback:
>
> public void created() { setMyFlag(true); }
>
> or (simplest) just setting the field to true:
>
> private boolean myFlag= true;
>
>
> Let us know if those work/don't work.
>
> Thx
> Dan
>
>
>
> On 27 May 2016 at 13:52, Stephen Cameron <[email protected]>
> wrote:
>
> > Hi
> >
> > I am wondering if its possible to make Boolean properties non-null and
> have
> > a default value via JDO @Column annotations, e.g.
> >
> > @Column(allowsNull = "false", defaultValue = "true")
> >
> > Thus in the UI I have only true or false as options?
> >
> > At the moment the defaultValue seems to be ignored.
> >
> > Thanks
> >
>

Reply via email to