I tried to make 2 buttons in one columns so to do this I create them using html code
but I want to get the current row items value I tried to use
data-id="#ROWID#" to get the rowid that I have in sql query and I used javascript dynamic action to get the value but I get the value as #ROWID#
is there is anyway to get current row item value without using URL as column type
Thanks
Vinish Kapoor
Try to specify the data-id=#ROWID# without quotes.
IBRO
I tried that but the same issue
I tried something else without using data-id and I got the values but the item cannot be hidden and it is not useful for me like that the items must be hidden
$s('P4_ROWID',
$(this.triggeringElement).closest('tr').find('td[headers=ROWID]').text()
);
Vinish Kapoor
If you are using HTML for buttons/links then you can use the following for the HREF attribute to call the JS function and from there you set the hidden item value. Below is an example:
Then create a JS function in the function and global variable declare section of the page:
IBRO
I add
'<a href="javascript:setItem(#ROWID#);">Set Item</a>'
as btn to my query so I got btn .
in the function and global I delared this function
function setItem(p_rowid) {
apex.item("P4_ROWID").setValue(p_rowid);
}
But when I try to click on the set item link I get this error
Uncaught SyntaxError: Private field '#ROWID' must be declared in an enclosing class
Vinish Kapoor
If you are creating the link in your SQL query, then there is no need to specify #.
Where and how are you creating this link button?
IBRO
I want to make 2 buttons on one column soo I created sql query like that
SELECT ROWID,
'<button type="button" id="dec" title="Decrease" aria-label="Decrease" class="t-Button t-Button--noLabel t-Button--icon t-Button--tiny t-Button--success t-Button--simple"><span aria-hidden="true" class="t-Icon fa fa-minus-circle-o"></span></button><br>
<button type="button" id="inc" title="Increase" aria-label="Increase" class="t-Button t-Button--noLabel t-Button--icon t-Button--tiny t-Button--success t-Button--simple"><span aria-hidden="true" class="t-Icon fa fa-plus-circle-o"></span></button>' AS BTNS
now I have 2 buttons in the same column to use the buttons I have to get the rowid to execute my code if it is only one button it will be very easy but with 2 buttons
I tried to add data-id with sql button code but when I call it I get #ROWID#
IBRO
how can I get the current row id once I click on any button in my case
Vinish Kapoor
Try this:
IBRO
I got this error Uncaught SyntaxError: Unexpected end of input
Vinish Kapoor
I have edited the code above. Please try again.
IBRO
Now I can see the rowid value
Once I hover the button I see javascript:setItem(AAAjOwAAGAADKgXAAD);
but when I click on it I got this error
Vinish Kapoor
Ok, we are very near 😃
Again modified:
IBRO
Now it works perfect 🙂
Thank you so much for your effort
Much Appreciated