Sum of the field of af: table

I have an af:table that when the click on add new button line is set

Here I have a column called quantity

I am entering data in each row of the total field

Now, I have a field outside af: table which is the Total amount... I need to enter the amount in the amount field in the Total amount field outside the af: table

How can we achieve this

Hello

If your table is based on a view object, then you can use a transitional attribute and its value, use an expression groovy.

the new attribute must have:
value type: "expression".
"value: object.getRowSet (.sum ('AmountAttribute')).

Drag the new attribute from sources of data to your page and add partialTriggers of the components that affect it
(Insert/remove buttons and the table field that it summarizes).

Gabriel.

Tags: Java

Similar Questions

  • trigger for update field in a table with the sum of the fields to another table

    My experience in creation of triggers and pl/sql in general can be described in terms of oracle with the null value. I practiced by creating arrays and applications on my personal server at home to help me with some of my work related tasks. Right now I am creating a trigger which will, after insert, update, delete on the update of the table assignment_time_track the area of the time_spent on the table of assignments with the sum of the time_spent on the assignment_time_track table fields. I hope that run on the sentence it is clear to the people other than me. I tried this script on my own using the tool of creation of trigger for Oracle Database Express Edition, but I get the following error:

    Create a trigger failed, for the following reason:
    ORA-06552: PL/SQL: ORA-06553 finished Compilation unit analysis: PLS-320: the declaration of the type of the expression is incomplete or incorrect

    Here is my attempt to create the trigger on my own.

    create or replace trigger "ASSIGNMENT_TIME_TRACK_T1".
    AFTER
    INSERT or update or delete on 'ASSIGNMENT_TIME_TRACK '.
    for each line
    Start
    update assignments
    Set time_spent = (select sum (time_spent)
    of assignment_time_track
    where assignment_time_track.name = assignments.name);

    end;
    /


    If what I posted is not clear or more detail is needed, let me know and I will respond with a full description of tables and my goals for each table. Thanks in advance for any help. I also gladly accepts links to tutorials or lessons that explain how to do this kind of thing.

    Published by: bobonthenet on March 9, 2009 14:01

    I think I understand what you mean :)

    Rather than use a trigger to keep the master table (assignments) in sync with the time spent on the details, it would be much easier to use a query to do this, maybe creating a view.

    Something along the lines of

    SQL> create table assignments
      2  (id number primary key
      3  ,name varchar2(10)
      4  );
    
    Table created.
    
    SQL>
    SQL> create table assignment_time_tbl
      2  (id number primary key
      3  ,assid number references assignments
      4  ,time_spent number
      5  );
    
    Table created.
    
    SQL>
    SQL> insert into assignments
      2  select rownum
      3       , 'a'
      4    from all_objects
      5   where rownum < 5
      6  /
    
    4 rows created.
    
    SQL>
    SQL> insert into assignment_time_tbl
      2  select rownum
      3       , rownum
      4       , rownum * 3
      5    from all_objects
      6   where rownum < 5
      7  /
    
    4 rows created.
    
    SQL>
    SQL> commit;
    
    Commit complete.
    
    SQL>
    SQL>
    SQL> select a.id
      2       , a.name
      3       , (select sum (time_spent)
      4            from assignment_time_tbl
      5           where assid = a.id
      6         )
      7    from assignments a
      8  /
    
            ID NAME       (SELECTSUM(TIME_SPENT)FROMASSIGNMENT_TIME_TBLWHEREASSID=A.ID)
    ---------- ---------- -------------------------------------------------------------
             1 a                                                                      3
             2 a                                                                      6
             3 a                                                                      9
             4 a                                                                     12
    
  • How to calculate the sum of the fields to fill?

    Hello!

    My question is how can I calculate the sum of filled areas?

    For example, in a PDF document, I have a few fields that must be filled out with name and surname and the end of the document, another field that is the sum of the fields "FullName" which shows how many people is in this document. The operation should not take into account white/empty areas.

    Now, I know that I could do with the simple calculation "(+) sum" but I have to put a '1' for each of this area and I would like to avoid this.

    Yes, it's the first option I described. In this case, you can use this code:

    var total = 0;
    for (var i=1; i<=79; i++) {
        if (this.getField("Nume si prenume "+i).valueAsString!="") total++;
    }
    event.value = total;
    
  • How to set the alignment of the field in a table in jdev 11.1.2.3?

    Hello
    How to set the alignment of the field in a table in jdev 11.1.2.3?
    for example: to display a body of numbers in a table as right aligned.
    I tried to put field (amount) VO UI Hint Format Type: Number; Format: 0000.00
    and jspx, flowing, but it doesnot work.
    Thank you.
    Bao

    < af:column sortProperty = "#{bindings." VO1.hints.amount.name}.
    sortable = "true".
    headerText = "#{bindings." VO1.hints.amount.label}.
    ID = "c44" width = "60".
    Align = "center" >
    < af:inputText value = "#{row.bindings.Amount.inputValue} '"
    label = "#{bindings." VO1.hints.amount.label}.
    required = "#{bindings." VO1.hints.amount.mandatory}.
    columns = "#{bindings." VO1.hints.amount.DisplayWidth}.
    maximumLength = "#{bindings." VO1.hints.amount.precision}.
    shortDesc = "#{bindings." VO1.hints.amount.ToolTip}.
    ID = "it58.
    secret = "false".
    inlineStyle = "" text-decoration: overline; ">"
    < f: validator binding="#{row.bindings.Amount.validator}"/ >
    < / af:inputText >
    < / af:column >

    Hello
    To set a field right alignment in a table:
    It doesnot work when InlineStyle-> text-align: right;
    It works when ContentStyle-> text-align: right;

  • Sum of the field amount to rowlevel must go to another area

    1. I have a box at the end of my form... when the box is checked, I need my submit button to be activated?



    2. I have an af table in which then the click on add another line... I add a new line

    In each line, I entered amount...

    I want the sum of the amount to be displayed in the field outside the af: table which is the total amount, how can we do this

    It is advisable to mention your technology environment and your version of jdev!

    1)
    Where do you keep the value of the checkbox? in a bean or binding?
    Suppose you have ean ab which has a Boolean attribute

    boolean enableSubmit = false;
    public boolean isEnabelSubmit() {
    return enableSubmit;
    }
    
    public void setEnableSubmit(boolean b){
    enableSubmit = b;
    }
    

    Inside your pageLe box

    ...
    
    ...
    
    

    should do the trick.

    2)
    It depends on your data and when you need to know the sum. The easiest way is to let the db, make the calculation and just to show the result.

    Timo

  • Best way to apply the Format mask for the fields in a Table of the ADF

    Hi all

    12.1.3 JDev

    I would like to introduce the price data, quantity etc. fields of the ADF Table of the user interface in a specific format.

    These formats need to be dynamic, because they change according to the locale selected and sometimes they differ in the same locale.

    I tried approach converter custom but not satisfied because it is called several times when it is used in a table of the ADF and when asked that told me that this is the behavior.

    Custom converter of an attribute in a table called several times

    So, please suggest a better way to apply the format mask (which has min & max fractions, grouping, rounding) to the fields in the Table of the ADF.

    Please let me know if you need more information.

    Thank you

    B S Bilodeau.

    The second question, which I've mentioned here is the converter is called several times for each click on the table.

    This isn't a problem, this is the expected behavior (and you can't avoid it).

    Dario

  • How to make the field as a table display only?

    A form on a table, I can do the display as field: "view only".

    In a tabular presentation, it doesn't seem to be the option "View only" view. In tabular form attributes, I set a default value, and I have no users to edit this field. So, how can we make the field only do "display"?

    V4.1

    You can change the definition of the column and change the Display as in "Display text (saved state)" attribute whose value will be the column will be saved with the other columns and the default way.

    Thank you
    -Jorge

  • Asterisk for the fields in a Table bean

    Hi all

    We put some fields in a table that is advanced and the required attribute is 'yes '. But still it is not the asterisk marks on the ground and therefore difficult for our users to distinguish a required field of those non-mandatory. For all other fields that are outside of a bean from the table, if the required attribute is set to yes, then the asterisk appears.

    Is this a limitation of the OPS? or any other justification behind it?

    In the hope of a quick and accurate response to it :-)

    Thank you
    Amit

    Hello Amit,

    For the column you want to make it mandatory, Create ColumnHeader--> sortableHeader on the particular column and set its property indicator required Yes, no, uiOnly or validatorOnly_ according to your requirement.

    Kind regards
    Swati

  • The default value based on the field from another table to a custom object

    I'm trying to set the default value to a field in the custom object to the value of a field of account. I tried the syntax 50 ways different and just don't get the case. The label for the account field displays the form of s/n, the integration of the tag is ltDBA_ACCT and it appears in the fx reports area as Account.Text_22.

    The field of custom object that I am triying update is also called s/n, which was originally the required field 'NAME '. The name of the table, account, should it be included? Do I need a function to the field?

    I've updated the external ID using the line with syntex < ID > ID (at least higher ID) so I know that it is possible to define a default value, but s / < n >, < ltDBA_ACCT >, 'account '. "" S/n "and so on are simply not working.

    If anyone knows how to get into what I would be really grateful for the help.

    OK, so if you default a field to the value of another object, you must use the JoinFieldValue function. I think you understand that, based on your original post, but I want to be sure you do.

    Then this won't work by default if the folder is created from the object that you want to join the because a default works in record creation and the ID must be available so that it works correctly. It will not work if you choose the record of the related object after that registration of the custom object is created. You can set the default after, but that does not meet your requirements.

    The syntax of the default are the following: JoinFieldValue (ref_record_type, foreign_key, field_name).

    In your case, ref_record_type is '', foreign_key is [] and field_name is ''. The best way is to determine what is the name of the field to create a new workflow for the account and use the Workflow Rule Condition expression builder to choose your field ("DBA") in the list. The value returned by the expression builder must be placed in the field_name variable in the function JoinFieldValue (minus the parentheses and quotes).

    Give it a shot and let me know how you do.
    Thom

  • DA on the field in a table with jQuery Selector

    I am trying to summarize the values in a column in my form of tab and display the total in the header of the form region. Find many useful suggestions, but I am bit stuck on the very simple task of adding the DA change to the field on the tab. The name of the input field is f05.

    I created a DA on the changes using jQuery Selector and it performs a simple alert ("f05 has changed") JavaScript to check if the DA is triggered, which is unfortunately not.


    input [name = "f05"] does not work

    [name = "f05"] does not work

    using "instead of"does not work

    I tried each partial name matching according to the jQuery API documentation, for example name * =, | = etc, they all do not work


    entry on its own throws dozens of warning messages, so I know that the DA itself works.


    A few other ideas were a custom CSS class and select it with only .clsTBVALUE, but who doesn't either.


    I am running the latest Apex and most of the examples I have found are Apex 4 or even more, so I'd appreciate some examples particularly for 5 Apex. End result is the execution of a function of small doSum and using the value of the value of the DA to set a hidden value that is used in the title of region.




    The problem wasn't the syntax of jQuery, it's within the reach of the event of the DA. Because the page is a master/detail page, the part of retail is partially present and the linking of the event change GET lost.

    Kiran thanks for the link to the blog. It's a good read.

  • update of column based on the sum of the data from another table

    I have two tables:

    Table1 (col1, col2, col3, col4, val1, status) Table2 (col1, col2, col3, col4, val2)

    For Table1 and Table2, column (col1, col2, col3, col4) are the primary key of composit.

    Table2 could have duplicated lines, that's why I want to group by (col1, col2, col3, col4) and sum (val2)

    After that, I want to update Table1.val1 with the value of sum (Table1.val2) where Table1.col1 = Table2.col1 and Table1.col2 = Table2.col2 and Table1.col3 = Table2.col3 and Table1.col4 = Table2.col4 and status = 'V '.

    I did something like this:

    UPDATE Table1 SET val1 = (

       

    WHERE Table1.col1 = t_sommevbrute.col1 and Table1.col2 = t_sommevbrute.col2 and Table1.col3 = t_sommevbrute.col3 and Table1.col4 = t_sommevbrute.col4)

    Could someone help me please? Thank you

    merge into table1 t1

    using (select col1, col2, col3, col4, sum (val2) val2

    from table2

    Group

    by col1, col2, col3, col4) t2

    on (t1.col1 = t2.col1 t1.col2 = t2.col2 and t1.col3 = t2.col3 and t1.col4 = t2.col4 and)

    When matched then

    update set t1.val1 = t2.val2;

  • Sum of the values in a table

    Please forgive me...  I'm a total newbie to livecycle.  I have a dynamic table where the user starts out with a single line for more information, but it can add lines as needed (add the instance) to list more buildings.  Among other things, they must indicate the location of the building (from a drop in the drop - ie. it has a binding for each location) and an amount representing the insurable value of the building.

    Amount of the
    Location
    LC1$100,000
    LC1$125 000
    LC1$100,000
    LC2$150,000
    LC2$130 000
    OCP$200,000
    OCP$175 000
    OCP$100,000

    In a totally different subform, I can generate the total good enough general using formcalc: sum (Buildings.Row4 [*]. Amount [*])

    But how would generate a sum for each location?  In other words, use the location as a criterion for the amounts that make amalgam.

    You can use a loop for to do this.

    This example adds all the locations named LC3.

    var s = 0

    for i = 0 upto Buildings._Row.count-1

    If (Buildings.Row [i]. Location eq "LC3") then

    s = sum (s, Buildings.Row [i]. Amount)

    endif

    ENDFOR

    $ = s

  • Conditional sum of the cells in a table

    I have created a form with several rows of pricing, I want total based on the answer to another cell in the same row.  I, for example, in each line of a cell in column 2 called "scope" which is a drop of water down Yes/No field.  At the end of this line, a cell called "rowtotal" which is a numeric field with a prize in it.  I want to have a total at the bottom of the page for all rows that were selected in the drop-down list "scope" 'yes '.  I would prefer to use formcalc but any help is appreciated.

    Hello

    FormCalc is easier than for a sum of right of a repeating line ' object. However, when you perform a conditional sum, while both will work, I am more familiar with the JavaScript syntax:

    // Resolve the nodes
    var oRows = xfa.resolveNodes("Row1[*]");
    Total.rawValue = 0; 
    
    // Loop through the instances of Row1
    for (var i=0; i
    

    Hope that helps,

    Niall

  • How do I know which updated the field in a table

    Hi all

    There is a table that stores the information of bank account that has been updated from last month. Anyway is to know which user, what iP or any other detail that has updated.

    Auditing is enabled.

    Thanks in advance.

    Kind regards


    Hi John,.

    The audit is at the database level. sys. AUD$ table. I m new with the part of the audit. With this we can retrieve information about who has updated.

    Thanks in advance

    Kind regards

  • How to calculate the sum of the numbers in a table...

    So my table contains brands for a fictitious class and I need to be able to calculate these brands to give me an average of class which is this formula; all brands added / number of brands. Is there a way to do this in a table?

    My code for the program so far is:

    Create table
    var brands: Array = ["100" '76', '80', '54', '23'];
    Function key
    enter_btn.addEventListener (MouseEvent.CLICK, onClick);
    function onClick(event:MouseEvent):void {}
    Declare required variables
    var brand: Number;
    markIn var: String;
    Retrieve data from TextField
    markIn = markIn_txt.text;
    brand = Number (markIn);
    Table
    Marks.push (markIn_txt. (Text);
    trace (Marks);
    }

    Add a listener to mouse for the sorting of the brands
    sort_btn.addEventListener (MouseEvent.CLICK, onSort);
    function onSort(event:MouseEvent):void {}
    Matrix display and sorting
    marksort_txt. Text = marks.sort (Array.NUMERIC);
    }

    Add a listener for mouse for analyizing brands
    analysis_btn.addEventListener (MouseEvent.CLICK, onAnalysis);
    function onAnalysis(event:MouseEvent):void {}
    Determine the middle class

    NOTE: I had this total = total + Number (mark [k]); inside a loop but it doesn't seem to work...

    Maybe something like that might work for you.

    var brands: Array = ["100" '76', '80', '54', '23'];

    var totalMark:Number = 0;
    var avgMark:Number = 0;
    var markCount:uint = 0;

    for (var i: int = 0; i
    {
    var mrk:Number = parseInt (marks [i]);
    If (IsNaN (MRK)) {continues ;}
    markCount ++;
    totalMark += mrk.
    }
    avgMark = totalMark/markCount;

    trace (Marks);
    trace (totalMark)
    trace (avgMark)

Maybe you are looking for

  • Pavilion: Please help

    HelloI wonder if I install Windows defender in offline modeMade my get deleted if files Windows Defender in offline mode finishedThe reason why I want to doIs becauseWhen I did Windows defender scan yesterday the selected scan harmful viruses and he

  • Cannot repair a vault disk file in El Capitan

    I had force my Macbook shut down recently and I opened disk utility to see if everything was okay. I'm running day El Capitan with a FileVault encrypted drive. New Macbook Pro (February 2015). "First aid" running on the external Apple SSD article see

  • Windows 2008 Server - date maintains itself to current date

    I'm trying to test/validate a bug in a product, I am responsible, where there may be a problem in the program caused by the switch to summer time. I have two Windows 2008 servers (it is a client/server product, so I need two machines) and on both mac

  • several programs start when windows starts

    my computer runs very slowly I think I have several programs start when windows start and I did not now how to solve this problem, I got help and they thought that by removing some of my programs, this can help, but it's still the same

  • How to close programs uninstall may continue

    I'm trying to uninstall/install adobe flashplayer.  Adobe flashplyr starts to uninstall when I get the message that the uninstaller will resume when I close programs that are running, which is IE.  I think it's locked so how do I close it without los