Home » Developer & Programmer » Forms » Radio button
Radio button [message #126490] Tue, 05 July 2005 04:21 Go to next message
priyravi
Messages: 41
Registered: July 2005
Member
hi,

Wish to know whether following thing is possible in forms 9i.

need to display records from database and option button with each row. My pbm is at a single point of time, all options are selected. I am unable to deselect that...Need to write some code for this or is there any automatic way for doing this?

I worked with check box. working fine. Since, user has to be restricted with one selection, I need to work with option button.

Pl help.

Regards,
Priya

[Updated on: Tue, 05 July 2005 06:12]

Report message to a moderator

Re: Radio button [message #126633 is a reply to message #126490] Wed, 06 July 2005 01:11 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I think you are saying that the radio group always has a non-null value and you want one of the alternatives to be 'null'. How able defining another member of the radio group that has the value 'Z' and you label it as 'no option'. Then write your around the value 'Z' instead of around 'null'.

David
Re: Radio button [message #126697 is a reply to message #126633] Wed, 06 July 2005 04:18 Go to previous messageGo to next message
priyravi
Messages: 41
Registered: July 2005
Member
Thanks David for ur reply..i am explaining my pbm in detail below

At a single point of time, only one rec shd be selected. Based on selection, I will perform an action. But using radio group, I am unable to do this...
For eg, there are 5 records

<radio1> <rec1>
<radio2> <rec2>
<radio3> <rec3>
<radio4> <rec4>
<radio5> <rec5>
at a point of time, i am selecting 3rd option...[only one option is allowed..that z y i am going for radio button] after selection, i will press push button...is it possible...and i need to map the record according to selection .

priya

Re: Radio button [message #126834 is a reply to message #126697] Wed, 06 July 2005 21:27 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Okay ... I think what you are saying is you want to display 5 rows from a table of many rows and then select one and only one of these entries. Then press a button to use the data in this row to do something.

Assuming I am right. Place a check-box (non-database) in your multi-row block and display it to the left of your fields. In the When-Checkbox-Changed either turn off the capability of changing the other check-boxes [Set-Item-Property disable, Set-Item-Instance-Property enable] or loop through all the records and turn off any check-box that has been turned on [store :system.trigger_record or get_block_property(current_record), first_record, loop until :system.last_record, if checkbox 'set' then 'unset'; exit loop if you wish otherwise run to end of loop; finally go_record(stored_row_num).

To get the screen to match exactly the first screen row placement you will need to know the row number of the top line, then go to top_line, then go to current_line. Try for yourself, it isn't too difficult.

David

Upd: You can't disable an item and then enable an item-instance. You could just set a :global that 'checkbox has been set' and test for it in a when-new-record-instance and turn the field off for that line and move to the next field.

[Updated on: Sun, 18 September 2005 22:03]

Report message to a moderator

Re: Radio button [message #126852 is a reply to message #126834] Wed, 06 July 2005 23:36 Go to previous messageGo to next message
priyravi
Messages: 41
Registered: July 2005
Member
David,

It z working fine with checkbox...I want to use only radio button.
Re: Radio button [message #126857 is a reply to message #126852] Wed, 06 July 2005 23:52 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Okay ... one radio group on another single row block ... arrange it vertically, return the number '1' through '5' from the radio group when the 'GO' button is pressed. If radio-group = '1' then (internally) go to the other block, work out the "top row's" number, and then go to that record, and use then use its information. If radio-group = '2' then do the mathematics and go to the second row.

[You could use offset counting (0-4) (I can't remember whether that is ordinal or cardinal).]

Feedback please.

David
Re: Radio button [message #126923 is a reply to message #126857] Thu, 07 July 2005 07:11 Go to previous messageGo to next message
priyravi
Messages: 41
Registered: July 2005
Member
David,

C...i think i did not exp my pbm clearly.
For each rec, there will be one radio group right?
if i select particular rec, other options in other records should not be selected. it is getting selected because i placed radio group once while creating data block..it is a non-db item.
i planned to capture the property of radio button selected at runtime...no clues for me
Re: Radio button [message #127019 is a reply to message #126923] Thu, 07 July 2005 20:12 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
That's one of the problems of a radio group, how to turn it 'off'. Either add another element to the radio group called 'off' which sets the value back to the default, or you could have both a check-box and the radio group on each record. When the radio group has an element selected you can turn the check-box 'on', then if they want to turn the radio group 'off' they unselect the check-box.

David
Previous Topic: Forms 6i with OLE2 package
Next Topic: Permissions
Goto Forum:
  


Current Time: Thu Sep 19 20:23:41 CDT 2024