Home » Developer & Programmer » Forms » checkbox and record_group & deselect from checkbox (merged)
checkbox and record_group & deselect from checkbox (merged) [message #237257] Sun, 13 May 2007 23:25 Go to next message
u263066
Messages: 47
Registered: March 2007
Member
I have multi record check box

A
B
C
D


and what i am doing is to keeping adding the selection into group, by this piece of code.

if (:INVOICE_HEADER.REPROCESS_CHECKBOX) = 'Y' THEN
ADV_REB_DOC.create_populate_rec_group(:INVOICE_HEADER.TRX_ID);
END IF;
at the item level

and here is the code for adding

  procedure create_populate_rec_group(p_tpp_trans_id in number) is
     rec_grp_id RecordGroup;
     grp_col_id GroupColumn;
  begin
  	 rec_grp_id := FIND_GROUP(group_name);
  	 grp_col_id := FIND_COLUMN(group_name||'.'||coll_name);
  	 if ID_NULL(FIND_GROUP(group_name)) then --C
  	 		rec_grp_id := CREATE_GROUP(group_name,FORM_SCOPE,20);
  	 		grp_col_id := ADD_GROUP_COLUMN(rec_grp_id,coll_name,NUMBER_COLUMN);
 		 end if; --C
  	 	  if :INVOICE_HEADER.REPROCESS_CHECKBOX = 'Y' then --B
  	 	  	ADD_GROUP_ROW(rec_grp_id,END_OF_GROUP);
  	 	  	SET_GROUP_NUMBER_CELL(grp_col_id,GET_GROUP_ROW_COUNT(rec_grp_id),p_tpp_trans_id);
  	 	   elsif :INVOICE_HEADER.REPROCESS_CHECKBOX = 'N' then --B
  	 	  	
  	 	  	for i in 1..GET_GROUP_ROW_COUNT(rec_grp_id) loop --A
  	 	  		 if p_tpp_trans_id = GET_GROUP_NUMBER_CELL(grp_col_id ,i) then --A1
								DELETE_GROUP_ROW(rec_grp_id,i);  	
						--		 	 				ifc_debug_proc('delete row '||i);  	 	
								exit;
  	 	  		 end if;  --A1
  	 	  	end loop; --A
  	 	  end if; --B
  end create_populate_rec_group;


The problem is that when user is doing 2 select and 1 deselect the same , the group will record 3 items.

Is there any way to control or exclude on deselect.
checkbox and record_group [message #237318 is a reply to message #237257] Mon, 14 May 2007 02:53 Go to previous messageGo to next message
u263066
Messages: 47
Registered: March 2007
Member
I have multi record check box

A
B
C
D


and what i am doing is to keep adding the selection into group, by this piece of code.

if (:INVOICE_HEADER.REPROCESS_CHECKBOX) = 'Y' THEN
ADV_REB_DOC.create_populate_rec_group(:INVOICE_HEADER.TRX_ID);
END IF;
at the item level(checkbox item)

and here is the code for adding

 procedure create_populate_rec_group(p_tpp_trans_id in number) is
     rec_grp_id RecordGroup;
     grp_col_id GroupColumn;
  begin
  	 rec_grp_id := FIND_GROUP(group_name);
  	 grp_col_id := FIND_COLUMN(group_name||'.'||coll_name);
  	 if ID_NULL(FIND_GROUP(group_name)) then --C
  	 		rec_grp_id := CREATE_GROUP(group_name,FORM_SCOPE,20);
  	 		grp_col_id := ADD_GROUP_COLUMN(rec_grp_id,coll_name,NUMBER_COLUMN);
 		 end if; 
  	 	  if :INVOICE_HEADER.REPROCESS_CHECKBOX = 'Y' then 
  	 	  	ADD_GROUP_ROW(rec_grp_id,END_OF_GROUP);
  	 	  	SET_GROUP_NUMBER_CELL(grp_col_id,GET_GROUP_ROW_COUNT(rec_grp_id),p_tpp_trans_id);
  	 	   elsif :INVOICE_HEADER.REPROCESS_CHECKBOX = 'N' then 
  	 	  	
  	 	  	for i in 1..GET_GROUP_ROW_COUNT(rec_grp_id) loop 
  	 	  		 if p_tpp_trans_id = GET_GROUP_NUMBER_CELL(grp_col_id ,i) then 
								DELETE_GROUP_ROW(rec_grp_id,i);  	
								exit;
  	 	  		 end if; 
  	 	  	end loop; 
  	 	  end if; 
  end create_populate_rec_group;

The problem is that when user is doing 2 select and 1 deselect the same , the group will record 3 items.

Is there any way to control or exclude the value on deselect.
I tried with DELETE_GROUP_ROW when INVOICE_HEADER.REPROCESS_CHECKBOX) = 'N' i am calling DELETE_GROUP_ROW, but no luck.
can any figure out, where goes wrong.
Re: checkbox and record_group [message #237547 is a reply to message #237318] Mon, 14 May 2007 19:02 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Check that 'REPROCESS_CHECKBOX' has the default value set to 'N' (I think it may currently be set to 'null'). Alternatively, instead of
elsif :INVOICE_HEADER.REPROCESS_CHECKBOX = 'N'
try
elsif nvl(:INVOICE_HEADER.REPROCESS_CHECKBOX,'N') = 'N'

David
Re: checkbox and record_group [message #237883 is a reply to message #237318] Wed, 16 May 2007 01:25 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Please do not post the same question more than once. If you have extra information then 'reply' to your own question.

David
Previous Topic: diplying tooltip programaticaly
Next Topic: Using Outlook Express in Forms 6i
Goto Forum:
  


Current Time: Sat Dec 03 17:48:39 CST 2016

Total time taken to generate the page: 0.07819 seconds