Need a better way to reset selected cells in a table

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 of the cells in each row.
I am using the following snippet:
for (var nRow = 1; nRow < 21; nRow++)
for (var nCell = 0; nCell < 6; i++)
xfa.host.resetData("form1.page1.wrapper.ICC.Table1.Row[" + nRow + "].rate[" + nCell + "]");
This works but is extremely slow (on the order of 10 seconds) and my pc is no slouch.  There has to be a simpler (and faster!) way to do this.
I saw one thread where the cells that were to be spared from the reset could be listed but just could not make that work at all. I thought about putting the cells to be spared into a subform but that went nowhere, as I was only able to place individual cells into separate subforms.
Any suggestions will be welcome ... with formcalc script if possible:)
Thanks.
Harry Ohm.
edit: Now it appears it does not work as I first thought. It works on a single row but not when the nested for loops are used.
Message was edited by: HarryOhm

Hi Harry,
Just two small issues. I would wrap the first for loop in {} and then you have i++ in the second loop:
for (var nRow = 1; nRow < 21; nRow++)
     for (var nCell = 0; nCell < 6; nCell++)
          xfa.host.resetData("form1.page1.wrapper.ICC.Table1.Row[" + nRow + "].rate[" + nCell + "]");
It looks like your table is static (rows do not repeat). One option would be to build up a variable/string with the objects names and then reset that. This is a reset example from one of our forms (http://assure.ly/gBJYj9). Here it is resetting one row and two fields outside of the table:
// reset page 6 only
var f1 = Table1.Row1.description.somExpression + ", ";
var f2 = f1 + Table1.Row1.quantity.somExpression + ", ";
var f3 = f2 + Table1.Row1.unitPrice.somExpression + ", ";
var f4 = f3 + positionedSF.myName.somExpression + ", ";
var f5 = f4 + positionedSF.myAddress.somExpression;
xfa.host.resetData(f5);
Hope that helps,
Niall
Assure Dynamics

Similar Messages

  • How to get the position of a selected cell in a table ?

    Hi,
    How can I get the position of a selected cell in a table or in a list multicolumn cmd ?
    Thanks.

    Invoke node >>> point to Row Column
    Ben
    Message Edited by Ben on 07-19-2007 03:14 PM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Point_To_Row_Column.PNG ‏22 KB

  • Time difference issue - need a better way

    Hi
    I need to display the difference in time - every day for different time ranges,
    Example 1-2 pm, 4-5 pm, 7-8 pm. And I need the time difference in 2 dates in the past week for each of these ranges everyday.
    example
    Date Diff Range
    01/01/2007 00:01 1-2pm
    01/02/2007 00:03
    01/03/2007 00:10
    01/04/2007 00:05
    01/05/2007 00:23
    01/01/2007 00:10 4-5pm
    01/02/2007 00:13
    01/03/2007 00:11
    01/04/2007 00:15
    01/05/2007 00:23
    01/01/2007 01:10 7-8pm
    01/02/2007 00:13
    01/03/2007 00:10
    01/04/2007 00:11
    01/05/2007 00:21
    One way to achieve this is to have multiple unions for each day and each time range.
    Example:
    select
    from
    where dt_tm between
    to_date(to_char((sysdate-5),'mm/dd/yyyy')||' 13:00','mm/dd/yyyy hh24:mi:ss')and
    to_date(to_char((sysdate-5),'mm/dd/yyyy')||' 14:00','mm/dd/yyyy hh24:mi:ss')
    union
    select
    from
    where dt_tm between
    to_date(to_char((sysdate-5),'mm/dd/yyyy')||' 16:00','mm/dd/yyyy hh24:mi:ss')and
    to_date(to_char((sysdate-5),'mm/dd/yyyy')||' 17:00','mm/dd/yyyy hh24:mi:ss')
    union
    select
    from
    where dt_tm between
    to_date(to_char((sysdate-5),'mm/dd/yyyy')||' 19:00','mm/dd/yyyy hh24:mi:ss')and
    to_date(to_char((sysdate-5),'mm/dd/yyyy')||' 20:00','mm/dd/yyyy hh24:mi:ss')
    This will give me the required information for only one day - and that is for sysdate-5.
    I will have same nyumber of unions for each day.
    Is there a better way to accomplish the same?
    Any help appreciated.
    Thx!

    Time difference by date by time range - a better way?

  • How to get the position of a selected cell in a table without using the mouse event?

    Dear All,
        I have a question about table:After clicking the cell of a table, the cell is into the edit status. How to know the row number and column number of the cell, when I click a button?
       The link below is using the mouse down event:
       http://forums.ni.com/ni/board/message?board.id=170&message.id=260102&query.id=55917#M260102
       Is there any other way to do it? Having tried to using the "edit position"  property, but it seems not working well.
       Thanks for any suggestion.
    Hugo 
    Attachments:
    table.vi ‏17 KB

    It works well with the "edit position" property.
    See attached
    Attachments:
    table.vi ‏12 KB

  • I need a better way....

    I have created a package to grab data from separate production systems into a single oracle table.
    The oracle table contains all files processed in history (with a processed flag set to 1, initially set to 0)
    after the packages run to get all the data and place it into the Oracle table, i need to take all that data and push it into a text file so it can be SFTP to another location.
    My package is setup like this:
    1.Start Bell (This is just to let people know quickly where the start of the package is)
    2.Set TrueOrFalse Variable to False (This is incase there is nothing to process and it will exit one the packages are run if no data exists)
    3.Packages: Get Data 1, Get Data 2, Get Data 3, Get Data 4 (There are 4 packages that get all the data and push into my Oracle DB, usually this table has about 20,000+ records in it)
    4.Variable: "Are there any records" (This does a simple count(*) query to see if there are any records)
    5.Variable: "Still Have Records" (This evaluates step 4 for > 0)
    5a.(True) Set TrueOrFalse Variable to True (Yes we have at least 1 record) Goto Step 6
    5b.(False) Evaluate TrueOrFalse Variable. Goto Step 10
    6.Get first Row and format: id || ', ' || pnumber || ', ' || current_due || ', ' || total_due || CHR(13) || CHR(10)
    7.Push data from Step 6 into and OdiOutFile (text file)
    8.Update Oracle Table (set processed = '1')
    9.Goto Step 4
    10.Check TrueOrFalse Variable (If no records this will be False, if processed one record this will be True)
    10a.(True) Send File Via SFTP.
    10b.(False) Email Nothing to Check to programmer
    11 Finish Bell
    The first part, up to Step 4, runs smoothly and gets all my data into my Oracle Table (Called Matrix). I was told by someone previously that to process each record i need to look at each one individually and then push each one individually into the text file (OdiOutFile)...
    Is there a quicker way to have ODI take a query from the table, say something like:
    Select id || ', ' || pnumber || ', ' || current_due || ', ' || total_due || CHR(13) || CHR(10)
    From OracleTable
    Where processed = '0'
    and push that into the OdiOutFile? Or do i have to run it pulling each line individually?
    Hope this makes at least some sense...
    Tom Cusick

    Thanks this did the trick... actually i got an email from Cezar just before you posted this with the same answer... Thanks to both!!!

  • Need a better way than killing connections in SQL Azure - Governor

    I've been pushing the boundaries of  SQL azure (S0 and S1) recently. 
    I'm at a point where normal T-SQL code needs to be optimized for SQL azure, I was surprised that all Microsoft have done was enhance the governor process and kill the connection  rather than slow down the connection, guess this was the easy path to
    use. 
    Simple T-SQL statements like MERGE need to be rewritten to support large data (1 million rows).  Given you need to batch core T-SQL commands you need to answer yourself is this the correct approach.  Also had the same issue using SQL Bulk Copy
    but tweaked a few settings to get around that issue. 
    S0 & S1 still haven't got the same IO as Web/Business edition hence Microsoft need to fix this ASAP.
    Is SQL Azure worth that extra hassle compared with other DB engines?
    Micatio Software Free IIS Azure Web Log App

    Hi Jan,
    Its not the command timeout (for example set as 0 in SQL management studio). 
    I've seen it many times where the last wait type is the LOG GOVERNOR. 
    A few minutes later the status is set as KILLED/ROLLBACK.  I can get around the issue by batching the MERGE statement  and it works fine.  
    I would understand if the MERGE was running for 1-2 hours and I've seen the same thing occur when using a bulk insert command in C# (resolved by limiting the batch size, streaming, etc.).
    The azure version is Microsoft SQL Azure (RTM) - 11.0.9230.176.
    The log governor does kill connections, this is documented on a few sites and MSDN.  LOG GOVERNOR was a SQL Enterprise feature in the standalone product except Microsoft in there wisdom ported it across into SQL Azure to resolve users running bad queries
    on the infrastructure.
    Micatio Software Free IIS Azure Web Log App

  • To get selected cell info in table for WDA.

    i'm developping in netweaver2004s.
    a view has a table and a button.
    another view has input fields.
    i want to get cell info(selected field name not value)
    so i use that info in another view.
    i want to know same command 'GET CURSOR' in WDA.
    please let me know that method.

    Hi,
    You can specify the importing parameter ID as type string in the action handler of the button. It will contain the ID of the button.
    Best regards,
    Thomas

  • Selecting Cells in Different Tables

    I've created three tables on a Numbers 09 spreadsheet - let's call them tables "A", "B" and "C".
    I want to select a cell on Table A and another cell on Table B then Sum them in another cell on Table C.
    The problem is, I cannot figure out how to select the cells on tables A and B simultaneously so that I can drag the Sum function for them to a cell on table C.

    Marty,
    In the English mode, the range identifier is the colon, not the comma. So, to SUM cells A1, B1 and C1, one would write: =SUM(A1:C1).
    This may be what is tripping you up. The comma delimits multiple ranges, so if you wanted the sum of A1, B1, C1 including as well X1, Y1 and Z1, one would write: =SUM(A1:C1, X1:Z1). Of course, the comma can also be used to delimit single-cell ranges, as in: =SUM(A1, X2, Z3)
    Further, and more to the point of your original question; to select multiple arguments for the SUM function, one at a time from different tables, type =SUM() in the cell where the result goes, and place the cursor between the parentheses, then hold down the Command key while you click in any Table, any cell, for as many tables and cells as you like, and the references will all appear in your expression properly formatted.
    Hope this helps.
    Jerry
    Additional comment about Command Key

  • Is there a way to preserve interactivity within a table so that users of an iBook can enter new values in selected cells and have formulas recalculated with that input?

    I would like to include interactive tables that would recalculate using formulas I have written and values that the reader/user has entered into selected cells. The tables I've made in iBooks Author do contain formulas that work as expected...until exported to an iPad, then they look and act just like a static table. I am not looking for serious number crunching or high-end mathematics, although others might find great value in such capability.
    To work without a reader/user accidentally (or otherwise) altering formulas or formatting it would be necessary to lock some or most cells of the table. At present all cells are locked after export. Apple doesn't seem to envision or value the functionality of such a feature; it appears to me missing from Numbers as well.

    Should be near trivial to execute on with an app...
    As welll, I wouldn't be surprised if a dashcode widget would fit the bill.
    As always, feel free to use the 'Provide iBooks Author Feedback' menu item for features you'd like added in the future, etc.
    http://www.apple.com/feedback/ibooks-author.html

  • Can some one tell me a better way...

    Hi All..
    I work on a web application. I create user ids for people logging into my application. here I have a small problem.. This is what I am currently doing...
    When I create a new user, I assign a new user id to the user and store all hi info.
    All our user ids are stored in User_ID table and user info in User_Info table.
    First I get the max user id from the User_Id table.
    int iuserid = select max(User_ID) from User_ID;
    Then I add ' 1 ' to this and assign it to new user.
    iuserid = iuserid+1;
    insert into User_id values(iuserid, <ssn> );
    Then I store all user info in User_info table..
    insert into User_info(iuserid, <first_name>, <last_name>,...);
    Both these SQLs are executed as a transaction.
    The problem that I have...
    It works fine in a normal environment and in my testing.
    But when the load inceases, before I insert into the User_info, another user tries to get the max User_id from User_ID table, then it conflicts..
    I have seen occurences of User_Info storing the info of a different user against the User_id when many people are accessing the app at the same time.
    Can some one tell me a better way to handle this scenario..
    Appreciate all you help..
    TIA..
    CK

    Hi,
    assuming that the requirement for user_id is only for uniqueness (primary key requirement) not continuosly.
    perhaps can try this,
    1) create a table to keep the max id for each table's key.
    e.g.
    create table key_id_lookup
    key_name char(n),
    current_value number(m)
    where n & m is the size of the field
    2) for each creation of entry in the user_id table, lookup the value in the key_id_table and increment it after retrieval.
    e.g. current_id = select current_value from key_id_lookup where key_name = 'user_id_key';
    current_id+=1;
    update key_id_lookup set current_value = current_id where key_name = 'user_id_key';
    something similar to use of sequence if your database support it.
    3) continue with the creation of record in other tables. now obtain the time stamp of creation and append with the current_id obtained. e.g. timestamp = 132456872; size of m is 5, user_id = 132456872 x 100000 + current_id;
    this should give you a unique key at creation time.
    There should be other better ways of resolving this(like locking the table for the update operation but affect performance, etc), depending on the feature supported by the database in use.
    Hope this can help as last resort if other options not available.

  • Looking for a better way to utilize streams to track deletes in the db.

    I'm trying to figure out a way to track deletes in the database using streams. I found that a dml_hander for deletes could satisfy my needs but it appears I would need to create a dml_handler for each table in the schema. Since I have ~250 tables I'm thinking there has to be a better way to do this. I simply need a way to capture all deletes and insert them into a table before they are deleted from the db. Is there a better way then creating a handler for each table?
    Thanks,
    Doug

    So far you haven't posted a version number or any information about the use of any auditing tool, whether FGA or other auditing so it is impossible to either comment or advise you further.
    If you want help you are going to need to do something you did not do in your original post and that is provide a description of your environment, your business rules, how you have attempted to use FGA or standard auditing, etc. Streams is for replication not auditing so perhaps you mean AQ but so far you haven't said that yet either.
    The more information you can provide, and perhaps some code or clear descriptions of what you've attempted, the better the help possible.

  • Any way to protect table cells? Prevent table modification?

    I have Pages word processing document that contains a two-column label (it's a grading rubric, if you care). The left column labels the data. The right column contains numerical scores and a few cells that sum these up to create subtotals and a grand total.
    Problem: how to protect the cells that should never be edited, such as the four (in this case) which contain formulas?
    Additional problem: I have the left column set to "Return key moves to next cell." This works fine. But, if you accidently press the tab key, you end up creating another column. So, is there a way to protect the structure of the table?
    Thanks,
    James

    There is no way to protect some cells of a table.
    The only feature available is : lock the entire table.
    _Go to "Provide Pages Feedback" in the "Pages" menu_, describe what you wish.
    Then, cross your fingers, and wait _at least_ for iWork'11
    Yvan KOENIG (VALLAURIS, France) mercredi 28 avril 2010 07:44:05

  • Calc: How can I get absolute cell references in tables to work?

    Hi, I'm new to Star Office, and have run into a problem in my first spreadsheet.
    I have a data table in my spreadsheet.
    Some cells in the table need to make calculations based on other cells in the table.
    When I sort the table, however, the cell references are made to be incorrect. I expected that I could just use absolute references (e.g. $A$2) and when the table was sorted those references would be updated to refer to the new absolute location of that cell, e.g. $A$10). However, the absolute references are being left literally the same ($A$2) after the sort, making them reference a different row of data than intended. Relative references of course don't work in this situation either (I tried for thoroughness). (I thought Excel behaved the way I expected, but I just tried it in Excel 2007 and it is exhibiting the same behavior as StarOffice Calc.)
    I'm also concerned, although I haven't tried it yet, about what will happen when I reference cells in this table from another table using absolute references that the same problem will exist...
    So basically, I can't find a way to use absolute references to cells in a table that will persist correctly when the table is sorted. Any suggestions?
    Thanks. Asa
    Edited by: earthasa on Sep 20, 2007 2:37 AM
    I was able to work around the problem by creating an index column in the table with a unique number for each row of data and using vlookup() to reference the correct row. If there is a more elegant solution I'm still interested :)
    Edited by: earthasa on Sep 20, 2007 3:00 AM

    OK. Think I've got it now thanks to looking at the short keys and searching for "Full Screen".  The upper left key is "`" which looks like a grave - a slightly angled single quote. But when I look at the "Application" setting for Toggle full screen it is set to "'" - a "normal" single quote.  Sure enough, if I hit the normal single quote key the toggle works.
    I have not been anywhere near the hotkeys and can't imagine why anything would change it from a grave key to a single quote - especially as they look almost identical on the screen.  I'm guessing that Adobe changed this (maybe only for international users?)
    Anyway I now know how to toggle full screen, although it makes the "Premiere" keyboard with its big purple key for "Toggle full screen" redundant.  Does make me wonder what the shortcut key of "'" or CTRL + "'" gives that I'm presumably missing since it appears to have been remapped.

  • Need help to get alternate or better way to write query

    Hi,
    I am on Oracle 11.2
    DDL and sample data
    create table tab1 -- 1 millions rows at any given time
    id       number       not null,
    ref_cd   varchar2(64) not null,
    key      varchar2(44) not null,
    ctrl_flg varchar2(1),
    ins_date date
    create table tab2 -- close to 100 million rows
    id       number       not null,
    ref_cd   varchar2(64) not null,
    key      varchar2(44) not null,
    ctrl_flg varchar2(1),
    ins_date date,
    upd_date date
    insert into tab1 values (1,'ABCDEFG', 'XYZ','Y',sysdate);
    insert into tab1 values (2,'XYZABC', 'DEF','Y',sysdate);
    insert into tab1 values (3,'PORSTUVW', 'ABC','Y',sysdate);
    insert into tab2 values (1,'ABCDEFG', 'WYZ','Y',sysdate);
    insert into tab2 values (2,'tbVCCmphEbOEUWbxRKczvsgmzjhROXOwNkkdxWiPqDgPXtJhVl', 'ABLIOWNdj','Y',sysdate);
    insert into tab2 values (3,'tbBCFkphEbOEUWbxATczvsgmzjhRQWOwNkkdxWiPqDgPXtJhVl', 'MQLIOWNdj','Y',sysdate);I need to get all rows from tab1 that does not match tab2 and any row from tab1 that matches ref_cd in tab2 but key is different.
    Expected Query output
    'ABCDEFG',  'WYZ'
    'XYZABC',   'DEF'
    'PORSTUVW', 'ABC'Existing Query
    select
       ref_cd,
       key
    from
        select
            ref_cd,
            key
        from
            tab1, tab2
        where
            tab1.ref_cd = tab2.ref_cd and
            tab1.key    <> tab2.key
        union
        select
            ref_cd,
            key
        from
            tab1
        where
            not exists
               select 1
               from
                   tab2
               where
                   tab2.ref_cd = tab1.ref_cd
        );I am sure there will be an alternate way to write this query in better way. Appreciate if any of you gurus suggest alternative solution.
    Thanks in advance.

    Hi,
    user572194 wrote:
    ... DDL and sample data ...
    create table tab2 -- close to 100 million rows
    id       number       not null,
    ref_cd   varchar2(64) not null,
    key      varchar2(44) not null,
    ctrl_flg varchar2(1),
    ins_date date,
    upd_date date
    insert into tab2 values (1,'ABCDEFG', 'WYZ','Y',sysdate);
    insert into tab2 values (2,'tbVCCmphEbOEUWbxRKczvsgmzjhROXOwNkkdxWiPqDgPXtJhVl', 'ABLIOWNdj','Y',sysdate);
    insert into tab2 values (3,'tbBCFkphEbOEUWbxATczvsgmzjhRQWOwNkkdxWiPqDgPXtJhVl', 'MQLIOWNdj','Y',sysdate);
    Thanks for posting the CREATE TABLE and INSERT statments. Remember why you go to all that trouble: so the people whop want to help you can re-create the problem and test their ideas. When you post statemets that don't work, it's just a waste of time.
    None of the INSERT statements for tab2 work. Tab2 has 6 columns, but the INSERT statements only have 5 values.
    Please test your code before you post it.
    I need to get all rows from tab1 that does not match tab2 WHat does "match" mean in this case? Does it mean that tab1.ref_cd = tab2.ref_cd?
    and any row from tab1 that matches ref_cd in tab2 but key is different.
    Existing Query
    select
    ref_cd,
    key
    from
    select
    ref_cd,
    key
    from
    tab1, tab2
    where
    tab1.ref_cd = tab2.ref_cd and
    tab1.key    <> tab2.key
    union
    select
    ref_cd,
    key
    from
    tab1
    where
    not exists
    select 1
    from
    tab2
    where
    tab2.ref_cd = tab1.ref_cd
    Does that really work? In the first branch of the UNION, you're referencing a column called key, but both tables involved have columns called key. I would expect that to cause an error.
    Please test your code before you post it.
    Right before UNION, did you mean
    tab1.key    != tab2.key? As you may have noticed, this site doesn't like to display the &lt;&gt; inequality operator. Always use the other (equivalent) inequality operator, !=, when posting here.
    I am sure there will be an alternate way to write this query in better way. Appreciate if any of you gurus suggest alternative solution.Avoid UNION; it can be very inefficient.
    Maybe you want something like this:
    SELECT       tab1.ref_cd
    ,       tab1.key
    FROM           tab1
    LEFT OUTER JOIN  tab2  ON  tab2.ref_cd     = tab1.ref_cd
    WHERE       tab2.ref_cd  IS NULL
    OR       tab2.key     != tab1.key
    ;

  • A better way to generate the needed XML?

    I am working on a 10.2 system and looking to see if there is a better way to generate the resulting XML than what I have come up with. Here is a test case and the output it generates. I don't really like querying the table for each column needed as the real table has eight columns I am pulling. I would like to make one pass on person_h and get the info needed instead of making eight passes, but not sure if it is possible.
    with person_h as
       (select 1 id, 'M' gender, 'W' race, '170' weight from dual union all
        select 1, 'M', 'W', '170' from dual union all
        select 1, 'M', 'W', '180' from dual union all
        select 1, 'M', NULL, '175' from dual union all
        select 1, NULL, 'W', NULL from dual
    select xmlelement("Person",
             (select xmlagg(xmlelement("Sex", gender))
                from (select distinct gender
                        from person_h
                       where id = 1
                         and gender is not null) pg),
             (select xmlagg(xmlforest(race as "Race"))
                from (select distinct race
                        from person_h
                       where id = 1) pg),
             (select xmlagg(xmlforest(weight as "Weight"))
                from (select distinct weight
                        from person_h
                       where id = 1) pg)
           ).getstringval()
      from dual;
    Output
    <Person>
      <Sex>M</Sex>
      <Race>W</Race>
      <Weight>170</Weight>
      <Weight>175</Weight>
      <Weight>180</Weight>
    </Person>Note: Previously posted on the XML DB forum at A better way to generate the needed XML? but still looking for other solutions so putting in front of more eyes here. I have considered using a WITH statement to do the initial query on person_h but haven't tested that yet to see what Oracle really will do as just getting back around to this lower priority task of mine.

    I'm using the WITH statement to simulate a table and DUAL/UNION ALL to create data in that "table". I've seen it used plenty of times in this forum so not sure why a problem for this example. The actual SQL/XML statement hits that "base table" three times, so I didn't include all eight columns because three columns is sufficient to show the problem in the way I coded the SQL. Following the SQL is the sample OUTPUT that SQL statement generates and that is the output I created and need. I'm just looking for other options to achieve the listed output.

Maybe you are looking for