oracle apex trigger mouse click over region using jquery - javascript

I have 3 regions in my apex page. R1,R2 and R3. R1 is a tabular region. R2 and R3 are sub regions of R1. I want to trigger a fake mouse click event on region R3 when a button is clicked, using javascript. so to trigger mouse click on region R3 ( static id: R3 ) I used the code
$('#R3').trigger("click");
But that doesn't work. When I inspected the page, I found the region id as 'SR_R3_tab'. So I changed the code to
$('#SR_R3_tab').trigger("click");
That didn't made any progress . How can I do this ?

Not sure what APEX version you are using. But I tried to reproduce your flow here.
What I basically did:
Parent child has a button 'Trigger Click'
Added dynamic action on click on that button, where the action is execute javascript: $('#R35171256286597705402').trigger("click");
List item R35171256286597705402 is the id of the child region. Not sure why yours is not following this format, because usually APEX generates these ids. But I fetched from inspecting
To validate, I added another dynamic action, but this time on click on the child region. It basically displays the alert

Related

Preventing Apex Button Double click

Hi I have a button that inserts empty records into an interactive grid. I want to prevent the user from being able to double click that button because it populates duplicate rows. I have a server side argument that says if there are rows the button does not appear however they are still able to double click the Populate_tables button before it vanishes. If there are any other solutions to this please sound off. I've tried everything from javascript to server-side but they are still able to double click no matter what. Here are the before and after pictures of the table.
$('#btnPopulateTbl').dblclick(function(e){
e.preventDefault();
});
The above code prevents the double click for a button. This is in jQuery.
Oracle Apex does not offer this functionality as a setting or etc.
However you can use
$('#button').click(function(event) {
if(!event.detail || event.detail == 1){
// This will be executed once even user clicks multiple times
}
});
Note that your selector must be the id or the class you provide to this button.
By default 'add row' button's classes are:
class="a-Button a-Toolbar-item js-actionButton"
Another solution would be to have apex handle this. Suppose this is on page 1.
Create a page item P1_POPULATE_ROWS_CLICKED with a default value of 'N'
In the page process that populates the table, add the following line before the actual load:
:P1_POPULATE_ROWS_CLICKED := 'Y';
Add a condition to the page process that populates the table of "Item not equal to value", P1_POPULATE_ROWS_CLICKED , Y
Yet another solution is to only execute the insert statement if no rows exist with that condition yet. I can't show you how to do it because you didn't show how the table is populated but happy to do so if you edit your question. This last option is propably the most suitable.

Vue draggable sort only if chosen to

I'm trying to make sort of a folder and file system in Vue.
What I want it to do
When user selects an item and drags it over another item it shows 2 divs. One div says "swap positions" and the other "put into folder". Depending on which od these divs the user lets go of the mouse button the chosen action would be carried out.
What it does
Vue dragable just autosorts the items when I drag one over the other. No events like mouseover can be detected to show the mentioned divs.
Example
This will not resolve your problem, but will help you a lot: Because you drag "file" by clicking and holding with your mouse, don't use #mouseenter or other #mouse.... Instead of use #drag...start/over/enter. And so you can print your red and green zone if you are on folder by clicking a file:
<div
class="item folder"
#dragover="
callMe(); /*you can for instance call method in METHODS part too*/
actions = true;
"
#mouseleave="actions = false" /*works just if you are not holding a file woth the mouse*/
>

DOJO - Close dojo tooltip if connected id is removed

I am newbie on dojo and trying to setup the tooltip.
I have a element that is generated dynamically and i create a id attribute on the same to attach a tooltip to the element, when user hover on it, Dojo tooltip appears, when user click on it the element get removed and created again dynamically without the id, so the connected Tooltip get remain active and i am not able to close it, is there any way to hide the tooltip if connected id is removed.
Thanks in advance.
So , when you click on the element , that element get removed , so before it get removed get it's (click with event args in claback function ,get the id by event.target.id or this.id if event directly connected to the node)
after getting that Id you can hide the tooltip
var element = dojo.byId(Id);
yourTooltip.hide(element);
Thanks for your efforts bRIMOs Bor, But dojo tooltip uses connected id as a reference where to show the tooltip, we can't close a tooltip by getting element connected id when user mouseover the connected id.
Here is the code which worked for me. I just removed the dijitTooltip Class from the mastertooltip, which make a tooltip visible.
dijit.Tooltip._masterTT.containerNode.innerHTML='';
dojo.removeClass(dijit.Tooltip._masterTT.id, "dijitTooltip");
Thanks once again :)

How do I load dynamic data onclick into a map infowindow using Ammap?

I've built an Ammap that displays data in an infowindow based on which continent gets clicked, and I'm really close to where I want to get, with the exception of 2 things:
Upon map load, the first click displays the correct data, but that data remains in the infowindow - clicking other regions takes no effect. The objective is to clear the infowindow and display data from the region clicked last.
After onclick, the region's color changes accordingly. But if you hover above it again, the color disappears. How do I make the onclick color 'stick'?
I believe I made the error when I commented these few lines out - the original code had enabled multiple-area select, and the map I had in mind should only allow single area select.
//event.mapObject.showAsSelected = !event.mapObject.showAsSelected;
//map.returnInitialColor(event.mapObject);
Please see the working pen here and let me know if you can help: http://codepen.io/anon/pen/jPeXor
Thanks in advance for any help!

Ember multiple view in same template

Im expanding the Todo example of emberjs main site ->
http://emberjs.com/guides/getting-started/accepting-edits/
I try to add an extra field to the model called body, and add the same logic, double click for edit. But when I add a second view the body value attached, the double-click event stops working.
I renamed the double-click event and it's not working
http://jsbin.com/atikiv/3/
Why double click is not working anymore ? Also how I can make the 2 fields are editable on double click just one ?
thx

Categories

Resources