Home » Developer & Programmer » Forms » Radio button
Radio button [message #193800] Tue, 19 September 2006 08:30 Go to next message
orafan2003
Messages: 122
Registered: February 2006
Senior Member
Hi,
I have text-items like this

Prod1
Prod2
Prod3
Prod4
Prod5

Beside each of them I want to have a radio button. So in the layout I took a radiobutton and put it beside the text item. The number of records displayed for the text_item are 5 ..similarly for the radio button. At runtime I want to select one option and click a button but I observed that for all the five records the radio button is selected.
How can I select only one radio button ?
Re: Radio button [message #193901 is a reply to message #193800] Tue, 19 September 2006 20:03 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

All buttons were selected on form instance?
Are those buttons under one item?

If they are under different name(item), that would be the possible result.
Re: Radio button [message #193951 is a reply to message #193901] Wed, 20 September 2006 02:10 Go to previous messageGo to next message
orafan2003
Messages: 122
Registered: February 2006
Senior Member
Hi,
I created an item and changed its type to radio group. Then mentioned the name of the canvas on which this radio button should be present on. Then in that radio group I created 5 buttons and aligned them.
Now when I run my form, I am getting this error
FRM-30180: No radio buttons in the radio group.
Radio Group ITEM89
Item: ITEM89
Block: TEST_BANK
Form: TASKDETAILS
FRM-30085: Unable to adjust form for output.
How can I fix this error?
Re: Radio button [message #193969 is a reply to message #193800] Wed, 20 September 2006 03:24 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

What do you mean by "aligned"?
You will get "FRM-30180: No radio buttons in the radio group" if you have created a radio group without a single radio button.
Now, I believe you have your buttons on proper place then just check if you forgot to delete previously created group without button in it. I suspect so because you have default group "name" (ITEM89).
Re: Radio button [message #193973 is a reply to message #193969] Wed, 20 September 2006 03:53 Go to previous messageGo to next message
orafan2003
Messages: 122
Registered: February 2006
Senior Member
Hi
I want to associate each radio button with the text item like this.

. prod1
. prod2
. prod3
. prod4

SUBMITBUTTON

I want to select the radio button then click on SUBMITBUTTON. Then it should give me the details of that product. I am not able to do this. I created one radio group and buttons inside that group only. Now I am not getting the error FRM 30180. Any ideas?
Re: Radio button [message #194014 is a reply to message #193951] Wed, 20 September 2006 07:29 Go to previous messageGo to next message
sri_rao85
Messages: 25
Registered: September 2006
Junior Member
hi
first before creating the rediobutton you have to create the radio group thats the prob i hope
Re: Radio button [message #194024 is a reply to message #194014] Wed, 20 September 2006 08:21 Go to previous messageGo to next message
orafan2003
Messages: 122
Registered: February 2006
Senior Member
Hi,
When I change my selection of the radio button, the old selection is also active. When I select a new one, the first two selections are also active. How can I deactivate that selection when new one is checked?
Re: Radio button [message #194123 is a reply to message #193800] Wed, 20 September 2006 19:56 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

If you specified number of records displayed = 5 on block, just specify 1 for the rdio button and database = no, so that you can be sure that the five buttons displayed is unique to it's other. Multi-selection of radio button,as I see it, is a result of similar identity. For example, you have displyed your button1 five times, you can select all of them

Hope this help.

Wency
Re: Radio button [message #194161 is a reply to message #194123] Thu, 21 September 2006 01:29 Go to previous messageGo to next message
orafan2003
Messages: 122
Registered: February 2006
Senior Member
Hi wency,
I am getting these multi-records from a webservice. So I may get 2 values or 10 values.
If there are 2 values and there are 5 radio buttons, the last 3 radio buttons don't look good on the screen when they are active.
Can we not make the radio buttons inactive which have no records? I think this can solve all the problems. Thanks for your guidance.
Re: Radio button [message #194169 is a reply to message #193800] Thu, 21 September 2006 01:46 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

I suggest to hide those buttons using this.
Set_Radio_Button_Property('BLK.RADIO_GROUP','BUTTON_NAME',VISIBLE,PROPERTY_FALSE);

...But if you just want to disable it then do this.
Set_Radio_Button_Property('BLK.RADIO_GROUP','BUTTON_NAME',ENABLED,PROPERTY_FALSE);


Good Luck!

Wency

[Updated on: Thu, 21 September 2006 01:48]

Report message to a moderator

Re: Radio button [message #194171 is a reply to message #194161] Thu, 21 September 2006 01:52 Go to previous messageGo to next message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

You must have one radio group and 5 radio buttons in this radio group.set radio group property according to ur database feild and type. assign value to all 5 radio buttons according to datatype of radio group. what i think in your case as per ur saying.
Quote:

When I change my selection of the radio button, the old selection is also active. When I select a new one, the first two selections are also active. How can I deactivate that selection when new one is checked?


you are using seperate radio groups. that's why you are looking to manage them manually. Make a single radio group, when u will select other value, old one will automatically deselected.

try this, hope its the same you wanted to do Smile

Sandy
Re: Radio button [message #194196 is a reply to message #194171] Thu, 21 September 2006 02:50 Go to previous messageGo to next message
orafan2003
Messages: 122
Registered: February 2006
Senior Member
Hi
I am sending a screenshot of how my form looks like.
I am using one radio group and 5 radio buttons with values of 1,2,3,4 etc depending on the number of multi records.
In the When-Radio-changed trigger:
Go_Block('test_bank');
Go_Record(:item98);

But the problem is that the values that populate the block are not from table ...they come from a webservice. So we cannot say how many values it returns. If it returns only one value, all the 4 or 5 radio buttons that I took are visible in the form. Now I am able to select only one radio button and my form is working fine. The only issue that I have is..
If there are 2 values returning, the 3 radio buttons that dont have values should be disabled.
Wency, I tried out your idea...Set_Radio_Button_Property('control.item98','radio_button103',ENABLED,PROPERTY_FALSE);
But I have to mention which radio button has to be disabled..
Any ideas?
  • Attachment: formdoubt.jpg
    (Size: 93.29KB, Downloaded 278 times)
Re: Radio button [message #194200 is a reply to message #194196] Thu, 21 September 2006 03:00 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Use a checkbox. Add code in When-Checkbox-Changed to make sure that only one box is selected at any one time and maybe use a hidden field to store the record number of the line selected.

David
Re: Radio button [message #194206 is a reply to message #193800] Thu, 21 September 2006 03:25 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

In that case I also use David's idea. You don't have to worry how many records would appear for the number of checkbox is always same as your records.
Re: Radio button [message #194216 is a reply to message #193800] Thu, 21 September 2006 03:58 Go to previous messageGo to next message
orafan2003
Messages: 122
Registered: February 2006
Senior Member
Hi,
Please suggest me whether I should ..for a multi-record block..
1) create one check box and set records displayed to 5

or
2) create 5 check boxes.


Similar is the case for radio buttons. SHould I create one radio group with 5 buttons in it or 1 radio button (from layout editor) and set records displayed to 5?

I don't understand the difference.

How will the check box or the radio button know how to associate with the particular text-item beside which it is placed?
Can you please explain me...so that I can have a clear idea?
Thank you.
Re: Radio button [message #194218 is a reply to message #194216] Thu, 21 September 2006 04:00 Go to previous messageGo to next message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

I think create one check box and set records displayed to 5 will be better.

Sandy
Re: Radio button [message #194223 is a reply to message #193800] Thu, 21 September 2006 04:14 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

Don't create 5 check boxes, it's static and always display 5.
When you create one and display same number as you display your records. It will automatically display 3 when you fetch 3 records and the check box automatically corresponds to the record(checkbox2 = record2 and so on...). In your case it's checbox and the item beside it.
So do Sandy's suggestion.

Regards,

Wency
Re: Radio button [message #194232 is a reply to message #194218] Thu, 21 September 2006 04:33 Go to previous messageGo to next message
orafan2003
Messages: 122
Registered: February 2006
Senior Member
Hi ,
I did exactly as u said.. tried with check box and it works!!
Thank you Wency, Sandy and David!!

[Updated on: Thu, 21 September 2006 04:35]

Report message to a moderator

Re: Radio button [message #194410 is a reply to message #194232] Fri, 22 September 2006 01:06 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
I just want to confirm that you put the checkbox into the block that is holding your data record but you define its 'Base Table Item' property as 'False'. This way you will have the same number of checkboxes as you have populated rows.

David
Re: Radio button [message #194489 is a reply to message #194410] Fri, 22 September 2006 06:47 Go to previous messageGo to next message
orafan2003
Messages: 122
Registered: February 2006
Senior Member
Hi,
Is it possible to create something like the attachment that I sent using forms?? When I click on the radio button it has to correspond to the item that is next to the radio button. We can use a check box but it is difficult to uncheck the check box everytime.
Thank you

  • Attachment: formdoubt.jpg
    (Size: 49.93KB, Downloaded 318 times)

[Updated on: Fri, 22 September 2006 06:49]

Report message to a moderator

Re: Radio button [message #194753 is a reply to message #194489] Mon, 25 September 2006 02:21 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
I strongly suggest pursuing the check-box solution. Just keep track of the record number that you checked previously and do a go_record and uncheck it.

David
Previous Topic: How to use ocx in form (ex. msflex.grid like in vb)
Next Topic: Help NEEDED
Goto Forum:
  


Current Time: Fri Dec 09 09:40:11 CST 2016

Total time taken to generate the page: 0.09562 seconds