since ‎06-01-2006
‎16-04-2021
radzmar
MVP
Betreff: Hidden and Visible on Add Instance Object
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
You're addressing the fields the wrong way. I' guessing that the subform "wrap" is the one, that contains the textfield and is going to be repeated, right?The loop than should look this way: var cSel = this.rawValue, oFields = xfa.resolveNodes("form1.P1.wrap[*].textfield2"), // wrap[*] means every instance of the subfom wrap. i; for (i = 0; i < oFields.length; i += 1) { oFields.item(i).presence = cSel == "1" ? "visible" : "hidden"; }

Views

489

Like

1

Replies

1
Betreff: absolut som expressions not working
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
If you're using individual name for each subform and field within the forms hierachry, there is no need to use the resolveNode() method, because you can address the nodes directly. The script editor pays attention of this and automatically decides, if it is need or not.

Views

841

Likes

0

Replies

1
Betreff: absolut som expressions not working
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
Do you face any problem with the SOM expression you get? Since the resolveNode() method is quite slow under circumstances it's the best to use the possibly shortest relative SOM expression. xfa.resolveNode() is quite the oppsite, since it start's at the very first note within the XFA tree to find the desired node. I suggest to avoid the usage of resolveNode() or resolveNodes() it possible. https://blogs.adobe.com/formfeed/2008/12/object_expressions_in_xfa.html

Views

823

Likes

0

Replies

1
Betreff: Live Cycle Designer edit caption
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
From my experience this possibly happend when the spell checking was active. Try to turn it off under [Tools] > [Options] > [Spelling].https://help.adobe.com/en_US/livecycle/11.0/DesignerHelp/WS107c29ade9134a2c562f8a7112a2a888e22-8000.2.html

Views

702

Likes

0

Replies

0
Betreff: For loop with multiple variables and math calcul...
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
I think you should change the formula the following way, to get the right results. var Fields = xfa.resolveNodes("CommRtng[*]"), Answered = 0, Values = 0, Rating = 0, i; for (i = 0; i < Fields.length; i += 1){ if (parseInt(Fields.item(i).rawValue, 10) > 0) { Answered += 1; Values += parseInt(Fields.item(i).rawValue, 10); } } Rating = 100 / (Answered * 5) * Values this.rawValue = Rating; To fire this calculation just once, put the script into a click event of a button so it's executed only when t...

Views

1.2K

Like

1

Replies

0
Betreff: Get the number of logical pages a subform spans
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
I think the problem is you're referencing th first instance of the subform and so getting always the number of pages it spans.Given your subform is named "customer" than the code xfa.layout.pageSpan(customer) really means xfa.layout.pageSpan(customer[0]) which is the first instance. For repeated objects you'll need to address the desired instance. This can be done either direct or relative. For the direct way you'll have to know the SOM expression of the addressed object in question. This means ...

Views

1.6K

Likes

0

Replies

0
Betreff: Get current master page number in formcalc/Javas...
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
Hi, so I guess you're trying to get the n-th instance of a master page used as background of a specific form page? In that case you'll need a combination of several scripting methods to find out. Given you have a field somewhere in the form, to display the current index the script looks this way: this.rawValue = xfa.layout.pageContent( xfa.layout.absPage(this).toString(), "pageArea", true).item(0).index + 1; How it works:Determine the 0-based-page number of the field with xfa.layout.absPage(this...

Views

3.0K

Likes

2

Replies

1
Betreff: Table inside table must grow together
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
Hi, you can use a script to "synchronize" the heights of the inner and outer table. Aussumed you have the following hierarchy. Put this script into the layout:ready event of the row "NestedRow" of the nested table.var cUnit = "mm", nRefH = xfa.layout.h(Table.Row, cUnit), nThisH = xfa.layout.h(this, cUnit); NestedCell1.minH = nRefH > nThisH === true ? nRefH.toString().concat(cUnit) : "5mm"; // replace 5mm with a minimum height of your choice. xfa.layout.relayout(); The script will compare the hei...

Views

2.9K

Likes

0

Replies

1
Betreff: Can i add Input Text Field into a Checkbox Caption
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
Captions aren't editable that way. But, there's a solution by John Brickman that works for static texts you can use.https://blogs.adobe.com/formfeed/2010/09/editable-floating-fields-v3.html Just put your checkbox into a subform that flows left to right, set it to be without a one caption and place a text next to it using the solution above.

Views

2.3K

Likes

0

Replies

0
Betreff: For loop with multiple variables and math calcul...
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
Hi, your current script has some issues, so it could not work. Let me explain: var Fields = xfa.resolveNodes("Page2.Comm_Sub.CommRtng[*]"); var Answered = 0; var Values = 0; var Rating = (Values / (Answered*5)) * 100 // When executed here, it's just 0 and doesn't get updated later. // var i is not declared // i cannot be equal to Fields length because the nodelist created with resolveNodes() uses 0-based indexes, so i <= Fields.length creates an out-of-bounds-error. for (i=0; i<= Fields.length; ...

Views

3.0K

Like

1

Replies

2
Betreff: Field Forms blink/flash in LiveCycle
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
This is propably an effect of one or more scripts executing over and over again. It's often because of using loops in the layout ready event or forcing to relayout the form for no reason. You should check it the existings scripts and think of a way they don not execute unneccessary often.

Views

2.1K

Likes

0

Replies

0
Betreff: TextField half border - Adobe LiveCycle
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
It's not possible with just one text field but with two overlayed, you can create a similar thing. Account Number Paste this XML code into the XML source of your form right below a -element. It adds two fields, that will look this way.

Views

3.2K

Likes

0

Replies

0
Betreff: Conditional Page Break after Subform
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
Change the scriping language to JavaScript.

Views

3.4K

Likes

0

Replies

3
Betreff: Unable to hide subform in table cell dynamically
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
Well, you can simply use this JavaScript in the calculate event of SpouseSF. this.presence = Textfield1.rawValue == "X" ? "visible" : "hidden";

Views

4.6K

Likes

0

Replies

1
Betreff: Unable to hide subform in table cell dynamically
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
So, you want to hide subform "SpouseSF" if the field "Textfield1" is empty? I have a couple of questions about that: 1. Where does the data come from for "Textfield1"? 2. What's the loop for?

Views

6.0K

Likes

0

Replies

2
Betreff: Unable to hide subform in table cell dynamically
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
Well, I can't say what's wrong, without knowing the hierachy of you form. But I can already see some problems in your script. 1. DON'T name variables or form objects (subforms, fields …) after scripting properties or default form elements! That's a no go and can cause very strange effects! So you better use other names than "data" or "length".2. This script will either return 0 or 1. It depends on, if the an element DATA below GT_TABLE below the fourth subform below the third subform below the f...

Views

4.7K

Likes

0

Replies

1
Betreff: date field auto fill text boxes
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
Hi, with FormCalc you can easily calculate dates.In the exit event of you date field, add a script like this if ($.isNull eq 0) then var nDate = Date2Num($.formattedValue, "MM/DD/YYYY") Mon = Num2Date(nDate - 6, "EEE D") Tue = Num2Date(nDate - 5, "EEE D") Wed = Num2Date(nDate - 4, "EEE D") ; and so on ... endif

Views

3.6K

Like

1

Replies

0
Betreff: Script help
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
It's not posible.

Views

3.4K

Likes

0

Replies

0
Betreff: Need a Date Time Field to be locked upon 1st tim...
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
Don't use the Action Build if possible. It creates very complex scripts, that are hard to read. Just add the following JavaScript with the script editor. if (this.isNull) { this.rawValue = util.printd("yyyymmddHHMMss", new Date()); }

Views

4.6K

Likes

0

Replies

1
Betreff: Problem with Data Flow within a form
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
If you change values of a field via scriptings it will not execute specific events like enter, click, exit or change. If a script resides in one of those events, you'll need to trigger it programically too. // Code to execute the exit event of Textfield1. Textfield1.execEvent("exit");

Views

3.3K

Likes

0

Replies

0
Betreff: Need a Date Time Field to be locked upon 1st tim...
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
To execute a script just once use an if expression. Here's an example.// Only if the field is blank, execute the following script! if (this.isNull) { // Put the script to be executed here! } The e-mail can be populated with values from form fields. I made a small macro, that helps you to create such script easily.Here you go: https://thelivecycle.blogspot.com/2012/05/mailto-maker-marco-v1.html

Views

4.7K

Likes

0

Replies

1
Betreff: ***HELP*** Need Script that populates descriptiv...
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
Hi, you can realize this with an array of nested arrays and two javascript functions. One is to populate the selectable values in the dropdown list the other to populated the description ond price depending on the selection. First, you need to add a script object to your form. Name it "formFunctions" or whatever you like. In this script object you enter the array and the two functions. // Array with data var aItems = [ // Nested arrays with item number, description and price ["123", "Chair", "99...

Views

3.4K

Likes

0

Replies

0
Betreff: Auto calculate end date
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
Hi, the end date calculation isn't that trivial, since some months have more days than others, so simply adding a fixed amount of days won't work in some circumstances.Here's a FormCalc script that will do take care of this. if (HasValue(StartDate) eq 1) then var cPattern = "DD/MM/YYYY" var nDate = Date2Num(StartDate.formattedValue, cPattern) var nStartDate = nDate var nEndDate var nCountMonths = 18 var nUltimo var nPrevMonth var nNextMonth ; Get target month while (nCountMonths gt 0) do nPrevMo...

Views

3.6K

Likes

0

Replies

0
Betreff: scripting - cannot access textfield if its value...
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
You can add a check for null values, to make this work.var oField = xfa.resolveNode('page.table.row.TxtElement'); if (oField.isNull) { xfa.host.messageBox("The field is empty"); } else { xfa.host.messageBox(oField.rawValue); }

Views

3.5K

Like

1

Replies

0
Re: Conditional Page Break after Subform
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
Ok, given you subforms are childs of a body page or subform named "Page", you can add this JavaScript into the contidional break dialog of subform2. // If this subform is not the first visible under "Page", create a page break. Page.resolveNodes('#subform.[$.presence eq "visible"]').item(0).name !== this.name Hope this helps!

Views

5.4K

Likes

2

Replies

2
Betreff: How to hide dynamic table row based on cell2 data
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
Make sure you've selected JavaScript not FormCalc as language.

Views

7.2K

Likes

0

Replies

0
Betreff: Dynamic Table - How do I add a row above current...
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
Hi, that's quite simple: var i = this.parent.parent.index, j; PartB._Row1.addInstance(true); // add new row j = PartB._Row1.count - 1; // get index of last row. It's the one that was just added. PartB._Row1.moveInstance(j, i); // move it above the current row

Views

3.6K

Likes

2

Replies

0
Betreff: How to hide dynamic table row based on cell2 data
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
If you put the following code into the calculate event of rwStatementEntry, it should work. this.presence = Cell2.rawValue === "Old Statement" ? "hidden" : "visible";

Views

7.2K

Likes

0

Replies

4
Betreff: Adobe LiveCycle ES4 - How to embed Chinese/Asian...
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
It likely that this specific font has restrictions and don't allow to be embedded.https://www.adobe.com/lu_en/products/type/font-licensing/restricted-fonts.html

Views

3.3K

Likes

0

Replies

0
Betreff: Wrap text to next field without words getting cu...
Avatar

radzmar

MVP

radzmar
- Adobe LiveCycle
There's a nice solution for this screnario available.All details here: https://blogs.adobe.com/formfeed/2009/04/field_tab_on_full.html

Views

3.3K

Likes

0

Replies

0