Re: T5: How to set persisted variable to null

2007-10-12 Thread Hugo Palma
I'm having a similar problem and modifying the setter doesn't work for me. In my use case, i have a Double property in a page. This property is bound to the value of a TextField. If i submit with the textfield an empty a "0.0" value shows up, instead of the submitted value that was null. I've

Re: T5: How to set persisted variable to null

2007-10-12 Thread Angelo Chen
Hi Nick, Using a setter does work, right? Nick Westgate wrote: > > Getters/setters are only required for JavaBean conformity, e.g. to use > prop. > > I've just tested this on 5.0.5 (maybe 5.0.6 later if I get time) ... > There is a bug - setting the property to null doesn't work. > > If some

Re: T5: How to set persisted variable to null

2007-10-12 Thread Nick Westgate
Getters/setters are only required for JavaBean conformity, e.g. to use prop. I've just tested this on 5.0.5 (maybe 5.0.6 later if I get time) ... There is a bug - setting the property to null doesn't work. If someone can verify this on 5.0.6 before I do, please log a JIRA. Cheers, Nick. Josh

Re: T5: How to set persisted variable to null

2007-10-11 Thread Josh Canfield
> > if I have an attribute, I should use a setter to assign it? like this: > Hmm... looking at javassist, it looks like there is the ability to modify field level access within a method. Perhaps, if changing to the setter worked then this should be filed as a defect, if it isn't already. Josh On

Re: T5: How to set persisted variable to null

2007-10-11 Thread Angelo Chen
Hi, You are correct. this does bring up a question: if I have an attribute, I should use a setter to assign it? like this: private String id; void onActivate() { id = "myid"; // wrong setId("myid"); // correct ? if (id == "myid"); // wrong if (getId() == "myid"); // correct?

Re: T5: How to set persisted variable to null

2007-10-11 Thread Josh Canfield
> > even i set uid to null, it is still not null next time when the page is > activated, why? what's the correct way of setting a persisted variable > null? > I would guess that the right way to do it would be to use the setter method for the attribute. I haven't looked, but I would guess that Tap