Home » Developer & Programmer » Forms » HOW TO SELECT READIO BUTTON DYNAMICALLY.....
icon6.gif  HOW TO SELECT READIO BUTTON DYNAMICALLY..... [message #185624] Wed, 02 August 2006 14:19 Go to next message
imtiazmasud
Messages: 49
Registered: May 2005
Location: Bangladesh
Member

HI ALL,
I AM FACING A PROBLEM WITH MY RADIO BUTTON. THE RADIO BUTTON WILL BE SELECTED DYNAMICALLY AS DATA IN THE DATABASE.

I have a table like this
user_name Status
--------- -------
abc--------------1
tarek------------0
imtiaz-----------1
joe--------------0

status " 0 " represents INACTIVE
status " 1 " represents ACTIVE

I have two radio button
one for "ACTIVE" and another for "INACTIVE"

If I query any user from the database to see and edit its status.

IF I SELECT USER_NAME "ABC" THEN DYNAMICALLY RADIO BUTTON ACTIVE
WILL BE SELECTED BECAUSE ITS STATUS IS 1

IF I SELECT USER_NAME "TAREK" THEN DYNAMICALLY RADIO BUTTON INACTIVE WILL BE SELECTED BECAUSE ITS STATUS IS 0

PLEASE IF ANYONE HAVE THIS SOLUTION THEN INFORM ME .................BETTER WITH EXAMPLE OR CODE.....IMTIAZMASUD

  • Attachment: TEST.doc
    (Size: 46.50KB, Downloaded 629 times)

[Updated on: Wed, 02 August 2006 14:21]

Report message to a moderator

Re: HOW TO SELECT READIO BUTTON DYNAMICALLY..... [message #185693 is a reply to message #185624] Thu, 03 August 2006 02:35 Go to previous messageGo to next message
jowahl
Messages: 82
Registered: May 2006
Member
in the POST-QUERY trigger of the block set the radio buttons dynamically:

BEGIN
:BLOCK.<name_of_radio_button_item> := :BLOCK.<item_with_database_value>;
END;

is this what you're looking for?
Re: HOW TO SELECT READIO BUTTON DYNAMICALLY..... [message #185805 is a reply to message #185693] Thu, 03 August 2006 12:49 Go to previous messageGo to next message
imtiazmasud
Messages: 49
Registered: May 2005
Location: Bangladesh
Member

Hi man,
Thx for ur suggestion..but not working ..I think that I am not supposed to said in the way u said..Please I need its solution..I am trying...but not working any more..

if any one know its solution then please inform me.....imtiazmasud
Re: HOW TO SELECT READIO BUTTON DYNAMICALLY..... [message #185808 is a reply to message #185805] Thu, 03 August 2006 13:07 Go to previous messageGo to next message
jowahl
Messages: 82
Registered: May 2006
Member
could you post a sample fmb?
icon14.gif  Re: HOW TO SELECT READIO BUTTON DYNAMICALLY..... [message #185873 is a reply to message #185808] Thu, 03 August 2006 23:49 Go to previous messageGo to next message
imtiazmasud
Messages: 49
Registered: May 2005
Location: Bangladesh
Member

hi man,
I have a sample form..I am posting it for you ..
Here I have two options(Active,Inactive) and many users in the database.In database some users are active(means status is "1") and some users are inactive (means status is "0").

I have a table like this
user_name Status
--------- -------
abc------ -------1
tarek---- -------0
imtiaz--- -------1
joe------ -------0

IF SELECT USER_NAME "TAREK" THEN DYNAMICALLY RADIO BUTTON "INACTIVE" WILL BE SELECTED BECAUSE ITS STATUS IS 0

good luck.....imtiazmasud

Re: HOW TO SELECT READIO BUTTON DYNAMICALLY..... [message #185879 is a reply to message #185624] Fri, 04 August 2006 00:40 Go to previous messageGo to next message
jowahl
Messages: 82
Registered: May 2006
Member
i think there are raising problems with this code in the WHEN-NEW-ITEM-INSTANCE trigger of USER_AUTH.USER_NAME:

    IF V_STATUS = 1 THEN   
       /*Radio Button Value Property */
       Set_Item_Property('RADIO_BUTTON29',initial_value,'1'); 
    ELSIF V_STATUS = 0 THEN
      /*** Change the icon to the execute query icon and get 
      ** into enter query mode. */
      Set_Item_Property('RADIO_BUTTON30',initial_value,'0'); 
    END IF;


has to be simply:

    :USER_AUTH.RADIO_GROUP28 := v_status;


the INITIAL_VALUE is the default value if you're creating NEW values! in your case you want to set the status depending on database values, so you have to assign the value to the item.

[Updated on: Fri, 04 August 2006 00:41]

Report message to a moderator

Re: HOW TO SELECT READIO BUTTON DYNAMICALLY..... [message #185934 is a reply to message #185879] Fri, 04 August 2006 06:22 Go to previous messageGo to next message
imtiazmasud
Messages: 49
Registered: May 2005
Location: Bangladesh
Member

Hi man,
Thx once again but its not working...
Here I think that I will have to set the specifiq radio button value not the total group..

In property palette we have one property "RADIO BUTTON VALUE"
manually we set the value ....but I think we will have to set it dynamically by programming...

I also tried like this

IF V_STATUS = 1 THEN
/*Radio Button Value Property */
Set_Item_Property('RADIO_BUTTON29',Radio Button Value,'1');

ELSIF V_STATUS = 0 THEN
/*Radio Button Value Property */Set_Item_Property('RADIO_BUTTON30',Radio Button Value,'0');
END IF;

But it is giving error.........

I do not know how I will get rid of this problem...................please help me...imtiazmasud
Re: HOW TO SELECT READIO BUTTON DYNAMICALLY..... [message #185939 is a reply to message #185934] Fri, 04 August 2006 06:49 Go to previous messageGo to next message
jowahl
Messages: 82
Registered: May 2006
Member
just for my understanding, what do you like to do:

you don't set up a query, do you?
the user always starts typing username/password. then you're verifying if this user exists and set the radio buttons?

please desrcribe step by step, it's too confusing for me ...

e.g
1) form starts with empty block
2) user types in username
3) after leaving field this operation check in database if user exists
4) if exists do something .... if not do .....
5) ...
6) ...

thanks!
Re: HOW TO SELECT READIO BUTTON DYNAMICALLY..... [message #185978 is a reply to message #185939] Fri, 04 August 2006 10:40 Go to previous messageGo to next message
imtiazmasud
Messages: 49
Registered: May 2005
Location: Bangladesh
Member

I have a sells system...
here the sells man just log in to the system in order to sell goods..

*)I have another interface where the admin just create users as per system requirements..
*)I have also another interface to log in its users to just log in

**)THE INTERFACE WE ARE DISCUSSING ABOUT THE ADMIN MAY CHANGE THE USER STATUS TO PROTECT ENTER OR RESTRICT USER TO LOG IN

let make a bit clear that, the functionality of this form is admin may want that i will not permit this user to enter in this system for a certain time....then admin will disable or inactivate the user for protecting him to enter into the system......
if still not clear then inform me.......imtiazmasud
Re: HOW TO SELECT READIO BUTTON DYNAMICALLY..... [message #185983 is a reply to message #185624] Fri, 04 August 2006 11:33 Go to previous messageGo to next message
jowahl
Messages: 82
Registered: May 2006
Member
o.k. let me see if i got you:

1)
this form is for activating/deactivating users that exist in the database (table USER_AUTH).

2)
if the admin enters a username, you have to check if this user exists in the table USER_AUTH. i can't find this check in your form.

you only have a WHEN-NEW-ITEM-INSTANCE trigger. but it fires also when the admin navigates to the field to enter the username (and fires also when the field is blank) ...??

the code in the WHEN-NEW-ITEM-INSTANCE trigger selects the status from the table USER_AUTH without WHERE (restriction). is there only one row in the table? i think not ...

3)
if my assumptions are right, i'd recommend some changes:

a)
the block (and all items) shouldn't be database based (set block property "Database Data Block"=No

b)
set items properties "Database Item"=No.

c)
i've created a WHEN-VALIDATE-ITEM trigger for you. please check it and make your changes (alerts, ...)

hope this works ...!?

icon4.gif  Re: HOW TO SELECT READIO BUTTON DYNAMICALLY..... [message #186004 is a reply to message #185983] Fri, 04 August 2006 13:25 Go to previous messageGo to next message
imtiazmasud
Messages: 49
Registered: May 2005
Location: Bangladesh
Member

hi man,
This form is not my log in form....this form only update form to update the user status just active / deactive............

only to update user status.....thx for trying....imtiazmasud
Re: HOW TO SELECT READIO BUTTON DYNAMICALLY..... [message #186092 is a reply to message #186004] Sat, 05 August 2006 13:07 Go to previous messageGo to next message
imtiazmasud
Messages: 49
Registered: May 2005
Location: Bangladesh
Member

Hi man,
cam anyone help me..plz...imtiazmasud
Re: HOW TO SELECT READIO BUTTON DYNAMICALLY..... [message #186125 is a reply to message #186092] Sun, 06 August 2006 04:28 Go to previous messageGo to next message
RJ.Zijlstra
Messages: 104
Registered: December 2005
Location: Netherlands - IJmuiden
Senior Member
Hi:

Please runn the following script:

create table t( user_name varchar2(30), status number ,constraint t_ch check( status in (0,1) ))
/
insert into t( user_name, status) values( 'Jan',1)
/
insert into t( user_name, status) values( 'Piet',0)
/
insert into t( user_name, status) values( 'Klaas',0)
/
insert into t( user_name, status) values( 'Karel',1)
/
insert into t( user_name, status) values( 'Rob',0)

/
commit
/

After that, load and run the attached fmb. It will do exactly what you want, and without any hocus-pocus from exotic triggers. Just plain forms functionality; that is ALL you need here.

(Forms version:
Forms [32 Bit] Version 6.0.8.26.0 (Production)
)

HTH,

Regards
Rob Zijlstra
  • Attachment: RB.fmb
    (Size: 44.00KB, Downloaded 240 times)
Re: HOW TO SELECT READIO BUTTON DYNAMICALLY..... [message #186163 is a reply to message #186125] Sun, 06 August 2006 11:39 Go to previous message
imtiazmasud
Messages: 49
Registered: May 2005
Location: Bangladesh
Member

Hi man,
Many many thankx for ur solution..and I have also consulted with one of senior brother of mine and he also gave me the same solution that u have given man ...I am really greatful to u that u have read my problem with patience..its really working now man...thx once again.... with regards ..imtiazmasud


[Updated on: Sun, 06 August 2006 11:41]

Report message to a moderator

Previous Topic: How to clear non database item attached with lov
Next Topic: Multilanguage support
Goto Forum:
  


Current Time: Wed Dec 07 03:18:13 CST 2016

Total time taken to generate the page: 0.10307 seconds