Expand my Community achievements bar.

SOLVED

How to implement Anchor using pdf

Avatar

Level 2

Hi,

I like to know, how to implement the set focus method in the Adobe live cycle.

When the user loads a form, it should redirect him to the TEXT BOX in the 3rd Page.

On the INITIALIZE of the main form, i wrote this command -- xfa.host.setFocus(" ----Path of the text box----");

but it doesnt work... Can anyone help me??????/

1 Accepted Solution

Avatar

Correct answer by
Former Community Member
8 Replies

Avatar

Level 10

Hi,

I'd say that your script is OK, it is just firing too soon. Try putting it in the docReady event.

N.

Avatar

Former Community Member

hi..

  remember setfocus() event doesn't work for initialize, form:ready and Layout:ready events. May be you can try the event in Form:enter or doc:ready events as suggested.

kc

Avatar

Level 10

I think you have to use app.setTimeOut() to get it to work, it gives the form a chance to render.

You'll have to hunt around for the syntax (I think there's some references in the forum) I've not used it myself.

Avatar

Former Community Member

Jono is correct.

The xfa.setFocus command is merely a wrapper to the app.setFocus Acrobat command. At startup the xfa and Acroforms levels are not complete until the form is totally loaded. Hence when you execute an xfa.setFocus command the AcroForm is not ready yet. So we have to use the app.setTimeOut command to execute the command in the future (after the form is ready). I have created a sample and attached it here. The code is on the form1 object's docReady event. I use a setTime out to call an Acrobat setFocus command. Note that you have to use an Acroform reference to the object and not an xfa one.

Paul

Avatar

Level 2

Thanks for all the valuable suggestions guys.. I will try implementing it.

@ pguerett:

I am unable to access the file u have attached. Can u please try reattaching it......

Thanks

Sun

Avatar

Former Community Member

It will take a bit of time for the queued to be cleared. Once that happens you can get it. If you woudl rather post your email address I can send it to you that way.

Paul

Avatar

Level 2

Paul,

   anuraag.111@gmail.com

   this is my mail id...

Thanks,

Sun

Avatar

Correct answer by
Former Community Member

Just sent it

Paul

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] ----