Home » Developer & Programmer » Forms » Mark selected/current record in a datablock
Mark selected/current record in a datablock [message #244326] Tue, 12 June 2007 06:11 Go to next message
bbaz
Messages: 138
Registered: April 2007
Senior Member
Hi guys,

I have a Database Block that retrieves a set of records from my DB table.

I want to have the Block to behave somehow like an LOV in a way that when I select a record and press a button, I can pass the record to another form.

I have created a NON database item Radio button for each record but I am missing the functionality, when I click on the radio button corresponding to the record I am not being able to activate/set the current record and besides ONLY ONE Radio Button must be selected at on time (this is not working either...!!)

Attached is a Screen shot of the Form.

Can someone please help me on getting this functionality, or if there is better alternative to do the work.

Many thanks in advance.
Baz


Re: Mark selected/current record in a datablock [message #245021 is a reply to message #244326] Fri, 15 June 2007 00:32 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I would suggest using a checkbox instead of the radio button.

When you press the 'Movement Detail' button you would build a string containing the key field data, probably separated by commas, and pass that to your next form.

Do you need to do the work in another form or can you do it on a second canvas in this form, and activate it by setting the checkbox?

David
Re: Mark selected/current record in a datablock [message #245337 is a reply to message #245021] Sat, 16 June 2007 01:39 Go to previous messageGo to next message
bbaz
Messages: 138
Registered: April 2007
Senior Member

Thanks David,

I always found your posts beneficial. Can you please elaborate more on your approach. My concerns are the following:

1) When I click on one of the Checkboxes, how do I restrict ONLY one checkbox to be active? Only one records to be selected, i.e. deactivate all others? Is it a Checkbox Property Item or programatically?

2) How do I associate the Check box with the corresponding Record since it is NOT a DB item?

3) When I press the "Movement Details" button, basically I need to pass the MVT_ID from which I can retrieve all the related data from the DB. Do I still need to build a String for that? I am planning to use a ParamList.

How can my checkboxes handle 1 + 2? Please can you provide more details?

Many thanks again,
Baz

Re: Mark selected/current record in a datablock [message #245503 is a reply to message #245337] Sun, 17 June 2007 23:30 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Add the checkbox as a non-database item to your main block. In the 'When-Checkbox-Changed' trigger, make a note of the record on which you are currently resting (have a non-database entry in a 'control' block to store the row number), either loop through all the other rows and turn them off, then come back to this row and turn it on, or use a second 'control' block item into which you recorded the number of the previous 'checked' row, go to it, turn the checkbox 'off', then come back.

If you are only passing one value you don't need to build a list. Just populate the parameter and pass it.

David
icon14.gif  Re: Mark selected/current record in a datablock [message #248737 is a reply to message #245503] Sun, 01 July 2007 02:27 Go to previous message
bbaz
Messages: 138
Registered: April 2007
Senior Member
Thanks David, you're the man (Y)

WORKS Perfectly fine. Laughing Laughing

IF (:CONTROLITEMS.STORED_RECNUM IS NULL) THEN
:CONTROLITEMS.STORED_RECNUM := :System.Cursor_Record;

Message('The FIRST Record Number is: '||:CONTROLITEMS.STORED_RECNUM);

ELSE
	TEMPREC := :System.Cursor_Record;
	Message('RECORD# 2 is: '||TEMPREC);
	Go_RECORD(:CONTROLITEMS.STORED_RECNUM);
	:AREA3_MVTS.SELECTED_RECORD :='N';
	
	
	Go_RECORD(TEMPREC);
	:CONTROLITEMS.STORED_RECNUM := TEMPREC;
	
END IF;



I appreciate your support.
Baz
Previous Topic: Tree Problem
Next Topic: Olextra
Goto Forum:
  


Current Time: Fri Sep 27 00:13:17 CDT 2024