Oracle APEX Cards Tooltip - oracle-apex

I have a classic report with cards. I want to display a value when the user mouseover any of the cards. How can I do that?

One method might be to add a value to card modifiers column, then run a Dynamic Action after refresh of your region, that would execute the following JS (fire on initialisation).
The first jQuery selector is driven by your card modifier value - I used 'titleA'
$('.titleA a').attr('title','Help me');
This should modifer your generated HTML accordingly

There are three mouse related dynamic actions you can use without having to write any JavaScript:
Mouse Enter (mouseenter) - Fires once when the pointing device is moved into the triggering element.
Mouse Leave (mouseleave) - Fires once when the pointing device is moved away from the triggering element.
Mouse Move (mousemove) - Fires when the pointing device is moved while it is over the triggering element.
Docs here.

Related

CWebBrowser2 (MFC) GoBack method causing crash when it has nothing to go back to

My application supports the IE (InternetExplorer) browser. When the back/forward buttons are clicked and there is nothing to go back or forward to, Webbrowser.GoBack() and Webbrowser.GoForward() are causing a crash.
Is there any way to know if I can go back before I actually call GoBack()? I took a look at the CWebBrowser2 class functions, but I couldn't find anything as such.
Is there any API to help on this, or any alternative approach to handle this?
Is there any way to know if I can go back before I actually call GoBack()?
Per the IWebBrowser2::GoBack() documentation:
Use the DWebBrowserEvents2::CommandStateChange event to check the enabled state of backward navigation. If the event's CSC_NAVIGATEBACK command is disabled, the beginning of the history list has been reached, and the IWebBrowser2::GoBack method should not be used.
And likewise in the IWebBrowser2::GoForward documentation:
Use the DWebBrowserEvents2::CommandStateChange event to check the enabled state of forward navigation. If the event's CSC_NAVIGATEFORWARD command is disabled, the end of the history list has been reached, and the IWebBrowser2::GoForward method should not be used.
And per this discussion thread:
Create a couple of BOOL member variables in the class that processes the
ON_UPDATE_COMMAND_UI notifications for the 'back' and 'forward' toolbar
buttons -- one for each button state. Initialize them both to FALSE in
the ctor. Handle the OnCommandStateChange event, and watch for the
CSC_NAVIGATEBACK and CSC_NAVIGATEFORWARD values in the 'nCommand'
parameter. When you get the CSC_NAVIGATEBACK value store the 'Enable'
parameter value into your BOOL member variable for the 'back' button
state. Do the same thing for the 'forward' button state variable when
you get CSC_NAVIGATEFORWARD value. In your OnUpdateButtonForward and
OnUpdateButtonBack handlers, call pCmdUI->Enable using the corresponding
button state member variable.
So, use the browser's CSC_NAVIGATE... state changes to know when it is safe to call GoBack()/GoForward()`. These are the same events that IE uses to enable/disable its own Back/Forward UI toolbar buttons.

Web Browser Events using MsHTML.h

I am using cwebpage integrated into my program. CWebpage information can be found here:
https://www.codeproject.com/Articles/3365/Embed-an-HTML-control-in-your-own-window-using-pla
My question is regarding events. I currently have this setup to setup click events using get_anchors() in IHTMLDocument2. I then iterate over all of the elements to create a IDispatch in memory. This holds the event information. When an item is clicked, it sends a WM_NOTIFY to the window and then I can handle the event and parse out what I need to parse from the element that was selected.
This all works fine until I run into a page in my software with close to 50,000 anchor tags in which we run out of memory since we hold the events in memory until the the page is destroyed.
Is there a simple way to obtain the clicked element without having to set an event for each individual element? Is it possible to set a click event at a document level and then find the element that tripped it? All I am trying to do is obtain the id of the element that is clicked.
What I've tried:
I tried to just use a WM_LBUTTONDOWN message read in our browser window and then use htmlDoc2->elementFromPoint() to simply get the information that I need from the element selected. This however does not work well if the page is zoomed or wraps.
Please note this programming is in C/C++, not javascript or vb.
Thank you.
HTML events "bubble" from child elements to parent elements. So, you can simply assign a single onClick handler to the IHTMLDocument2 itself, and then use the srcElement property of the IHTMLEventObj object that is given to your handler every time on onClick event is fired by any child element on the page. See Understanding the Event Model.

How to get an element on a page, click something else and wait for the original element to dissapear

I am using Python 2.7, Robot Framework and Selenium2Library on a windows server.
On a page with a button and a data text box, I have a selenium test that clicks the button, this fires off a get request and on return recreates the data text box and updates with the new value. The test then sleeps for 10s to allow this to happen and then reads the value in the data text box.
What I would really like to do is get the element for the data text box, then click the button and keep polling for the original data text reference to become unavailable on the DOM i.e. it has been recreated, and then read the text box to get the value.
I can't for the life of me find out how I would do that using Robot Framework and Selenium2Library as all the calls are self contained and don't pass references back.
Could you offer any other solution?
There are a number of ways to do it with the SeleniumLibrary, all revolving around its Wait Until keywords - documentation link.
Option one - the element is the same, so its locator doesn't change; the check is done with Wait Until Element Contains, and passing the new text:
Click Element ${the_locator_for_the_button}
Wait Until Element Contains ${the_locator_for_the_element} your target text
Option two - if on click the target element changes to a different one, e.g. the locator is different. Then you'd first wait for the initial element to disappear, and the new one to appear:
Click Element ${the_locator_for_the_button}
Wait Until Element Is Not Visible ${the_locator_for_the_initial_element}
Wait Until Element Is Visible ${the_locator_for_the_new_element}
Option three - if you don't want to deal with locators, but to make sure the actual element as Selenium sees it disappears, you can get it with Get Webelement, and then pass that reference to the Wait ... keywords - most (if not all) SeleniumLibrary support both locators or acutal webelements:
Click Element ${the_locator_for_the_button}
${webelement}= Get Webelement ${the_locator_for_the_initial_element}
Wait Until Element Is Not Visible ${webelement}
The good thing about the Wait Until ... keywords is that they constantly poll the DOM for the expected change, and continue at the first detection the condition is met. E.g. it's not a hardcoded sleep that'll pause the execution for the predefined time, but finish as soon as ready.
Have also in mind all these keywords support the argument timeout=Xs, where the X is the time up to which the keyword waits for the condition to be met.

Ember 2.10, updating component on array pushObject

I have two components that should both reflect the same data (testing d3 in ember)
One of the components adds a node to my state and also lists those nodes. The state is an array and I believe I am correctly calling pushObject in order to notify everything that there are updates.
The other is going to be a d3 thing so nothing is being rendered by the hbs file and I need to be notified when the array is modified so I can call the appropriate d3 functions and rerender my force graph.
I setup a minimal twiddle here: https://ember-twiddle.com/d4aae25e4a63636a97ed78b0b0081227
Basically, when you press add node: it adds a node to the list so I know some event is being fired however, my draw function in the "twiglet-graph" component is not being called.
To see this in action, goto the fiddle and press "Add". When you add another node, it will correctly list two nodes on the top part but it never changes the length in the bottom component to 2. I setup a click event that will alert you of the length of that component's this.nodes and clicking after adding shows a length of 2. How do I hook into the update so I can redraw my force graph?
Thanks.
By design, adding or removing objects from an array does not trigger the didUpdateAttrs hook. Instead you need to use notifyPropetyChange method.
See link for more details:
http://discuss.emberjs.com/t/didupdateattrs-not-called-on-array-modifications/10046

Event when slide is displayed in ioslides?

Is there an event triggered when there's a page change in an ioslides presentation? I'd like to allocate some resources to display the slide, and release them when the user moves on.
Yes, ioslides triggers slideenter and slideleave events on each slide. These are currently handled as strings, so you'd use Javascript like
slide.setAttribute("slideenter", "somecode();");
to execute somecode(); when the slide is entered. See also this answer: Google IO Slides Template - Javascript on each slide