Quantcast
Channel: Adobe Community: Message List - LiveCycle Designer
Viewing all 15211 articles
Browse latest View live

Re: How to prevent form from executing initialize and calculate event when digitally sign

$
0
0

You can check the state of a signature field through a script an use the result to control if other script to be executed or not.

 

// Get the state of the signature field.
// NOTE: In XFA forms this works only by using getField() method with full SOM expresion, so keep the accessors [0]!
var oSignInfo = event.target.getField("form1[0].#subform[0].signature[0]").signatureInfo(),    iSignState = oSignInfo.status;

// Execute only when form is unsigned
if (iSignState === 0 {
    // enter your code here    …
}

 

Status Code Meaning

-1 Not a signature field

0 Signature is blank

1 Unknown status

2 Signature is invalid

3 Signature of document is valid, identity of signer could not be verified

4 Signature of document is valid and identity of signer is valid.


Re: How to prevent form from executing initialize and calculate event when digitally sign

$
0
0

Hi radzmar,

 

Thanks for taking time to answer to this issue, I've tried multiple times before to use a similar method to get a signature field status with XFA dynamic forms. The only thing I ended up receiving was a message saying for security measures it can't get signature status as if it needs a trusted function...

 

Now with what you have provided I get the following message :

TypeError: event.target.getField(...) is null

the code it's executing is the following :

var oSignInfo = event.target.getField(digSignature.somExpression).signatureInfo(),

      iSignInfo = oSignInfo.status;

 

app.alert(iSignInfo.toString());

 

Am I missing anything?

Re: Is it possible to make a flowed text field expand to a fixed height?

$
0
0

Awesome! Thanks. Worked perfectly.

Required field is visible but the parent object is hidden, how to get around this situation?

$
0
0

We have developed required field custom validation logic, that will loop over list of required fields, one at a time, check if field is empty or null, then it will highlight the field, and raise validation error, one error for all fields that are not filled.

 

The problem is that the field is marked as required, and the parent subform or object is hidden, due to a bug for example.

 

How we can get around this issue?

 

One way it to display the list of empty fields in a subform along with the Required Field Validation Error.

 

But, how we can jump to the field (using setFocus) if the parent object is hidden?

 

Is there way to find out if the parent, or any ancestor is hidden, then force to make it visible?

 

Anyone knows if this issue has been addressed before?

 

Thanks,

Tarek

Re: How to prevent form from executing initialize and calculate event when digitally sign

$
0
0

If getField() returns null, the SOM couldn't be resolved this method. This is propably because digSignature.somExpression returns a somExpression beginning with xfa[0].form[0].…. Enter a SOM expression beginning with the root node of your form (i.e. form1[0]).

Re: Am I able to still purchase this?

Re: How to prevent form from executing initialize and calculate event when digitally sign

$
0
0

Alright I got it to work now... but not entirely

 

It seems to work only on the execution of the second initialize of the form, afterwards it still returns null.

Either in a click, initialize or calculate event, the getField returns null each time, it only returns the current signature status when the form is opened and initialize is fired twice because I execute initialize event of the form on docReady...

Re: Required field is visible but the parent object is hidden, how to get around this situation?

$
0
0

Hi there,

 

I guess your best bet would be verifying each parents' visibility when focusing on an object and make sure they are visible.


Copy and Pasting Working Dropdown that hides/shows other fields does not work, even when everything is renamed.

$
0
0

Like the title hints, i copy and past a working Drop Down and even when i rename everything, it does not work.
I have done both copy and pasting of the objects and creating them from scratch, with the same non-results.

I did not write the code, nor do i fully understand it, especially why its not working.

 

This is the one that works:

 

DD is the Drop down

Ordering is the text area to the right of the drop down.  It should be shown or hidden depending if the Drop Down value is Yes (1) or No (0), respectively.

Row is shown on a different page and uses an add/remove function.

 

 

WORKING CODE:

 

 

form1.#subform[1].DDScrubs4me::change - (JavaScript, client)
if ($.boundItem(xfa.event.newText) == "Yes") {  this.resolveNode('Table1._Scrubs4MeRow').addInstance(1);  if (xfa.host.version < 8) {  xfa.form.recalculate(1);  }  this.resolveNode("Scrubs4meOrdering").presence = "visible";
}
if ($.boundItem(xfa.event.newText) == "No") {  this.resolveNode("Scrubs4meOrdering").presence = "invisible";  this.resolveNode('Table1._Scrubs4MeRow').removeInstance(0);  if (xfa.host.version < 8) {  xfa.form.recalculate(1);  }
}
//+ GENERATED - DO NOT EDIT (ID:B66FA27E-80E0-4049-A24A-2B81F5F29055 CRC:973936563)
if ($.boundItem(xfa.event.newText) == "Yes" && this.resolveNode("PromptOff").rawValue == "0" && (this.resolveNode("Scrubs4meOrdering").rawValue == null || this.resolveNode("Scrubs4meOrdering").rawValue == "")) {  xfa.host.messageBox("Please enter your facility's entity code", "Code needed.", 3);
}
//-

 

This is the one that was copied and does not work:

 

CODE FROM COPIED DROP DOWN WITH OBJECTS RENAMED:

 

form1.#subform[1].DDSNH::change - (JavaScript, client)
if ($.boundItem(xfa.event.newText) == "Yes") {  this.resolveNode('Table1._SNHRow').addInstance(1);  if (xfa.host.version < 8) {  xfa.form.recalculate(1);  }  this.resolveNode("SNHOrdering").presence = "visible";
}
if ($.boundItem(xfa.event.newText) == "No") {  this.resolveNode("SNHOrdering").presence = "invisible";  this.resolveNode('Table1._SNHRow').removeInstance(0);  if (xfa.host.version < 8) {  xfa.form.recalculate(1);  }
}
if ($.boundItem(xfa.event.newText) == "Yes" && this.resolveNode("PromptOff").rawValue == "0" && (this.resolveNode("SNHOrdering").rawValue == null || this.resolveNode("SNHOrdering").rawValue == "")) {  xfa.host.messageBox("Please enter your facility's entity code", "Code needed.", 3);
}

Re: Copy and Pasting Working Dropdown that hides/shows other fields does not work, even when everything is renamed.

$
0
0

The code is ok, but may not work because the resolveNode() method doesn't find the named objects. Without knowing the entire structure it's not possible to answer that for sure. Open your form in Acrobat, press [Ctrl]+[J] to open the JavaScript console: Then change the dropdown list value and look for any errors in den console window.

 

Note: When you use this.resolveNode() the method only looks for objects in the same branch of the XML-tree as the script executing object resides. When you use xfa.resolveNode() instead, the search starts always at the root node of the XML-tree.

 

Alternatively try this script:

var cSelection = this.rawValue,    oRow = xfa.resolveNode("form1..Table1._SNHRow"),    oField1 = xfa.resolveNode("form1..PromptOff"),    oField2 = xfa.resolveNode("form1..SNHOrdering");

oRow.setInstances(cSelection === "Yes" ? 1 : 0);
oField2.presence = cSelection === "Yes" ? "visible" : "hidden";

if (cSelection === "Yes" && oField1.rawValue === "0" && oField2.isNull) {
xfa.host.messageBox("Please enter your facility's entity code", "Code needed.", 3, 0);
}

Re: Required field is visible but the parent object is hidden, how to get around this situation?

$
0
0

Hi Tarek,

 

I did a form that had a repeatable collapsible block (Site locations in my case),  so when an error was detected I had to make the site visible before navigating to the field.  The errors were in a listbox and the click code, would check for the field being visible, if not it would work up the structure looking for a script object with a makeVisible function in it.  Is that like your situation?

 

          var targetObject = xfa.resolveNode(targetSOM.value);                       // Use the xfa.layout.page method to determine if the field is hidden as it maybe a parent subform           // that has the presence set to "hidden".                      var pageNumber = 0;           if (targetObject !== null)           {                                if (targetObject.className === "exclGroup")                {                     // xfa.layout.page does not work with an exclGroup object                     pageNumber = xfa.layout.page(targetObject.resolveNode("#field"));                }                else                {                     pageNumber = xfa.layout.page(targetObject);                }                if (pageNumber === 0)                {                     for (var formObject = targetObject; formObject.parent !== null; formObject = formObject.parent)                     {                          var scriptObject = formObject.resolveNode("#variables.script");                          if (scriptObject !== null && scriptObject.hasOwnProperty("makeVisible"))                          {                                 scriptObject.makeVisible();                               break;                          }                     }                }                xfa.host.currentPage = pageNumber - 1; // This stops the exit event firing on the target object                xfa.host.setFocus(targetObject);           }

 

I used the xfa.layout.page() method to work out if the object was visible and "for (var formObject = targetObject; formObject.parent !== null; formObject = formObject.parent)" works its way up the structure.  The makeVisible function would then call the click event on the expand/collapse button.

 

function makeVisible()
{      if (SiteHeader.Buttons.Expand.caption.value.text.value == "+")      {           SiteHeader.Buttons.Expand.execEvent("click");      }
 }

 

There are probably easier ways but this was a general solution which left the hide/show logic in the object that was hidden.

 

Regards

 

Bruce

Adobe livecycle script to print a Subform pages only

$
0
0

Plz guide me

 

I have a dynamic form (contains 3 subforms) and add a print button to print a subform only not other 2 subform.

Plz help me to script Print button.

Re: Copy and Pasting Working Dropdown that hides/shows other fields does not work, even when everything is renamed.

$
0
0

Thank you for your expertise. I was unable to get your code to work, but when using the original code and viewing the errors in Acrobat DC, i get this:

 

GeneralError: Operation failed.

XFAObject.addInstance:2:XFA:form1[0]:#subform[1]:DDSNH[0]:change

The element [max] has violated its allowable number of occurrences.

 

It seems that i has one thing misspelled and i changed the BINDING of the ROW to the RepeatingData with the MAX checked with a value of 1.

 

That fixed it.

 

Thank you for your help.  You saved all the bacon!

Looping through subforms to hide subforms containing an unchecked Checkbox

$
0
0

Hi all! I am stuck and would love a little help. I have a form with about 5 levels of subforms. I'm trying run a script with a button click that loops through each subform and hides any subforms that contain an unchecked Checkbox. Here is my hierarchy:

2018-10-22_66.png

So far, I've created a script object called "hide" that has this:

 

function ToggleRows(reset){

     var Rows = form1.page1.middle.ADDITIONS.EMR.Checkboxes.cb.all;

     var curRow;

     for (var i=0; i<Rows.length; i++){

          curRow = Rows.item(i);

          if (curRow.cb.rawValue == 1){

               curRow.presense = "hidden";}

          else{

               curRow.presense = "visible";}

     }

}

 

My button is in the "top" subform, and contains this text:

 

hide.ToggleRows(reset);

 

 

Any guidance on this would be greatly appreciated!

Characters shown in editor but not on print

$
0
0

Hi all,

i'm using Adobe Livecycle Designer ES V8.2.3 on a SAP system Enviroment.

I've encountered some rendering problems for characters from Armenian language.

 

 

When I copy/paste an Armenian text on the layout editor i can see them and they are correctly rendered.

When I generate the PDF the characters are replaced by '?' as the font used (Arial Unicode MS) does not support them.

I already verified that this font in correctly installed and up to date on our machine.

I tried to open other PDFs with those characters rendered on this font and they are shown with no issues.

I even tried others font (that support Armenian language) but the issue persist.

As result i'm not able to generate PDF that contains Armenian charachters even if I can see them in the layout editor.

 

 

I believe that there are some problems with the generation of the PDF.

 

 

Is there someone who got this or a similar problem?

 

 

Thanks in advance for your time

Lorenzo


Re: Using fragment to implement Drop-Down List Field with search / auto populate

$
0
0

There is another request to do something similar but to apply it on the "Address Field". We want to use something like Google Maps APIs to search as you type, and display the results in a popup. So, upon selection, we need to populate the various related address fields. I have implemented this in HTML5 with AngularJS.

 

I will suggest this approach again for Adobe LiveCycle PDF (JavaScript), in addition, will suggest using the Acrobat Popup Menu API "app.popUpMenu()".

 

Appreciate it if anyone knows if something similar has been implemented.

 

Tarek

Re: Looping through subforms to hide subforms containing an unchecked Checkbox

$
0
0

Hi,

Is this the problem? There is a typo in your code:

presense should be presence

Re: Looping through subforms to hide subforms containing an unchecked Checkbox

$
0
0

Oh good catch! Made that correction, but unfortunately no...still not working.

Re: Looping through subforms to hide subforms containing an unchecked Checkbox

$
0
0

Just some thoughts....

 

You could also try specifically naming your subforms rather than using the autonumbering when the same name is used. I found that the number in square brackets in an object name interfered with the reference to an instance which is also a number in square brackets.

Eg: instead of cb[1], have cb1 etc

 

Using resolveNode has also fixed some issues i have had as well with subforms.

Re: Adobe livecycle script to print a Subform pages only

$
0
0

Hi,

 

In the two subforms that you don't want printed, add the JavaScript code to the prePrint event;

 

this.presence = "hidden"

 

Then in the postPrint event for the same two subforms add the code;

 

this.presence = "visible"

Viewing all 15211 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>