[FREE] 3-State CheckBox Bean for Servoy

Questions and answers on developing, deploying and using plugins and JavaBeans

Moderators: Jan Blok, edward

[FREE] 3-State CheckBox Bean for Servoy

Postby ars on Mon Oct 06, 2008 12:55 pm

Here is a 3-State Check Box bean for Servoy.

The 3-State Check Box Bean has the three states called, "NOT_SELECTED", "CHECKED", "CROSSED". Put the Jar file in the beans directory of Servoy root folder and Try with sample solution. You can get/set the state by using the state property of the bean.

To Get the State :
Code: Select all
var state = elements.bn_triState.state


To Set the State :
Code: Select all
//Set to Checked
elements.bn_triState.state = "CHECKED";

//Set to Not Selected
elements.bn_triState.state = "NOT_SELECTED";

//Set to Crossed
elements.bn_triState.state = "CROSSED";
Attachments
TriStateCheckBox.jar
TriStateCheckBox Bean
(8.24 KiB) Downloaded 63 times
TriStateDemo.servoy
Sample servoy solution
(28.57 KiB) Downloaded 68 times
Arup Ranjan Sahoo
http://www.mindfiresolutions.com
SAN Developer
User avatar
ars
 
Posts: 204
Joined: Thu Jun 28, 2007 1:04 pm
Location: India

Re: [FREE] 3-State CheckBox Bean for Servoy

Postby Kahuna on Mon Oct 06, 2008 1:23 pm

WOW Arup - looks like you've been thinking about this for a while!

For clarity:

NOT_SELECTED = when a form first opens and the checkbox has not been touched ( = NULL)?

CHECKED = When the 'tick' appears in the box and its set to True (1)?

CROSSED = When the box is set to false (0)(no checkmark)?

Thanks for the effort in making this available.
(Servoy 51b - XP SP3 - MySQL / Servoy 51b - MacOSX SN 64b - MySQL)
Ian Cordingley (Kahuna)
Kahuna
 
Posts: 710
Joined: Thu Oct 26, 2006 12:39 am
Location: 1/2 NE UK 1/2 Olvera Spain

Re: [FREE] 3-State CheckBox Bean for Servoy

Postby ROCLASI on Mon Oct 06, 2008 1:35 pm

Hi Kahuna,

Kahuna wrote:NOT_SELECTED = when a form first opens and the checkbox has not been touched ( = NULL)?

In a search scenario this would mean don't search on it. In a data entry scenario this could be 0 for an integer or 'false' for a varchar. Or pretty much any value you can think of since you need to script the actual data entry into the dataprovider.

Kahuna wrote:CHECKED = When the 'tick' appears in the box and its set to True (1)?

In both scenarios this would be true/1

Kahuna wrote:CROSSED = When the box is set to false (0)(no checkmark)?

Now this one is a tricky one. When you do data-entry with a 2-state checkbox then this third-state would be used only in a search scenario and would mean 'not checked, i.e. 0/null/false.
But if you use tri-state values in data-entry then you need a four-state checkbox for searching the 'not-selected' values. Which of course what triggered this whole thread to begin with.
Last edited by ROCLASI on Mon Oct 06, 2008 1:37 pm, edited 1 time in total.
Robert Ivens
ROCLASI Software Solutions
SAN Developer
--
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 2912
Joined: Thu Oct 02, 2003 8:49 am
Location: Netherlands/Belgium

Re: [FREE] 3-State CheckBox Bean for Servoy

Postby ars on Mon Oct 06, 2008 1:36 pm

Kahuna wrote:WOW Arup - looks like you've been thinking about this for a while!

For clarity:

NOT_SELECTED = when a form first opens and the checkbox has not been touched ( = NULL)?

CHECKED = When the 'tick' appears in the box and its set to True (1)?

CROSSED = When the box is set to false (0)(no checkmark)?

Thanks for the effort in making this available.


Thanks Kahuna :)
Arup Ranjan Sahoo
http://www.mindfiresolutions.com
SAN Developer
User avatar
ars
 
Posts: 204
Joined: Thu Jun 28, 2007 1:04 pm
Location: India


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 1 guest