# Checkbox Without a Data Provider - Possible?

**URL:** <https://forum.servoy.com/t/checkbox-without-a-data-provider-possible/9844>\
**Category:** Classic Servoy\
**Created:** [November 6, 2008, 2:51pm UTC](https://forum.servoy.com/t/checkbox-without-a-data-provider-possible/9844 "2008-11-06T14:51:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kahuna](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@Kahuna](https://forum.servoy.com/u/Kahuna)\
**Post date:** [November 6, 2008, 2:51pm UTC](https://forum.servoy.com/t/checkbox-without-a-data-provider-possible/9844/1 "2008-11-06T14:51:32Z")

</div>

Hi Folks - more dumb questions!

I need a series of checkbox’s as a menu selection tool in a form. The user simply checks the box against the report he’d like to preview.

I need to be able to influence the box’s (ensure only one checked at run time) but I don’t see any properties to change a checkbox outside of a data provider?

Is this possible?

---

<div class="post-metadata">

**Author:** ![ngervasi](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@ngervasi](https://forum.servoy.com/u/ngervasi)\
**Post date:** [November 6, 2008, 2:54pm UTC](https://forum.servoy.com/t/checkbox-without-a-data-provider-possible/9844/2 "2008-11-06T14:54:49Z")

</div>

Why don’t you use radios? Radio buttons looks like checkbox but don’t allow multiple selection.

---

<div class="post-metadata">

**Author:** ![Kahuna](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@Kahuna](https://forum.servoy.com/u/Kahuna)\
**Post date:** [November 6, 2008, 3:11pm UTC](https://forum.servoy.com/t/checkbox-without-a-data-provider-possible/9844/3 "2008-11-06T15:11:29Z")

</div>

> ngervasi:  
> Why don’t you use radios? Radio buttons looks like checkbox but don’t allow multiple selection.

That was my initial thought but again, I cant see a way to provide them without a data provider?

In fact I cant see how to place them on a form!!! I assume its a field with the type set to RADIOS - but this just results in a field element - not the RADIOS I expected.

What am I missing Nicola?

---

<div class="post-metadata">

**Author:** ![ngervasi](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@ngervasi](https://forum.servoy.com/u/ngervasi)\
**Post date:** [November 6, 2008, 3:14pm UTC](https://forum.servoy.com/t/checkbox-without-a-data-provider-possible/9844/4 "2008-11-06T15:14:39Z")

</div>

Create a form variable (or a global variable if you are not using Servoy 4.x), place it on the form, select to display as Radios and attach a valuelist to the field and you’re done, no need to bind it to a specific table column.

---

<div class="post-metadata">

**Author:** ![Kahuna](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@Kahuna](https://forum.servoy.com/u/Kahuna)\
**Post date:** [November 6, 2008, 3:19pm UTC](https://forum.servoy.com/t/checkbox-without-a-data-provider-possible/9844/5 "2008-11-06T15:19:12Z")

</div>

> ngervasi:  
> Create a form variable (or a global variable if you are not using Servoy 4.x), place it on the form, select to display as Radios…

That makes sense… so far

> ngervasi:  
> …and attach a valuelist to the field and you’re done, no need to bind it to a specific table column.

Why is there a valuelist necessary and what should be in the valuelist?

---

<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:** [November 6, 2008, 3:28pm UTC](https://forum.servoy.com/t/checkbox-without-a-data-provider-possible/9844/6 "2008-11-06T15:28:56Z")

</div>

The valuelist should contain the options that the user can choose, reports in your case.  
Radio buttons work the same as a combobox, only the UI is different.

---

<div class="post-metadata">

**Author:** ![ngervasi](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@ngervasi](https://forum.servoy.com/u/ngervasi)\
**Post date:** [November 6, 2008, 3:31pm UTC](https://forum.servoy.com/t/checkbox-without-a-data-provider-possible/9844/7 "2008-11-06T15:31:38Z")

</div>

The valueList should look like this:

Nice Report|1  
Better Report|2  
Gorgeous Report|3

And then when the user press the “Go” button (or whatever you are using) in a method you evaluate the form var content like this:

```auto
switch(FormVariableToSelectTheReportType) 
{
    case 1: forms.niceReport.controller.show()
    break;
    case 2: forms.betterReport.controller.show()
    break;
    case 3: forms.gorgeousReport.controller.show()
    break;
}

```

---

<div class="post-metadata">

**Author:** ![Kahuna](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@Kahuna](https://forum.servoy.com/u/Kahuna)\
**Post date:** [November 6, 2008, 3:33pm UTC](https://forum.servoy.com/t/checkbox-without-a-data-provider-possible/9844/8 "2008-11-06T15:33:38Z")

</div>

> ngervasi:  
> The valueList should look like this:
> 
> Nice Report|1  
> Better Report|2  
> Gorgeous Report|3
> 
> And then when the user press the “Go” button (or whatever you are using) in a method you evaluate the form var content like this:
> 
> ```auto
> switch(FormVariableToSelectTheReportType) 
> 
> ```

{  
case 1: forms.niceReport.controller.show()  
break;  
case 2: forms.betterReport.controller.show()  
break;  
case 3: forms.gorgeousReport.controller.show()  
break;  
}

> ```auto
> 
> ```

Perfect Nicola - thanks for that!
