Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

xfa.log.message(...) gone in ES2?

Avatar

Former Community Member

Good day,

It would seem that the xfa.log object has been removed in LC Designer ES2. What alternative mean is there to write data to the log tab? (Javascript alerts is out of the question.)

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

The xfa.log object is still around -- but it exists only when executing in the context of the server.  In acrobat if you check typeof xfa.log it will tell you "undefined".

Server-scripts will run in Designer under certain circumstances.  It depends on the kind of file you're saving:

- save-as XDP: no script will run.

- save-as static PDF: all scripts will run

- save-as dynamic PDF: only scripts marked to run-at server will execute (scripts marked runat "client and server" do not execute)

Some of this is explained at:

http://blogs.adobe.com/formfeed/2009/05/template_transformation.html

  John

View solution in original post

4 Replies

Avatar

Former Community Member

( It would have been nice if the designer object were available when previewing the form. That way a developer could log 'live' messages using designer.println(). )

Avatar

Former Community Member

I see the commands in the object assist but I always get an accessor error when the command executes. Are you seeing the same behaviour?

You can also use the javascript command console.println("This is my message") to write a message to the javascript console.

paul

Avatar

Former Community Member

Hello pguerett,

I just tried turning on the statement completion 'feature' (it's the mother of inpredictability - "Was it tab, space or return?"). I take it that's what you're refering to by 'object assist'. It does show there's a log object tucked in there.

I doubt however that is the case. This snippet tells me it doesn't even exist as an internal member of xfa:

xfa.log = function() {
  return {message: function() {return "overloaded";}}
}();

xfa.log.message();

(Doing the same for xfa.host.print() yields an entirely different result.)

Producing javascript alerts/console dumps won't do since the messages I'm producing is "for form designers only", in order for them to track the existence of certain "heritage objects" due for manual removal. There's no need to risk these messages slipping through to the production environment.

Avatar

Correct answer by
Former Community Member

The xfa.log object is still around -- but it exists only when executing in the context of the server.  In acrobat if you check typeof xfa.log it will tell you "undefined".

Server-scripts will run in Designer under certain circumstances.  It depends on the kind of file you're saving:

- save-as XDP: no script will run.

- save-as static PDF: all scripts will run

- save-as dynamic PDF: only scripts marked to run-at server will execute (scripts marked runat "client and server" do not execute)

Some of this is explained at:

http://blogs.adobe.com/formfeed/2009/05/template_transformation.html

  John

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----