Check box doesn't respond

Hi,
I have a check box in a form. This form will be called by other forms. The first time when the form shows up I can check this check box without any problem. When I re-open this form all fields will be initiated so that check box will be unchecked by default. But now if I click the check box the action on it does not work. It looks like the first time I click it, the data provider’s value turned to 1; when I initiated it by changing the data provider value to 0, the check box doesn’t know about the change. So when I click it the second time it still thinks the value is ‘1’ not ‘0’, even on the interface this check box is shown as “unchecked”. I have to check it , then uncheck it, then check it again, now the action can be activated.
How to solve this problem?

Thanks,

when I initiated it by changing the data provider value to 0, the check box doesn’t know about the change.

Is your data (auto)saved?

IT2Be:
Is your data (auto)saved?

My data doesn’t talk to database. This form passes fields’ values to java bean. The data provider of the check box is a variable whose initial value is “0”.

So, you don’t use the Servoy element/checkbox but a JCheckBox?

In that case you are on your own, a bean needs to be configured in ALL aspects. Listeners etc. and, although beans are supported the rest is up to you.

Why don’t you make use of what Servoy has to offer and attach a global (when you don’t use a database) to the checkbox.

When you don’t want to do that it might be best that you try to explain why not so that we can give you a better advise.

IT2Be:
So, you don’t use the Servoy element/checkbox but a JCheckBox?

I don’t use JCheckBox. I use element/checkbox and a form variable not global one as its data provider.
The form gathers all inputs and passes to a java bean to do the further process.
I think every time when this form is called all elements would be initiated but looks not like this because the elements still keep the old value.

I think every time when this form is called all elements would be initiated but looks not like this because the elements still keep the old value.

Data is updated but…

When you really use a Java Bean. You don’t use the variable (Object) to the bean but the value.
For that reason you need to pass the updated value back to the form/solution.