# check box refresh problem

**URL:** <https://forum.servoy.com/t/check-box-refresh-problem/7689>\
**Category:** Classic Servoy\
**Created:** [June 20, 2007, 5:50am UTC](https://forum.servoy.com/t/check-box-refresh-problem/7689 "2007-06-20T05:50:53Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![subhranild](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@subhranild](https://forum.servoy.com/u/subhranild)\
**Post date:** [June 20, 2007, 5:50am UTC](https://forum.servoy.com/t/check-box-refresh-problem/7689/1 "2007-06-20T05:50:53Z")

</div>

Hi ,  
I have a list of check boxes. and every check box related to some data.  
If i checked then related data will be store in the table, if unchecked then data will be deleted. Now this is working well.  
Problem is , if data is in the table then the check box comes with checked otherwise uncheked. But some times some of chekboxes are come with unchecked when the related data is in the table . So , how to solve this problem?

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [June 20, 2007, 7:25am UTC](https://forum.servoy.com/t/check-box-refresh-problem/7689/2 "2007-06-20T07:25:56Z")

</div>

Code you use (quite essential)?  
Servoy version?  
Java version?  
Platform?

---

<div class="post-metadata">

**Author:** ![subhranild](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@subhranild](https://forum.servoy.com/u/subhranild)\
**Post date:** [June 20, 2007, 7:51am UTC](https://forum.servoy.com/t/check-box-refresh-problem/7689/3 "2007-06-20T07:51:40Z")

</div>

suppose I have a table tbl\_a and through which I represent check box list.  
And I have another table tbl\_b in which data will be store by operation on checkbox. And the relation tbl\_a\_to\_tbl\_b.  
My code

> if (tbl\_a\_to\_tbl\_b.getSize() \> 0 )  
> {
> 
> forms.frm\_b.controller.find();  
> forms.frm\_b.fld\_1= globals.fld\_1;  
> forms.frm\_b.fld\_2= globals.fld\_2;  
> forms.frm\_b.controller.search();  
> forms.frm\_b.controller.deleteRecord();
> 
> forms.frm\_b.controller.loadAllRecords()  
> }  
> else {
> 
> forms.frm\_b.controller.newRecord();  
> forms.frm\_b.role\_id = globals.fld\_1;  
> forms.frm\_b.menu\_id = globals.fld\_2;  
> forms.frm\_b.controller.loadAllRecords()
> 
> }
> 
> forms.frm\_b.controller.loadAllRecords()

My version

> Servoy Developer  
> Version 3.1-build 404  
> Java version 1.6.0-b105 (Windows XP)

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [June 20, 2007, 7:57am UTC](https://forum.servoy.com/t/check-box-refresh-problem/7689/4 "2007-06-20T07:57:39Z")

</div>

I am sorry, I would like to help you but reading your questions over and over again I really don’t understand your issue or question.  
I hope for you somebody else understands it.

---

<div class="post-metadata">

**Author:** ![Joas](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/joas/32/5095_2.png) [@Joas](https://forum.servoy.com/u/Joas)\
**Post date:** [June 20, 2007, 8:42am UTC](https://forum.servoy.com/t/check-box-refresh-problem/7689/5 "2007-06-20T08:42:13Z")

</div>

I agree with Marcel that it is very hard to understand your problem. If you put a little more effort in explaining what goes wrong and what you have tried so far, the chances of someone on the forum helping you out will be much much bigger.

If I understand correctly the code you posted gets triggered onDataChange of globals.fld\_1 and globals.fld\_2 and the problem is that those globals won’t be filled according to the selected record.

In that case you should create a method that fills the globals with the right values and is triggered by the onRecordSelection event.

---

<div class="post-metadata">

**Author:** ![subhranild](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@subhranild](https://forum.servoy.com/u/subhranild)\
**Post date:** [June 20, 2007, 8:52am UTC](https://forum.servoy.com/t/check-box-refresh-problem/7689/6 "2007-06-20T08:52:42Z")

</div>

Now I giving some description.  
suppose i have some options like print, preview,mail,reort genaration, create new user etc. Now all these options are not accessable by every user. These options contain a check box. If administrator check some of these against a particular user then that user can access those option which are checked by administrator. Now upto this have no problem.  
when administrator check , which options are given to particular user then it will show the checked options which are given and unchecked which are not given to that user .  
Now take an example, supose administrator given access wright of mail and print to user 1.  
When admin show this form against user 1, he saw mail and print will be checked and other will be unchecked.  
Now my problem is, some time it show mail and print is checked and some time both not checked or one of them. But data is in the table.  
suppose it show mail is uncheked but mail option access by user 1 because it checked previously by administrator.  
So, problem is to refresh check box.

---

<div class="post-metadata">

**Author:** ![subhranild](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@subhranild](https://forum.servoy.com/u/subhranild)\
**Post date:** [June 21, 2007, 11:28am UTC](https://forum.servoy.com/t/check-box-refresh-problem/7689/7 "2007-06-21T11:28:49Z")

</div>

please , any one from the forum help me,  
my problem is not solvede

---

<div class="post-metadata">

**Author:** ![sanneke](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@sanneke](https://forum.servoy.com/u/sanneke)\
**Post date:** [June 21, 2007, 11:36am UTC](https://forum.servoy.com/t/check-box-refresh-problem/7689/8 "2007-06-21T11:36:13Z")

</div>

What is the calculation for showing the checkbox?

---

<div class="post-metadata">

**Author:** ![subhranild](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@subhranild](https://forum.servoy.com/u/subhranild)\
**Post date:** [June 21, 2007, 12:01pm UTC](https://forum.servoy.com/t/check-box-refresh-problem/7689/9 "2007-06-21T12:01:12Z")

</div>

I previouly describe that if i have some menu like

> print, preview,mail,reort genaration, create new user

and i store all these menu in a table,  
now i create a calculation which return the menu name and take checkbox field which data provider is the calculation.  
now if check box of some menu are clicked against a user then another table store all checked menu against that user.  
So, when we saw all menu list against that user , the alloted menu checkbox will be checked and oter will be unchecked.  
I done this , but problem is when showing fore against that user then some time it show all alloted menu checked, some time some of alloted menu checked.  
But one good thing is that it not show any not alloted menu checked.

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [June 21, 2007, 12:05pm UTC](https://forum.servoy.com/t/check-box-refresh-problem/7689/10 "2007-06-21T12:05:59Z")

</div>

Sanneke was asking for the code you are using to show the checks…

---

<div class="post-metadata">

**Author:** ![subhranild](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@subhranild](https://forum.servoy.com/u/subhranild)\
**Post date:** [June 21, 2007, 12:17pm UTC](https://forum.servoy.com/t/check-box-refresh-problem/7689/11 "2007-06-21T12:17:48Z")

</div>

> suppose I have a table tbl\_a and through which I represent check box list.  
> And I have another table tbl\_b in which data will be store by operation on checkbox. And the relation tbl\_a\_to\_tbl\_b.  
> Here tbl\_a store all menu list  
> tbl\_b store all accassable menu against a particular user  
> My code  
> Quote:
> 
> if (tbl\_a\_to\_tbl\_b.getSize() \> 0 )  
> {
> 
> forms.frm\_b.controller.find();  
> forms.frm\_b.fld\_1= globals.fld\_1;  
> forms.frm\_b.fld\_2= globals.fld\_2;  
> forms.frm\_b.controller.search();  
> forms.frm\_b.controller.deleteRecord();
> 
> forms.frm\_b.controller.loadAllRecords()  
> }  
> else {
> 
> forms.frm\_b.controller.newRecord();  
> forms.frm\_b.role\_id = globals.fld\_1;  
> forms.frm\_b.menu\_id = globals.fld\_2;  
> forms.frm\_b.controller.loadAllRecords()
> 
> }
> 
> forms.frm\_b.controller.loadAllRecords()

[/quote]

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [June 21, 2007, 12:25pm UTC](https://forum.servoy.com/t/check-box-refresh-problem/7689/12 "2007-06-21T12:25:00Z")

</div>

This is going in the wrong direction I am afraid.

Language barrier is the key word here…

subhranild: It will help you (with your issue) and us (to help you out here) when you can create a simple sample solution…
