Home » Developer & Programmer » Forms » how to count checked check boxes along with their checked and unchecked conditon (forms 6i)
how to count checked check boxes along with their checked and unchecked conditon [message #569754] Thu, 01 November 2012 02:04 Go to next message
neerumishra
Messages: 6
Registered: November 2012
Location: delhi
Junior Member
hello everyone..
i want to count how many check boxes are chechked and if the check box is unchecked the count will decrease as soon as checkbox is check or uncheck.the number of chech boxes are depentdent on record set that are fetched from database....can any one help.....
Re: how to count checked check boxes along with their checked and unchecked conditon [message #569762 is a reply to message #569754] Thu, 01 November 2012 02:51 Go to previous messageGo to next message
Littlefoot
Messages: 19321
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Create a non-database item (number datatype) which will hold number of checked checkboxes (let's call it CB_CNT (checkbox count)).

What is the initial state? Is the form empty (so you are supposed to enter new records), or do you fetch them (by executing a query) from the database and then do something (insert, update, delete)?

If it is empty, initial CB_CNT value is 0 (zero); in WHEN-CHECKBOX-CHANGED trigger increase (or decrease) CB_CNT item value.

If you fetch values from the database, count checkboxes that are already checked (you can do that by looping through block records, or - using GET_BLOCK_PROPERTY (LAST_QUERY) you can even find the WHERE clause and count that number). Once you have the initial state, you're back on WHEN-CHECKBOX-CHANGED trigger option.
Re: how to count checked check boxes along with their checked and unchecked conditon [message #569765 is a reply to message #569754] Thu, 01 November 2012 03:56 Go to previous message
neerumishra
Messages: 6
Registered: November 2012
Location: delhi
Junior Member
hey littlefoot thanx...
can you provide me some sample code...
i am new to forms and reports..not getting..it properly..Sad
i am fetching some records..that are displaying in the block..

[Updated on: Thu, 01 November 2012 03:58]

Report message to a moderator

Previous Topic: forms cuts off spaces at the end of textfields.
Next Topic: Oracle 10g key combination to call form trigger
Goto Forum:
  


Current Time: Mon Jul 28 20:19:01 CDT 2014

Total time taken to generate the page: 0.13345 seconds