Expand my Community achievements bar.

SOLVED

did a tab key initiate exit event?

Avatar

Level 4

Hi,

I have a table on my form. If the user hits the tab key on the last field of the last row I want to add another row (as this happens in MS-Word tables for example).

My problem is: How do I find out what inititated an exit event on my field? Was it a tab key or did the user click with the mouse someplace else?

I would like to write something like

     if (xfa.event.trigger = "TABKEY") { ... }

Hope someone had had the same problem already.

Uli

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

xfa.event.commitKey will return a value based on what was used to exit the field. A 3 means a tab was used a 1 means the mouse was used.

So you coudl write code that looks like this:

var keypressed = xfa.event.commitKey;
if (keypressed == 3){
app.alert("You exited this field by using a Tab")
}
if (keypressed == 1){
app.alert("You exited the field by using the mouse")
}

Paul

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

xfa.event.commitKey will return a value based on what was used to exit the field. A 3 means a tab was used a 1 means the mouse was used.

So you coudl write code that looks like this:

var keypressed = xfa.event.commitKey;
if (keypressed == 3){
app.alert("You exited this field by using a Tab")
}
if (keypressed == 1){
app.alert("You exited the field by using the mouse")
}

Paul

Avatar

Level 4

Excellent. I tried it and it works! Thanks a lot!

Once you know the key word you find the right documentation. In case someone else has the same problems: Here is more information:

http://livedocs.adobe.com/livecycle/8.2/acrobat_designer/wwhelp/wwhimpl/common/html/wwhelp.htm?conte...

which is the same as

http://www.adobe.com/devnet/livecycle/articles/Adobe_XML_Form_Object_Model_Reference.pdf

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