Home » Developer & Programmer » Forms » push button associated with record (Forms builder 11g )
push button associated with record [message #586089] Mon, 03 June 2013 06:55 Go to next message
NewToOracle10g
Messages: 31
Registered: April 2009
Location: Adelaide
Member
I have a data block in which I am displaying 15 records at a time. The query for the block is complex with 3 tables and multiple joins. There is no primary key associated with each record, but I'm storing rowid in a hidden field. I have a push button in each row/ record. When user double clicks on it, I want to get the rowid in the record and pass it to pl/sql.
Also there is one column in table which is stored as char (ex, Y/N) but when I display in the table it should be Yes/ No. How to achieve this?
Re: push button associated with record [message #586091 is a reply to message #586089] Mon, 03 June 2013 06:58 Go to previous messageGo to next message
cookiemonster
Messages: 10961
Registered: September 2008
Location: Rainy Manchester
Senior Member
rowid - pass it as a parameter, just like any other value. What problem are you having with this?
yes/no - you could make the item a list item.
Re: push button associated with record [message #586130 is a reply to message #586091] Mon, 03 June 2013 18:29 Go to previous messageGo to next message
NewToOracle10g
Messages: 31
Registered: April 2009
Location: Adelaide
Member
Initially I was working in .net. And in gridview when we press button we can access entire record as selectedrow. So in oracle forms I'm not getting if button is pressed how does it know which record to access because button is non database item.
yes/ no I am not inserting in table but just displaying. but if i write decode in select statement, it is giving some error. So wanted to know which trigger should be used if i want to modiffy values before displaying.
Re: push button associated with record [message #586149 is a reply to message #586130] Tue, 04 June 2013 02:12 Go to previous messageGo to next message
Littlefoot
Messages: 19612
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
if button is pressed how does it know which record to access

As you have a button in every record, :SYSTEM.TRIGGER_RECORD system variable will tell you which record you are in.


Quote:
yes/ no (...) if i write decode in select statement, it is giving some error

You, of course, understand that it is quite difficult to debug code you can't see and fix "some errors".

As you display "Yes/No" for "Y/N", do that in a query that is block's source. DECODE is the right way to do that, such as
select decode(yn_column, 'Y', 'Yes', 'N', 'No') yn_item,
...
from ...

[Updated on: Tue, 04 June 2013 02:12]

Report message to a moderator

Re: push button associated with record [message #586157 is a reply to message #586149] Tue, 04 June 2013 03:58 Go to previous messageGo to next message
cookiemonster
Messages: 10961
Registered: September 2008
Location: Rainy Manchester
Senior Member
Littlefoot wrote on Tue, 04 June 2013 08:12
Quote:
if button is pressed how does it know which record to access

As you have a button in every record, :SYSTEM.TRIGGER_RECORD system variable will tell you which record you are in.

Assuming the button is in the same datablock as the items in the grid you don't even need to do that. Just reference the datablock items directly, forms knows which record you're in.

Littlefoot wrote on Tue, 04 June 2013 08:12

Quote:
yes/ no (...) if i write decode in select statement, it is giving some error

You, of course, understand that it is quite difficult to debug code you can't see and fix "some errors".

As you display "Yes/No" for "Y/N", do that in a query that is block's source. DECODE is the right way to do that, such as
select decode(yn_column, 'Y', 'Yes', 'N', 'No') yn_item,
...
from ...


If you do that you need to make the item that displays Yes/No a non database item. It's far simpler to make the item a list item that displays Yes/No but stores Y/N.

[Updated on: Tue, 04 June 2013 03:59]

Report message to a moderator

Re: push button associated with record [message #586160 is a reply to message #586157] Tue, 04 June 2013 04:02 Go to previous messageGo to next message
Littlefoot
Messages: 19612
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Right; but, as he saidQuote:
yes/ no I am not inserting in table but just displaying
it shouldn't really matter.
Re: push button associated with record [message #586199 is a reply to message #586160] Tue, 04 June 2013 07:11 Go to previous messageGo to next message
cookiemonster
Messages: 10961
Registered: September 2008
Location: Rainy Manchester
Senior Member
If it's a non-database display item then it can just be populated in the post-query trigger. Easier than messing with the query source.
Re: push button associated with record [message #594323 is a reply to message #586199] Tue, 27 August 2013 07:59 Go to previous messageGo to next message
NewToOracle10g
Messages: 31
Registered: April 2009
Location: Adelaide
Member
Apologies for late reply. The problem of push button is solved. Unlike .net in forms only one button for 15 records is enuf. Forms knows which rdcord is selected. The Y/N is solved by post query.
Re: push button associated with record [message #594324 is a reply to message #594323] Tue, 27 August 2013 08:02 Go to previous message
cookiemonster
Messages: 10961
Registered: September 2008
Location: Rainy Manchester
Senior Member
Then I hope you're using a non-database item for Yes/No and it's not editable.
Otherwise List Item remains the correct solution.
Previous Topic: Data block based on join, tables in different schema
Next Topic: oracle forms basic info required
Goto Forum:
  


Current Time: Fri Sep 19 01:43:45 CDT 2014

Total time taken to generate the page: 0.08230 seconds