How to generate a value to field in a row based on another two fields in the same row ???

I have a quantity and unit price and there is also a field in the same row called total price. I want to get the value automatically of total price from multiplying quantity and unit price.

Here you go:
page code
                        <af:panelGroupLayout id="pgl2" layout="horizontal" styleClass="AFStretchWidth">
                            <af:inputText label="Quantity" id="quantity" value="#{bindings.quantity1.inputValue}" autoSubmit="true"
                                          valueChangeListener="#{SetItemBean.valueChangeListenerItem}"/>
                            <af:spacer width="10" height="10" id="s1"/>
                            <af:inputText label="Price" id="price" value="#{bindings.price1.inputValue}" autoSubmit="true"
                                          valueChangeListener="#{SetItemBean.valueChangeListenerItem}"/>
                            <af:spacer width="10" height="10" id="s2"/>
                            <af:inputText label="Sum" id="total" value="#{bindings.total1.inputValue}" partialTriggers="quantity price" readOnly="true"/>
                        </af:panelGroupLayout>
page bindings
<?xml version="1.0" encoding="UTF-8" ?>
<pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel" version="12.1.2.66.68" id="SetItemPageDef" Package="de.hahn.blogtest12c.view.pageDefs">
  <parameters/>
  <executables>
    <variableIterator id="variables">
      <variable Name="quantity" Type="java.lang.Number"/>
      <variable Name="price" Type="java.lang.Number"/>
      <variable Name="total" Type="java.lang.Number"/>
    </variableIterator>
  </executables>
  <bindings>
    <attributeValues IterBinding="variables" id="quantity1">
      <AttrNames>
        <Item Value="quantity"/>
      </AttrNames>
    </attributeValues>
    <attributeValues IterBinding="variables" id="price1">
      <AttrNames>
        <Item Value="price"/>
      </AttrNames>
    </attributeValues>
    <attributeValues IterBinding="variables" id="total1">
      <AttrNames>
        <Item Value="total"/>
      </AttrNames>
    </attributeValues>
  </bindings>
</pageDefinition>
and bean code
    public void valueChangeListenerItem(ValueChangeEvent valueChangeEvent) {
        String comp = valueChangeEvent.getComponent().getId();
        BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
        // get an ADF attributevalue from the ADF page definitions
        AttributeBinding attr = (AttributeBinding) bindings.getControlBinding("quantity1");
        Number q = (Number) attr.getInputValue();
        if (q == null)
            q = 0;
        attr = (AttributeBinding) bindings.getControlBinding("price1");
        Number p = (Number) attr.getInputValue();
        if (p == null)
            p = 0;
        if ("price".equals(comp)) {
            p = (Number) valueChangeEvent.getNewValue();
        } else {
            q = (Number) valueChangeEvent.getNewValue();
        // set new value
        attr = (AttributeBinding) bindings.getControlBinding("total1");
        Number t = q.doubleValue() * p.doubleValue();
        attr.setInputValue(t);
        // update Total
        FacesContext facesCtx = FacesContext.getCurrentInstance();
        UIComponent ui = facesCtx.getViewRoot().findComponent("total");
        if (ui != null) {
            // PPR refresh a jsf component
            AdfFacesContext.getCurrentInstance().addPartialTarget(ui);
Timo

Similar Messages

  • How to go to a particular field of the same page by clicking the radio button.

    Hello All ,
               I am working on a form which is designed by some one else . There is a Page - 8 . And there is a question at the first which is in another subform.
               At the end there are several radio buttons . If some one is clicked as yes then the focus should be on Question which is present at the beginning of the form.
    My code goes like this .
    if(TopmostSubform.Sub_Form_Section.Page8.RadioButtonList[0].Q9_EnterAnotherProgramRegEntSt ate[0].this.rawValue ==true)
    xfa.host.setFocus(' TopmostSubform.Sub_Form_Section.Page8.Table.Row[1].Cell[1].Q9_ProgramNm');
    Form hierarchy for Q9 _ProgramNm is -- TopmostSubform.Sub_Form_Section.Page8.Table.Row[1].Cell[1].Q9_ProgramNm
    Form hierarchy for radio button is -- TopmostSubform.Sub_Form_Section.Page8.RadioButtonList[0].Q9_EnterAnotherProgramRegEntStat e[0]
    The event should be click event on JavaScript.
    Please someone help !!!!

    Hi
    In the second screen, for field empno, set the attribute Output only as X and set group1 for empname as 'INP'.
    In PBO of second screen, write this code.
    loop at screen.
    case screen-group1.
       when 'INP'.
         if sy-ucomm = 'DISP' .  "sy-ucomm value when you click display
           screen-input = '0'.
           modify screen.
       endif.
    endcase.
    endloop.
    regards
    Navneet
    Message was edited by:
            Navneet Saraogi

  • How to display or generate PDF417 barcode dynamically in PDF form? I am using Acrobat XI Professional and there is a Bar Code Field in the same through which I generated the same. But I want to generate the same dynamically.

    How to display or generate PDF417 barcode dynamically in PDF form? I am using Acrobat XI Professional and there is a Bar Code Field in the same through which I generated the same. But I want to generate the same dynamically.

    What do you mean by dynamically? When yo set up a 2D bar code field you specify which field name/value pairs you want to include, along with other parameters. But be aware that they won't work with Reader unless you Reader-enable the document with LiveCycle Reader Extensions and include the bar code usage right. It will work with Acrobat Standard/Pro.

  • How can I have two fields with the same name if it makes sense?

    Hello, folks :)
    I have a pretty hard time figuring out how I can have two text fields with the same binding name.
    The whole problem is that when I need two fields with the same binding name they are still differnent coz they have the same name but differnt indices.
    I should make a form filled at runtime by merging a pdf form file and an fdf file data file. And I have no choice to do it differently. And my form file needs some data like customerName, companyName twice in one form. But there's only one possible buinding name indexed zero.
    How can I create a field with absolutely the same name or is it just impossible due to possible name conflicts? And is there a workaround to this problem? I just need one piece of data repeated in different places.
    Thanks for your replies :)
    P.S. if u think that the problem is not clear enough let me know. I'll supply you with more details. But the general process can not be changed.
    One pdf should be mergred with an fdf with as the result of their merge a new filled and flattened form. I have no control over fdfs their are generated by Oracle and I can not fill the form using XML files coz this process should be integrated in a working application.

    I just thought about a really ugly workaround with a server-side script adding values to fdf files but it's a bit of work and tests and personally i think it's a bad idea :-(

  • How to fetch the data & display the data if fields got the same name in alv

    hi frnds, i need ur help.
    how to fetch the data & display the data if fields got the same name in alv grid format.
    thanks in advance,
    Regards,
    mahesh
    9321043028

    Refer the url :
    http://abapexpert.blogspot.com/2007/07/sap-list-viewer-alv.html
    Go thru the guide for OOPs based ALV.
    Use SET_TABLE_FOR_FIRST_DISPLAY to display the table:
    CALL METHOD grid->set_table_for_first_display
     EXPORTING
    I_STRUCTURE_NAME = 'SFLIGHT'     “Structure data
    CHANGING
    IT_OUTTAB = gt_sflight.          “ Output table
    You can also implement
    Full Screen ALV, its quite easy. Just pass the output table to FM REUSE_ALV_GRID_DISPLAY. 
    For controlling and implementing the FS-ALV we have to concentrate on few of the components as follows :
    1. Selection of data.
    2. Prepare Layout of display list.
    3. Event handling.
    4. Export all the prepared data to REUSE_ALV_GRID_DISPLAY.
    Regd,
    Vishal

  • How to compare two fields from the same table in the select statement

    Hi, friends
    I try to compare tow fields from the same table, but no result,
    For example, this
    data: cptotchek tyep i.
    select count(*) into cptotchek
    from aufk where erdat = aufk-idat2 .
    The result is  cptotchek = 0, but there are the records in aufk , where,  aufk-erdat = aufk-idat2.
    Please, help me, i don't use the loop statement for optimize my program.
    Regards

    Hi  ,
           it will not return  any value   when you are using   column of same table 
           such as Date Field   , Because  while Using Aggregate Function  it will not check with self column
    .      For that you have to take data in one internal table and then you can work on it  .
         And if you are worried about Performance  it will not affect  , untill you are selecting only required data  .
    you can try this way  .
    data: cptotchek type i.
    types : begin of  w_aufk.
            include structure aufk  .
          types : end of  w_aufk .
    data : it_aufk type standard table of w_aufk with header line  .
    select * into corresponding fields of table it_aufk
    from aufk  .
    loop at it_aufk .
    if it_aufk-erdat  = it_aufk-idat2 .
    write : / it_aufk-erdat , it_aufk-idat2 .
    else .
    delete it_aufk .
    endif  .
    endloop.
    Regards
    Deepak.

  • How to place two text fields on the same line in adobe

    I am trying to create a form on adobe and I would like to have two unique text fields on the same line. Is this posible? 

    If you are using FormsCentral it is, the fields can be placed "side by side" in a row.  There is a "+" sign on the right side of the field that brings up a toolbar to add a field adjacent.  You can also right click on a field and select "Insert beside", or you can "drag and drop" fields next to one another or to a new row.
    Thanks,
    Josh
    PS - One note, if you are using the "desktop" application of FormsCentral that comes with Acroat Pro XI make sure the application is up to date by either using the "Help" - "Check for updates" menu item or by signing into the application so that you have the latest features including the side by side layout.

  • Mandatory fields on the same page with dependent LOVs

    Hi,
    I am working on an ADF-BC application using JDeveloper 10.1.3.4
    I have an ADF Creation form with dependent LOVs and while implementing dependent LOVs we set the autoSubmit property of the selectOneChoiceListBox as true.
    If I have some mandatory fields on the same page then because of the autoSubmit property set as true whenever I select a value in the list the page gets submitted and the mandatory fields give an error that the values are required therefore I had to remove the mandatory fields.
    I tried using f:subview but even that dint serve the purpose because what I want is something like partialSubmit so that my mandatory fields do no give an error when I select a value in the list.
    Can somebody help me on this, how to have a dependent list and mandatory fields on the same page.
    P.S: It is very crucial for my application
    Thanks,
    Raksha

    Hello,
    This bug has been around since 10.1.3, its even still present in Trinidad and now in 11.
    One of the ways to avoid is to make your fields use:
    showRequired="true"instead of
    required="true"I have not found a decent way to avoid this in general.
    My idea was that this shiould be possible with a phaselistener and determine if this is a partial page event instead of a normal submit, but this didnt work.
    -Anton

  • How to get two parameters in the same line of selection screen?

    hello
    i need to get my selection csreen like bellow.
    r1 radiobuttion  -some space --p1 parameter
    i should not get the parameter in the next line of  radiobuttion.
    how to get two parameters in the same line of selection screen?

    hi....
    modify the following code
    it will work
    SELECTION-SCREEN BEGIN OF BLOCK SL1 WITH FRAME TITLE TEXT-003.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 10(15) TEXT-001
                     FOR FIELD P1.
    SELECTION-SCREEN POSITION POS_LOW.
    PARAMETERS : P1 TYPE   C USER-COMMAND R2 RADIOBUTTON GROUP R2 DEFAULT 'X',
      P2 TYPE SCARR-CARRNAME,
      P3 TYPE CHAR1 RADIOBUTTON GROUP R2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK SL1.

  • LiveCycle says mixed when fields have the same Y coordinate

    After using the Layout menu align option to align the top of two fields, I again selected the fields. The Layout panel showed that their Y coordinate was mixed, even though they showed the same value when each field was selected individually. I modified the Y coordinate of both fields individually and changed them back. When I selected both fields again, the Y coordinate showed as the correct number.
    Apparently, using the Layout menu to align fields doesn't reset whatever it has to reset in order to show that multiple fields have the same Y coordinate.
    The most annoying part of this is that it affects tab order. A field which has the same Y coordinate may be looked at as lower on the page.
    I'm using Adobe LCD 7.0.1 on a Dell Optiplex GX620 running Windows XP Professional with Service Pack 2.

    Hello darrensimon,
    This is a bug in Windows 7 (maybe 8 and Server as well). One of my customers are sometimes affected by this. I have not a perfect solution but I've arranged so that the IT responsible person on that company can access the server where
    the files reside through RDP (Remote Desktop). Already open is there Shared Folders->Open Files. This gives the IT responsible person means to force closing of an already saved file that for some (bug) reason stays in the cache (MS loves cache but never
    updates them) and falsely claims the file is open.
    Please try! Shared Folders are reached by right-clicking Computer and select Manage.
    Best regards George

  • CRM2007 Factsheet - updating custom fields at the same time

    I need to change our Factsheet in CRM2007. So far, I've managed to get a new view on the Factsheet and have managed to hard-code some data into it from the Get_* method for the field in the CN** class.
    However, my requirement is to grab some data from ECC6 and populate a number of fields in the same view at the same time. I'm ok with grabbing the data but I'm not sure where to do this to populate all my fields. Can anyone offer some advice please ?
    thanks.

    Hi Malcolm,
    You can write a code similar to this in any method of the IMPL Class liek DO_INIT_CONTEXT or DO_PREPARE_OUTPUT
    or EH_ONENTER based on your reqirement. Replace the Context Node Name and Attribute Names with yours.
    DATA:lr_xxx                  TYPE REF TO if_bol_bo_property_access,
                lv_customer_type   TYPE string.
    * Get the First Entity
      lr_xxx ?= me->typed_context->CONTEXT NODE NAME->collection_wrapper->get_first( ).
      IF lr_xxx IS BOUND.
    *     Get the Vlaue in Attribute Customer Type
          lv_customer_type = lr_xxx->get_property_as_string( iv_attr_name = 'CUSTOMER_TYPE' ).
    ENDIF.
    To set the values, do this way...
    lr_xxx->set_property( iv_attr_name = 'Z_CUSTOMER_TYPE'
                                             iv_value     = lv_customer_type+0(2) ).
    Regards,
    Masood Imrani S.

  • How to check wwheter two files are the same?

    Hi,
    I need to check wheter two files are the same. Their names and paths may be different. How to do that? Do u have any links / examples?
    Important notice: Files used in the application will be big (ie 1, 2gb)

    Comparing a hash, if you have to calculate it each
    time, is bound to be slower than a byte by byte, or
    character by character compare.
    This kind of comparison is used mostly in things like
    content management systems, when a new file of data
    is checked to see if it's identical to a file already
    entered, hash values being stored for each file
    already in the system.
    And comparing the hashes can only prove the files are
    different, if the hashes are equal that doesn't
    absolutely guarantee that the files are the same.
    Normally you'd confirm a matching hash by actually
    comparing file content.Depends on how good your hash is..but in general...yes. I was only saying that it's faster if you're always maintaining a has of the file.

  • Match fields from the same table

    Hi,
    I have a table:
    ID|TEXT1 |TEXT2
    ----------|------|---------------
    1|1 |1
    2|1 |0
    3|1 |1
    4|1 |0
    5|1 |0
    I want to match fields with the same text1 value bu without duplicates
    I tried this:
    select t1.id, t2.id from dane_testowe t1 left join dane_testowe t2 on t1.text1 = t2.text1 where t1.id <> t2.id;
    but I got 20 rows (should be 10)
    ID| ID
    ----------|----------
    5| 1
    4| 1
    3| 1
    2| 1
    5| 2
    4| 2
    3| 2
    1| 2
    5| 3
    4| 3
    2| 3
    1| 3
    5| 4
    3| 4
    2| 4
    1| 4
    4| 5
    3| 5
    2| 5
    1| 5
    I'm new at pl/sql (sql), so could You explain me where is mistake?
    Thanks in advance

    I want to get only one combination like this
    ID| ID
    ----------|----------
    5| 1
    4| 1
    3| 1
    2| 1
    5| 2
    4| 2
    3| 2
    5| 3
    4| 3
    For ex I don't want 2| 1 and 1| 2

  • OVS for two fields in the same selct Option?

    Hi Experts,
    I am using select options in my view. I am using OVS for one field. I would like to use same OVS for another field in the same select option.
    I tried "case ovs_callback_object->context_attribute". Which return the field for which we press F4.
    But IT did not work here probably because this we can use only for context attributes fields.
    but But here I dont get the select option field.
    But in my case I have select options which are not mapped to any context attribute.
    How can I find , for which field in select options F4 help has been requested?
    Regards,
    Vishal.

    Hi,
    You can find which field in select options F4 help has been requested using I_OVS_DATA-M_SELECTION_FIELD_ID.
            CASE I_OVS_DATA-M_SELECTION_FIELD_ID .
                 WHEN 'PERNR'.
                 WHEN 'ENAME'.
                 WHEN OTHERS.
            ENDCASE.
    If you are using one OVS for more than one fileds, please remember that you need to provide different code for each fields at phase 0 (configuration) and phase 3 (apply result).
    Regards,

  • Two fields on the same line in sreen programming

    Hi All,
    I need to create a selection screen which would have two fields (their texts and their irespective input fields) in the same line, on the screen.
    I was able to achieve this by using code--
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(31) text-a04.
    PARAMETERS: sch_begd LIKE qppnp-begda.
    SELECTION-SCREEN COMMENT 52(22) text-a05.
    PARAMETERS: sch_endd LIKE qppnp-endda.
    SELECTION-SCREEN END OF LINE.
    This could allign the fields - start date (text-a04) and end date (text-a05) in the same line along with their input fields.
    But I am facing two issues with this code-
    1. I am not able to get the underline same as we get when we create selection screen using 'select-options' and 'parameters'.
    2. This is causing accessibility issues, as the field text and the input field are no more linked (since I am using text element to display the field text, like for start date), it cannot find the text to be read for the input field and hence the checkman errors.
    Please suggest how to achieve the same.
    Thanks and Regards,
    Arpita.

    Hi Arpita,
    Are you trying to have select-option field in your screen in dialog programming?
    If yes than you can use the following approach else ignore this.
    Create one screen (100) and create subscreen area on this screen and call this subscreen in PAI and PBO of screen
    Using call subscreen check F1 help for calling subscreen in PAI and PBO.
    Now you should create your selection screen on the subscreen use selection screen begin of screen (100) option of defining
    selection screen and then add your selection options here.
    Regards,
    Pawan

Maybe you are looking for

  • Cant use CCC to clone Snow Leapord mac to Mountain Lion mac

    hello all, I just bought a MacBook Pro (Mid 2012 not retina), and it came with Lion OSX. I recently installed Mountain Lion OS and it appears to be working welll except I am having trouble using a cloned external drive. I cloned my 2007 MacBook (Snow

  • IMac first shows progress bar on startup and then won't start up at all!

    Hi, My iMac's somewhat ill I'm afraid. When I power it up, the Apple gong goes and I see the grey Apple logo appear. Few seconds later an progress bar shows up and it doesn't fill, in a minute it'll just disappears and the spinning thing under the lo

  • HT5457 my ipod 4th gen is working slow

    my ipod is working slow and hangs for few seconds sometimes after updating to ios6 and some apps have stopped working too. is there any solution to this or any way to downupgrade the ios ?

  • Wat is the use of writting

    "break-point" at the start of the program.

  • Localized Data Model Message Bundle

    When you use the Validations in the Entity Objects of a data model and you place text for the text, errors, etc...it creates a MsgBundle for that class. Then for other languages you can create additional message bundle (e.g. MsgBundle_it, for italian