isabolic / apex-plg-dropdown-btn

dropdown button plugin for oracle apex
MIT License
4 stars 1 forks source link

Dropdown Buttons don't work on 5.1 #16

Closed rlegge closed 7 years ago

rlegge commented 7 years ago

Hi,

Ive just upgraded to apex 5.1. Now the buttons don't appear to do anything. I have a button with

test;javascript:alert('test') and it doesn't do anthing. I don't get any errors in the console. or any indication that anything is actually triggering.

This is pretty urgent, as some of my menus no longer work.

Many thanks Richard

isabolic commented 7 years ago

Hi rlegge,

is there any javascript error in js console? can you provide me with any type of stacktrace (js, apex debug)? apex.oracle.com is on apex 5.1 version and it working https://apex.oracle.com/pls/apex/f?p=101959:3:

rlegge commented 7 years ago

Hi, Im not sure how to view any 'stacktrace'. I normally use console for debugging javascript.

On your example on apex.oracle.com, on the dropdown-sql button. you have a javascript function. Im not sure what it is meant to do, but it doesn't to anything. This is the same error that I'm getting.

rgds Richard

isabolic commented 7 years ago

I have create a button on apex.oracle.com one with options type : static test;javascript:alert('test')

and another with type : SQL Query

for using javascript function set them on page "Function and Global Variable Declaration" for example:

function my_alert(){ alert("js"); }

and in sql query:

SELECT 'Page 3', apex_util.prepare_url(p_url => 'f?p=' || v('APP_ID') || ':3:' || v('APP_SESSION') || '::' || v('DEBUG') || '::', p_checksum_type => 'SESSION') AS LINK FROM dual UNION ALL SELECT 'Page 2', '2' FROM dual UNION ALL SELECT 'github', 'https://github.com' FROM dual UNION ALL SELECT 'js', 'javascript:my_alert();' FROM dual

this is a workaround, i will make a complete soluction for this case

rlegge commented 7 years ago

Hmm. It has something to do with calling a dynamic action from the button.

My code on the button to call several DAs was:

Create Code;javascript:$.event.trigger("CreateCode"), Insert Codes;javascript:$.event.trigger("InsertCodes"), Move Code;javascript:$.event.trigger("MoveCode")

Ive now changed this to calling a page function that in turn calls the DA and it all works fine. Oddly though, I have another buttons with the event.trigger code on, and it still works OK. Very odd.

So, its all working now. Thanks very much for your prompt response.

Kind Regards Richard

rlegge commented 7 years ago

Hi Ivan, I've worked out what this issue is with this, and why it seems a bit intermittent. If I open and click on the link quickly, it runs my Javascript function fine. If however, I don't press the button itself for a little bit longer, it then doesn't do anything. I can reproduce this on your site. Click on Dropdown go down to Github, but wait for a second, and when you click on it nothing happens. Click on the button and scroll down to github and click quickly, and it works fine. (Im using Chrome by the way, if that makes a difference).

Thanks Richard

isabolic commented 7 years ago

Hi Richard,

v2 is ready for download and it's now available on github for download (https://github.com/isabolic/apex-plg-dropdown-btn/releases/tag/2.0.0)

so you first must install package (pks, pkb) and then apex plugin. the big news is that you no long have Button $ selector instead you must use standard apex approach by that I mean in your DA there is property Affected Elements -> Selection Type -> Button, and there you're select your button.

More examples and some docs are available on https://apex.oracle.com/pls/apex/f?p=101959:3

Plese first try you specific item click so that we can close this issue.

Best regards isabolic