Home » Developer & Programmer » Forms » Hiding/showing Certain fields when a Radio button is selected
Hiding/showing Certain fields when a Radio button is selected [message #160471] Sun, 26 February 2006 16:36 Go to next message
Achilles
Messages: 15
Registered: February 2006
Junior Member
Hello all

I'm new to Oracle, and I desparately need some help. I'm developing an application, which has three Radio buttons

Rd1 , Rd2, Rd3

Now when Rd1 is selected I want a few fields to appear on the same form below The Radio group, while fields relevant to Rd2 and Rd3 should remain hidden.

Similarly when Rd2 is selected fields relevant to Rd1 and Rd3 are hidden while only those relevant to Rd2 appear.

can anyone please suggest, how to implement?

Thanks alot in advance.
Achilles.
Re: Hiding/showing Certain fields when a Radio button is selected [message #160485 is a reply to message #160471] Sun, 26 February 2006 22:11 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Use the When-Radio-Changed trigger to issue multiple Set_Item_Property commands to change the 'VISIBLE' attribute from 'true' to 'false' and back again.
Quote:

Note: Setting Visible to false will cause other item property settings to
change. Consult the "Propagation of Property Changes" section for details."
Make sure you read the rest of the documentation on this point.

David
Re: Hiding/showing Certain fields when a Radio button is selected [message #160595 is a reply to message #160471] Mon, 27 February 2006 08:43 Go to previous messageGo to next message
Achilles
Messages: 15
Registered: February 2006
Junior Member
Thanks alot. That is exactly what I needed.

One more question. When u call a form from your main menu (switch board). HOw do you determine the Mode in the called form?

For example:

in the calling form I define a the Procedure 'WHEN_BUTTON_PRESSED' for a pushbutton as

call_form('form1.fmx', HIDE, no_replace, no_query_only);

And for another pushbutton I define the same procedure as:

call_form('Form.fmx', HIDE, no_replace, query_only);

I know it can be done by passing parameters if I'm already working in some data entry form, by sending the ":system.record_status". and then check the parameter value in the called form. But what I'm stuck at what to do here. In Form1.fmx I a few checks in the 'WHEN_NEW_FORM_INSTANCE' Trigger. like:

go_block('LETTER_block');	

if :system.record_status='QUERY' Then
	execute_query;
	enable_disable_items('letter_block', property_off);

elsif :system.record_status='INSERT' THEN
	enable_disable_items('letter_block', property_on);
	create_record;


But the execute_query; statement never works and the records are not fetched into the form. If I move the execute_query outside the 'IF' Statement and place it above the if, and then execute the form. The form compiles and then disappeares!. I dont know what to do here.

I have three buttons on the switch board.
1. "Add REcord"
2. "Search Database'
3. View All Records

By clicking "Add record" I want to call Form1.fmx and it should be in the "create_record" mode.

By clicking "Search Databse" I wan to call the same Form1.fmx and it should be in "Enter Query" mode.

By clicking 'View All Records" I want it to fetch records from the databse into the form.

Any help?
Thanks.

[Updated on: Mon, 27 February 2006 13:48]

Report message to a moderator

Re: Hiding/showing Certain fields when a Radio button is selected [message #160868 is a reply to message #160595] Tue, 28 February 2006 19:33 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
You CAN'T 'SEND' the :system.record_status, this is a read-only object. Read the documentation please. Either use your own parameter variable or (shudder) use a 'global' variable. Then, in the When_New_Form_Instance trigger test this parameter. Also, turn your fields on or off BEFORE you do the execute_query. You don't need to do a create_record as that is the default behaviour of a form.

David
Re: Hiding/showing Certain fields when a Radio button is selected [message #161055 is a reply to message #160868] Wed, 01 March 2006 15:23 Go to previous messageGo to next message
Achilles
Messages: 15
Registered: February 2006
Junior Member
Once again thanks for your reply.

Actually what I'm doing is from the Switchboard, the "View All Records" button results in a call to form1.fmx in this fashion:

call_form('Form1.fmx', HIDE, no_replace, query_only);


Now in "Form1.fmx", I check the current form status, since it should be open in "query only" mode, here's what I do:

if :system.record_status='QUERY' Then
     go_block('block_name');	
     item_enable_disable('block_name', property_off);
     execute_query;



Is there anything wrong with what I'm doing? Why arent the records fetched? THe form opens in "Query only" mode but only the records are not fetched.

I'm using Oracle 10G with Forms 6i.

Thanks.
Re: Hiding/showing Certain fields when a Radio button is selected [message #161517 is a reply to message #161055] Sun, 05 March 2006 22:45 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I have just gone through the reference manual and there does not appear to be an item that can be tested to see whether a form has been opened in 'query_only' mode. I repeat, either pass a parameter or use a global and test it in the new form.
Quote:

I check the current form status, since it should be open in "query only" mode
You CAN NOT determine the status of a Form by testing the status of a Record.

David
Previous Topic: restricting the user to type non-numeric characters in numeric field
Next Topic: http://forums.oracle.com/forums/thread.jspa?threadID=366673&tstart=0
Goto Forum:
  


Current Time: Fri Sep 20 04:53:14 CDT 2024