RonnyWeiss / Apex-Dynamic-Tooltip

This plug-in is used to dynamically show a tooltip on any page element. With mouse-hover the content of the tooltip is loaded live from the database. Filter attributes in the desired element can then be used to filter the select.
MIT License
6 stars 4 forks source link

targetConfig issue #6

Closed lacrimal closed 5 months ago

lacrimal commented 1 year ago

Hi, Thanks for this plugin, it allows me to replace old one COM.ANKERPOORT.APEX.TOOLTIP This Screnpresso instructions are not user friendly so i have question. Trying to implement your plugin inside my app - is there restricted list of events where I can use it ?

For example with 'Mouse Enter' > region (but also with other events) it returns at first run:

message: "JSON.parse: unexpected end of data at line 1 column 1 of the JSON data" msg: "Error while try to parse targetConfig. Please check your Config JSON. Standard Config will be used."

You can see this on this demo app:

https://apex.oracle.com/pls/apex/f?p=72642:2

Use demo/demo1 for login

Thanks

lacrimal commented 1 year ago

HI, did you had chance to look at this ?

RonnyWeiss commented 1 year ago

Your config json is not correct. Please check that it's a valid json.

You van use also validators the can be found on Google for this Problem.

Kind regards

Ronny

lacrimal commented 1 year ago

It is original, default content of 'Option JSON', already validated, it comply with RFC 8259 :

{
  "backgroundColor": "rgba(240, 240, 240, 1)",
  "maxWidth": "400px",
  "ajaxDelay": 300
}

Not see any other place where can put json content - are we talking about this ? Maybe there is something missing, did not touch it :-)

lacrimal commented 1 year ago

Not exactly understand why, but updating 'Option JSON' inside plugin configuration defaults removes error. ...Until saving page with plugin implemented - then problem is back.

{"backgroundColor":"rgba(140,140,140,1)","maxWidth":"400px","ajaxDelay":300}

Both places have identical json as above.

Same behaviour you can see on my sample app above - now error is gone - only change was update of 'Option JSON1' and replace 240 with 241 in plugin default configuration. However once again - when page will be saved - error appears again.

igorfilko commented 10 months ago

since value of (t) is already JSON, I skipped the parse so the adapted JS jsonSaveExtend section is:

jsonSaveExtend: function (e, t) {
    var n = {};

    try {
        n = $.extend(!0, {}, e, t);
    } catch (error) {
        n = $.extend(!0, {}, e);
        apex.debug.error({ module: "util.js", msg: "Error while trying to merge 2 JSONs into standard JSON if any attribute is missing. Please check your Config JSON. Standard Config will be used.", err: error, finalConfig: n });
    }

    return n;
}

that eliminated the error in console log.

RonnyWeiss commented 5 months ago

fixed