Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-00001: unique constraint (APEX_180100.IG_RPT_NAME_UK) caused on "setColumnWidth"

Andi77Jul 19 2018 — edited Jul 19 2018

Hi all,

i'm trying to use the complete real estate of the screen in my application. Im combination with the lazy loading of the interactive grid i'm running into an ORA-00001 error because of an ajax call which i didn't fire up. It's something in the framework wich is doing it wrong.

You can reproduce it (or view it at apex.oracle.com here: https://apex.oracle.com/pls/apex/f?p=153765  )

Use the open Login with any username - but it's neede to have a login.

Click on the first link below home will open a EMP grid with Edit mode. Once the screen is loaded, press on "Resize Grid" and get the ORA-00001 Message. If the ORA-00001 message does not show up - logout und immediately login again with the same username and press the button again. The message will come up - the error only happens once during a session on the screen. In the background the system is trying to create a new "primay report" (in apex 5.x you'll see them in the list) in APEX 18.1 its causing the ORA-00001 error.

If you use the second below Home - the click is not needed. It's executed automatically by javascript as soon as the IG is loaded with some data. The error is the same - ORA-00001.

It seems to be a timing problem of the interactive grid - but i don't understand why the grid is trying to create a new "primary report" on "setColumWidth".

Technical Background Stuff: (i tried to simplify my script which is generated in the background for all my application grid)

JS Script to resize the columns:

var gCemp = [{

columnName : "ENAME",

minWidth : 300

}, {

columnName : "SAL",

minWidth : 300

}, {

columnName : "JOB",

minWidth : 300

}

];

function resizeGridemp(gCemp) {

console.log('Width:' + window.innerWidth);

var wd = window.innerWidth - 100;

var gridheight = (window.innerHeight - 115 - 50) * 90 / 100;

for (c = 0; c < gCemp.length; c++) {

var a = a;

try {

console.log('resize' + gCemp[c].columnName);

var view$ = apex.region("emp").widget().interactiveGrid("getViews", "grid").view$;

view$.grid("setColumnWidth", "" + gCemp[c].columnName + "", gCemp[c].minWidth);

/*apex.region("emp").widget().interactiveGrid("getViews","grid").view$.grid("setColumnWidth", ""+gCemp[c].columnName+"", gCemp[c].minWidth);        */

} catch (err) {

console.log("Error happend:" + err.message);

}

}

$('#emp_ig').css("height", (gridheight));

console.log('resizeGridemp');

};

Basically i'm using the javascript api to call something like:

...view$.grid("setColumWidth","ENAME",300);

to set the columWidth dynamically to a given value. Thats working fine - but for some reason - it's causing trouble with the apex framework because this is trying to create a new "primary report".

Another thing to mention:

i added a new Button in the interactiveGrid, too. This "World" button is added with:

function(config) {

    var $ = apex.jQuery,

                                     toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),

                                     toolbarGroup = toolbarData[toolbarData.length - 2],

createButton = {

type: "BUTTON",

action: "invoke-nls-page",

title: "Language Translate Button"

};

toolbarGroup.controls.push(createButton);

    config.initActions = function( actions ) {

                            actions.add( {

                                name: "invoke-nls-page",

                                label:"",

                                icon: "fa fa-globe",

                                action: function(event, focusElement) {

                                    console.log('NLS Button pressed');  

                                }

                            } );

    }

    config.toolbarData = toolbarData;

   return config;

}

Anybody can confrim that or sees what i'm doing wrong??? Or it this a BUG?

Kind regards,

Andreas

Nachricht geändert durch Andi77. code typo / missmatch in text

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 16 2018
Added on Jul 19 2018
1 comment
668 views