Home » Developer & Programmer » Forms » Help!!!!!! How do I use multiple Buttons to sort columns (Oracle Forms)
Help!!!!!! How do I use multiple Buttons to sort columns [message #454631] Thu, 06 May 2010 10:57 Go to next message
YouthHelp
Messages: 12
Registered: February 2007
Location: Southfield, MIchigan
Junior Member

I am maintenancing a form which I have to add buttons as headers that will sort each column's data either in desc or asc order when the user click each button. How is this done? I need to know what built-in function that will closely do this or code that will enable me to fix this problem. Thanks Confused
Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #454632 is a reply to message #454631] Thu, 06 May 2010 11:03 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Use set_block_property to set the blocks order_by property and re-execute the query.
Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #454633 is a reply to message #454632] Thu, 06 May 2010 11:09 Go to previous messageGo to next message
YouthHelp
Messages: 12
Registered: February 2007
Location: Southfield, MIchigan
Junior Member

Can you give an example of the setting is it?

SET_BLOCK_PROPERTY('RR_EMPLOYER_CC_VW1', default_where, :default_cntrl.query_criteria);
GO_BLOCK('RR_EMPLOYER_CC_VW1');
execute_query;

Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #454634 is a reply to message #454631] Thu, 06 May 2010 11:10 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Look up set_block_propery in form builder help. It lists everything you can set with examples.
Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #454635 is a reply to message #454634] Thu, 06 May 2010 11:16 Go to previous messageGo to next message
YouthHelp
Messages: 12
Registered: February 2007
Location: Southfield, MIchigan
Junior Member

Okay now I am getting: FRM-40743 This operation with no base table requires the ON-SELECT trigger. Why is this happening?
Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #454636 is a reply to message #454631] Thu, 06 May 2010 11:20 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Because you're setting the wrong block?
How many blocks do you have?
What are they based on? (table, view, nothing)
Which one are you trying to set the order_by on?
Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #454637 is a reply to message #454636] Thu, 06 May 2010 11:31 Go to previous messageGo to next message
YouthHelp
Messages: 12
Registered: February 2007
Location: Southfield, MIchigan
Junior Member

I have four blocks: header_block(RR_EMPLOYER_HDR) that holds the buttons I will be using; then the default_cntrl block that holds the bottons or misc items the user uses to query for the company; rr_employer_cc_vw block - the items on the input default_cntrl block; and the rr_employer_cc_vw1 block that output the query results that will be manipulated by the buttons I created.
Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #454638 is a reply to message #454631] Thu, 06 May 2010 11:45 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
And what is each block based on?
And which on are you setting the order by on?
Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #454639 is a reply to message #454636] Thu, 06 May 2010 11:50 Go to previous messageGo to next message
YouthHelp
Messages: 12
Registered: February 2007
Location: Southfield, MIchigan
Junior Member

Is this how I set it up? I have corrected the last issue thank you....
set_block_property('RR_EMPLOYER_CC_VW1',order_by,':RR_EMPLOYER_CC_VW1.customer_name'||' '||'Desc');
execute_query;

[Updated on: Thu, 06 May 2010 11:50]

Report message to a moderator

Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #454640 is a reply to message #454638] Thu, 06 May 2010 11:57 Go to previous messageGo to next message
YouthHelp
Messages: 12
Registered: February 2007
Location: Southfield, MIchigan
Junior Member

I am setting the query based on the the RR_EMPLOYER_CC_VW1 block as the attachment shows.
Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #454669 is a reply to message #454640] Thu, 06 May 2010 15:13 Go to previous messageGo to next message
klat
Messages: 87
Registered: May 2009
Location: Mumbai
Member

Try like this

set_block_property('RR_EMPLOYER_CC_VW1',order_by,':RR_EMPLOYER_CC_VW1.customer_name'||' '||'Desc');
go_block('RR_EMPLOYER_CC_VW1');
execute_query;
Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #455236 is a reply to message #454669] Mon, 10 May 2010 13:32 Go to previous messageGo to next message
YouthHelp
Messages: 12
Registered: February 2007
Location: Southfield, MIchigan
Junior Member

I am now getting the ORACLE error: Unable to perform query. error... do you have any other solutions? Sad
Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #455244 is a reply to message #455236] Mon, 10 May 2010 15:52 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
When you get that error, go to Help menu - Display error. It will tell you the reason why you can't perform query.
Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #455402 is a reply to message #454631] Tue, 11 May 2010 07:57 Go to previous messageGo to next message
YouthHelp
Messages: 12
Registered: February 2007
Location: Southfield, MIchigan
Junior Member

Built-in functions and code to sort column data using Oracle Form Buttons.
One is:



WHEN-BUTTON-PRESSED Trigger

DECLARE

BEGIN

set_block_property('BLOCK_NAME',ORDER_BY, ' ITEM_NAME DESC');
go_block('BLOCK_NAME');
execute_query;

END;


and the other would be


WHEN-MOUSE-CLICK Trigger

DECLARE

BEGIN

set_block_property('BLOCK_NAME',ORDER_BY,'ITEM_NAME ASC');
go_block('BLOCK_NAME');
execute_query;

END;

-- Put these triggers within each button to sort and desc/asc. Cool
Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #455405 is a reply to message #455402] Tue, 11 May 2010 08:04 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
So is your problem solved?
Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #455406 is a reply to message #455405] Tue, 11 May 2010 08:04 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
And why use WHEN-MOUSE-CLICK?
Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #455454 is a reply to message #455406] Tue, 11 May 2010 11:41 Go to previous messageGo to next message
kalpataru
Messages: 72
Registered: January 2010
Location: INDIA
Member
without using block level can you tell me the easiest way how to do this type of concept...?
Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #455457 is a reply to message #455454] Tue, 11 May 2010 11:54 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
What's the issue with using block level?
Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #455459 is a reply to message #455457] Tue, 11 May 2010 12:01 Go to previous messageGo to next message
kalpataru
Messages: 72
Registered: January 2010
Location: INDIA
Member
i don't like block level...
Re: Help!!!!!! How do I use multiple Buttons to sort columns [message #455461 is a reply to message #455459] Tue, 11 May 2010 12:03 Go to previous message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
That's unfortunate.
It's the only way I can think of doing it.
And not liking one of the major feature sets of oracle forms is frankly a recipe for pain.
So I suggest you start liking it.
Previous Topic: can't navigate out of current block in enter query mode
Next Topic: Post built-in commits changes in the database
Goto Forum:
  


Current Time: Fri Sep 20 09:50:08 CDT 2024