Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Security Settings prevent the usage of this method :-(

Avatar

Former Community Member
hi,



since i began using adobe LiveCycle products (well one month by now), mainly the LC Designer, i'm getting the same error by using certain methods (here i have to free translate out of the german):



"NotAllowedError: security settings prevent the usage of this property or method. App.trustedFunction:14:XFA:all[0].sf_tab[0]:initialize



is there someone, who can explain, what's do be done to get rid of it?



thanks,

valerio
8 Replies

Avatar

Former Community Member
It sounds like you're trying to use a method in an object's Initialize event and you're hitting a security block.



Are you able to post the script in the Initialize event of the sf_tab[0] object? It would in determining what the problem is.



Stefan

Adobe Systems

Avatar

Former Community Member
hi fb,



thanx for your post. here is the code:



----------------------- CODE STARTS --------------------------------



var myDoc = event.target;

function myFunction(){

app.beginPriv();

myDoc.newPage();

app.endPriv();

};



var t1_count = xfa.resolveNodes("t1[*]").length;

//app.alert(t1_count);



for(i=t1_count; i>5; i--){



if(i==t1_count){



app.trustedFunction(myFunction);

}

}



----------------------- CODE ENDS --------------------------------



hope you find out what's wrong, even though i don't think the problem depends on the code. i've got the same error message in other different occasions and i believe it has something to do with settings or similar.



thanks for your further help,

valerio

Avatar

Former Community Member
It looks like your trying to run a function defined at the document level (ie: from within an event on a field) but a trusted function must be defined at the folder level (ie: in a .js file in the Acrobat /JavaScripts/ folder). That how trusted functions get their priveledges, when Acrobat is started, it evaluates the JavaScript in the .js files, sees that the function is marked as trusted and gives it the special priveledges it needs for when it is called. Here's an example of script you could put in a .js file:



saveFunc = app.trustedFunction(function (path) {

app.beginPriv();

try {

event.target.saveAs(path);

} catch (err) {

console.println("Error: " + err);

}

app.endPriv();

});



Then in your form you would simply call saveFunc().



Another thing I just noticed, I don't believe you will be able to use the Document.newPage() method from an XFA form (form from Designer) whether you run it from a trusted function or not. Acrobat is blocked from being able to make changes like this to an XFA form, because the underlying structure of an XFA form and an AcroForm is so different that even if you could make it work you wouldn't get the results you'd expect.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
hi chris,



thank you for posting me.



well that's a hell of a situation, because ( see my post http://www.adobeforums.com/cgi-bin/webx/.3bbf8625 ) i need some tricky methods to build up a table capable to expand vertically and horizontally and break intelligently according to the amount of data coming from the xml file.



i first tryed with the table object in the designer lib, but i had no success (lots of trouble paginating the breaks). so i thought i could generate the table using js.



what do you think, it could be the best way? any hint?



thanks again,



valerio

Avatar

Former Community Member
Did you try using the Conditional Breaks feature on the table? I don't know what kind of breaking you need to do but Conditional Breaks (Designer 7.1 feature) can be used to do some intelligent breaking in a table depending on the data being loaded into it. For instance, if your data listed a bunch of addresses, you could have a break to a new page inserted everytime the Zip/Postal Code changes.



Would that be the kind of "intelligent" breaking you're looking for?



Stefan

Adobe Systems

Avatar

Former Community Member
I just read the thread you were referring to (I should've read that first). I don't know of any way to have a horizontal overflow break; only vertical overflow breaks.



Is there a specific reason why you need to break horizontally? Why can't you just use a wider page size to avoid the need for a horizontal break?



Stefan

Adobe Systems

Avatar

Former Community Member
hi fb,



well the reason is that the customer doesn't know how many datasets there will be to be shown :-{ so the table should be able to manage any amount.



my idea was to let the table grow vertically and set a new page dynamically each time it has to break horizontally. then i could let the table continue on this new page.



thanks,

valerio

Avatar

Former Community Member
It sounds like you're wanting a table that will accommodate
any data set where you don't know until runtime how many columns and rows the table will need, which explains why the table may need to break horizontally.



The problem is that if there are so many rows in the data set that the table needs to break vertically as well as horizontally, I have no idea how that would be laid-out. I don't think Designer/Acrobat can handle that kind of pagination.



I think the best option, in your situation, may be to simply generate a dynamic subform containing fields, in a top-down layout, for each column in the data set. That way, there's never any horizontal breaking required. I don't think using the table object is the best option in this case (because horizontal breaking isn't supported).



Stefan

Adobe Systems