Sitemap

Amicuk Programming Answers

Using a reset button for a dynamic table

-0001-11-30   Views:1

Advertisement

I have a 6 page form that includes several dynamic tables. There is a reset button that clears only specific parts of the form because it is something that will be filled out weekly and a lot of the information will stay the same. My problem is that

I have a 6 page form that includes several dynamic tables. There is a reset button that clears only specific parts of the form because it is something that will be filled out weekly and a lot of the information will stay the same. My problem is that I want the reset button to clear specific rows of the table, but reset whatever is typed in the row for every instance in the table. The reset button only clears the row I want in the first column, not all the other columns/instances. Has anyone done this before or have any suggestions?
I don't want to include the whole script for the reset button because it has about 100 fields to clear but essentially this is what I have for the dynamic table and it works but only for the first column/instance, the rest stay the same:
xfa.host.resetData("form1.Page1.Subform1.Table1.Row5.Textbox1.somExpression");

The replay answer
Advertisement
Hi,
I’m not sure I understand your exact scenario but I use a function in a script object that I pass in a subform (possibly the top subform to reset the whole form) and the function resets all fields within it. 
function resetData(node)
    if (node.className === "field")
        var enableResetData = node.desc.nodes.namedItem("enableResetData");
        if (enableResetData === null || enableResetData.value === true)
            // reset all fields except those with enableResetData set to false
            node.rawValue = null;
    else
        for (var i = 0; i < node.nodes.length; i++)
            var currentNode = node.nodes.item(i);
            if (currentNode.isContainer)
                // ignore some form objects
                if (currentNode.className !== "draw" &&
                    currentNode.className !== "variables")
                    resetData(currentNode);
If there are any fields that I don’t want reset I put the following code in the initialise event of those fields.  Depending on the number of fields involved you might what to reverse this logic.  (you could also add the desc.enableResetData element in the XML Source view)
var enableResetData = this.desc.nodes.namedItem("enableResetData");
if (enableResetData == null)
    enableResetData = xfa.form.createNode("boolean", "enableResetData");
    this.desc.nodes.append(enableResetData);
enableResetData.value = true;
This works by storing a value “enableResetData” in the desc element of the field, allowing a generic function to have specific behaviour for particular fields.
Hope this helps.
Bruce

Go to See the other 4 answers

Using a reset button for a dynamic table

Category:DefaultRelease time:-0001-11-30Views:130

I have a 6 page form that includes several dynamic tables. There is a reset button that clears only specific parts of the form because it is something that will be filled out weekly and a lot of the information will stay the same. My problem is that[More]

Resetting Dynamic tables

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I have a form which is set to flowed and has multiple dynamic tables, rows can be added as required by the user. I need a reset button which not only clears all the data, but also resets all the tables (removes any rows that have been added). Is[More]

Page Number Disappesrs when click on Reset button in Dynamic Form

Category:DefaultRelease time:2015-10-11Views:130

Dear all, In dynamic forms I have taken Page n of m field outside the content area in master pages.I have added the reset button in body pages of the form.In the pdf When I click on Reset button the page nos are disappearing along with the other data[More]

Dynamic table with radio buttons

Category:DefaultRelease time:-0001-11-30Views:130

I need to load a dynamic table with radio buttons that allow the user to select an item in the table. I need to have it add a radio button with a unique identifier for each table item. For example: the table will load all of the seminars locations av[More]

Why dynamic table creation with struts working only for JDK1.3.1_02 version

Category:DefaultRelease time:2015-10-11Views:130

Row import java.util.Vector; public class Row private static int colsize; private Column[] columns; public void setColumns(Column[] columns) System.out.println("SetColumns"); this.columns = columns; public void setColumn(int i, Column column)   [More]

Livecycle userform with dynamic table

Category:DefaultRelease time:2015-10-11Views:130

Hi Everyone, New to Livecycle Designer and was hoping this is possible - Can you have a PDF userform with a dynamic table below it?... Basically the user fills out a userform then clicks an ADD button - this populates a dynamic table below the userfo[More]

Sum of Values from previous rows in a dynamic table

Category:DefaultRelease time:2015-10-11Views:130

Hello, I have a dynamic table has multiple rows (added dynamically via a button).  One column in the table is a Quantity column.  Another is a Total column.  We do not want to keep a running total, but only wish to display a total when the rest of th[More]

How to create dynamic View Object and Dynamic Table

Category:DefaultRelease time:2015-10-11Views:130

Dear ll I want to create a dynamic view object and display the output in a dynamic table on the page. I am using Jdeveloper 12c "Studio Edition Version 12.1.2.0.0" This what I did: 1- I created a read only view object with this query "Selec[More]

Need a better way to reset selected cells in a table

Category:DefaultRelease time:2015-10-11Views:130

Hello all, I have been looking at the various threads discussing resetting only selected fields in a form and leaving others unchanged. The form I am working on has a table of 20 body rows with 8 columns. I want to have a reset button that resets 6 o[More]

Error while creating dynamic Table

Category:DefaultRelease time:2015-10-11Views:130

Hi All, I have a node 'SEG' with 3 attributes, ATTR1.2.3, I am tring to crate dynamic table using this context node. Initialy i am displaying view with button, when click on this button i want to create table dynamically.. if click again one more tab[More]

How to populate a dynamic table according to the choice of the viewer

Category:DefaultRelease time:2015-10-11Views:130

Hi there, I ran into a dead-end on my  "Events" page. There is a dynamic table getting the info from a database. It will initially show the Upcoming Events. At this point my question is this: *Can I populate the dynamic table based on a conditio[More]

Hot
Contacted apple support and not in any hurry to resolve this I am not happy at allAren't you supposed to finish that stement with... Yeah thats the ticket.Read other 2 answers [More]
I have attached a USB HDD to my Airport Extreme Base Station. The drive is divided into 4 partitions, which I did with the HDD connected directly to a MBP before plugging into the AEBS. All the Macs on the network seem to be able to read and write in [More]
When the GR/IR accounting document is created in our system for a PO item that is account assigned to an order, network or cost centre, the following occurs. On the Goods Receipt, the GR/IR account does not capture the cost assignment on the GR/IR po [More]
Hi experts, I need to send by receiver mail adapter an unbounded amount of mails. Also, I need to use the Mail Package to implement dynamic mail address. I'm actually using the xsd posted in note 748024, but it sends only one mail per call. Thanks in [More]
Dear All                Am using SAP B1 2005 pl 40                         I have approval stage for Purchase order like Stage Name:                       Purchase order No. of Approvals Required:    1 User A B C Here any one Authorizer can approve a [More]
We have a requirement to send RSS feeds when ever there is a error message placed in the error queeu. Any inputs on this will be very much useful.> Hi,  The RSS feeds for the forums are great.  Any > chance of having the same thing for the developer [More]
hi i need some help, i have to search for three words in a list then if this list contains these three words it would do something, could anyone help me just to try and start this.public void checkWord() {          String word1="1stWord";        [More]
Have updated TB to 31.4.0 twice now on Windows 8.1 with the same result, after receiving notification that an update was available. It caused TB to not display any e-mails on any accounts. All settings, address book, account settings etc. etc. seem t [More]
I lost the power adapter for my WRT54GX2 router, during a recent move.When I search on line, I see 12V adapters w/ amps ranging fm 0.5 to 2.0.What do I need? TIA,SM0614It should say on a sticker on the router. Match the volts exactly but the amps can [More]
Hi there, I have had a AppleTV 2 720 for two years. It has been working perfectly with Netflix. I have a new AppleTV 1080 and the streaming from Netflix is awful. The picture drops definition and the audio goes out of sync and sometimes it just comes [More]