AJAX updating a display item

I have a input box for a customer number and next to that, a display as text item that I would like to be updated with the Customers Name (from database) when customer number is supplied in the input box.
Have tried adapting one or two examples from the forum with little success.
Can anyone help?
Also, from what I can read it appears that each input/field type needs it's own AJAX routine - does anyone have a 'library' of routines that might be useful to share.
Thanks,
Scott

Consider the table to be CUST_MST ( cust_id, cust_name).
Two page items to :P100_CUST_ID and :P100_CUST_NAME.
Create a Application process TEMP (On Demand Type) as below :
declare
l_CUST_NAME varchar2(100) ;
begin
select nvl(CUST_NAME,'No Description') into l_CUST_NAME from CUST_MST
where CUST_ID = :P100CUST_ID;
htp.prn(l_CUST_NAME) ;
end ;
In the region source add this script:
<script language="JavaScript1.2" type="text/javascript">
function f_temp11 ()
document.getElementById('P10021_ACR_SNO_DESC').value = "";
var get=new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=TEMP',0);
get.add(P100_CUST_ID',html_GetElement('P100_CUST_ID').value)
gReturn = get.get();
if(gReturn)
{  html_GetElement('P100CUST_NAME').value = gReturn  }
else
{  html_GetElement('P10021_NAME').value = 'Does not exist' }
get = null;
In the Form Element Attributes of P100_CUST_ID call the script as
onBlur="javascript:f_temp11()";
Hope this helps.
Ameya.

Similar Messages

  • Ajax Update of a rich:subTable with rich:dataTable

    Hello,
    i just want to rerender a subtable within a dataTable via ajax request.
    The concrete requirement is just to model a 1-level table tree, such that i am
    able to expand items in the superior table. I have tried different solutions.
    One is, that value.items returns an empty list on not expanded,
    other was to use the rendered attribute at the subtable and/or also
    at a wrapping columngroup.
    Another thing is, that the table obviously requests the
    ajaxKeys attribute at the dataTable, it also returned
    the correkt rows (as integer index keys within a Set),
    but the subtable is never refreshed.
    I have no more idea! Do i only have the possibility
    to update the whole table (this works fine) ?
    When do i really need the ajaxKeys attribute?
    My third question by this way is, is there a nice
    way of doing it using pure client side javascript effects?
    Hope you can help,
    Ijaja
    <rich:dataTable      value="#{bean.list}" var="value" id="table">
         <rich:column colspan="2">
              <a4j:commandLink action="#{value.switchExpanded()}" reRender="subtable">
                   <h:graphicImage id="expandimage" value="#{value.image}"/>
              </a4j:commandLink>
              <h:outputText value="Text"/>
         </rich:column>
         <rich:subTable id="subtable" value="#{value.items}" var="item">
              <rich:column>
                   <h:outputText value="#{item.label1}" />
              </rich:column>
              <rich:column>
                   <h:outputText value="#{item.label2}" />
              </rich:column>
         </rich:subTable>
    </rich:dataTable>

    Hi, thanks for your reply. I looked at the ajax code in that post.
    attrResponse should be called from my Action class (controller class in my case since am using spring)
    However, this is extremely useful if I am expecting the user to do an input for me.
    I need to figure out if a Query is updating table abc ( I plan to do it this way :
    I will get the table name from all update queries being executed (this I dont know how I will do though), and then after the successfull updation I will execute the select query for the same table) and then return the result set in the attrResponse.
    ultimately this will help in updating rows displayed in jsp based on updates done to the database without the page being refreshed. For ex, if my current Jsp is displaying my total no. of employees, which is 2 then if someone updates the table with a third employee, then the third row gets automatically updated.
    am I taking it up in the correct way ?
    Is there another way to do this ?
    Thanks for your time on this.

  • BDC recording(updating two line items in a single call)

    Hi,
    I have a problem with the transaction PK31,while recording we enterd material number,plant,supply area in the first screen,after that it display line items for that control cycle,I want to update some fields in that line items,when i updated quantity and status fields in the first line item after that i cliked the change "qty/status button" and it saves that field values and it comes out from the transaction.
    can you please suggest what is the solution for updating two line items in a single call(PK31 transaction).

    Hi,
    In one screen . Put 2 containers with different names.
    cont1,cont2
    on each of the container call grid,grid1 like below .
    1. this is for item line display
    IF g_r_grid IS INITIAL.
          CREATE  OBJECT  g_r_cont
                      EXPORTING  container_name  =  'CONT1'.
        g_r_variant  =  sy-repid.
    *--Build  field  catalog
        PERFORM build_field_catalog.
    *--Layout selection
        g_r_layo-cwidth_opt  = g_c_set.
        g_r_layo-no_rowmark  = g_c_set.
        g_r_layo-sel_mode    = space.
        CALL METHOD g_r_grid->set_table_for_first_display
          EXPORTING
            i_buffer_active = g_c_set
            is_variant      = g_r_variant
            is_layout       = g_r_layo
            i_save          = g_c_set
            i_default       = g_c_set
          CHANGING
            it_outtab       = g_t_alv
            it_fieldcatalog = g_t_fieldcat
            it_sort         = g_t_sort.
      endif
    1. this is for error data display
    IF g_r_grid1 IS INITIAL.
          CREATE  OBJECT  g_r_cont
                      EXPORTING  container_name  =  'CONT2'.
        g_r_variant  =  sy-repid.
    *--Build  field  catalog
        PERFORM build_field_catalog.
    *--Layout selection
        g_r_layo-cwidth_opt  = g_c_set.
        g_r_layo-no_rowmark  = g_c_set.
        g_r_layo-sel_mode    = space.
        CALL METHOD g_r_grid->set_table_for_first_display
          EXPORTING
            i_buffer_active = g_c_set
            is_variant      = g_r_variant
            is_layout       = g_r_layo
            i_save          = g_c_set
            i_default       = g_c_set
          CHANGING
            it_outtab       = g_t_error
            it_fieldcatalog = g_t_fieldcat
            it_sort         = g_t_sort.
      endif

  • Populate multi record display item

    Hellou gurus!
    I have forms 10g and i need to populate display item in enter query mode. My problem is that I have table T1 with some static values. Table T2 is through ID connected (reference) to table T1 1:1 cardinality and T2 table also have reference to T3 table.
    I have block B2 based on table T2 and in this block I have multirecord item for inserting and updating new values for T2, but in this block ii also have no DB, multi record display item (because i don't want to allow editting in T1 table records) for diplaying static values for table T1. I want to display all static values from T1 next to the editable values in T2 (T2 multi record field is not insert yet). I tried for loop, select into but it not work. T1 values need to be selected before I started to inserting values into T2 items, but off course they need to be referenced It is hard to explain but i belive you understand.
    Can you help me how I can populate multi record item??

    You have to write the code again for your second list item....
    group_id RecordGroup;
    list_id Item  := Find_Item('button.tyear');
    list_id1 Item  := Find_Item('button.tperiod');
    status NUMBER;
    rg_name varchar2(40) := 'recgroup';
    BEGIN
    ----------------------------- LIST
    clear_list(list_id);
    group_id := Find_Group(rg_name);
    IF NOT id_null(group_id) then
        Delete_Group(group_id);
    End if;
    group_id := Create_Group_From_Query(rg_name,
    'select vm_year, vm_year from fwqgl.vouchermaster
    group by vm_year');
    status := Populate_Group(rg_name);
    Populate_List(list_id, group_id);
    /* --------------------SECOND LIST ITEM...BUT REC. GRP NAME CAN BE SAME,better to use another name if you need to retrieve list and store qry..other wise the fol. code is enuf-----------------------*/
    clear_list(list_id1);
    group_id := Find_Group(rg_name);
    IF NOT id_null(group_id) then
        Delete_Group(group_id);
    End if;
    group_id := Create_Group_From_Query(rg_name,
    'select vm_period, vm_period from fwqgl.vouchermaster
    group by vm_period');
    status := Populate_Group(rg_name);
    Populate_List(list_id1, group_id);
    END;Edited by: Dora on Dec 5, 2009 10:41 AM

  • Master/Detail problem: Infinite loop with display items

    Hi,
    I have a strange problem in Oracle Forms 6.0.5.35.3. I create a master block and a detail block with correct relationship between them.
    -> When the detail block contains at least one 'Text Item' everything works well.
    -> When the detail block only contains 'Display Items', the form is looping
    indefinitely calling ON-POPULATE_DETAILS and QUERY-MASTER-DETAILS...
    Is it a known bug ?
    Do you know a trick to avoid this behaviour ?
    Is it corrected with latest versions of forms, I mean 6i ?
    Thanks for answer
    Laurent Ricci

    I think a block should have at least one navigable item. Just disable the insert/update property, but enable the navigable property for an item in the detail block.
    Hope that help

  • Display item with HTML affected by dynamic action

    Hi,
    I'm using APEX 4.1.1
    I have a item P1_TEST set as "Display only", escaping special characters "no", and the source as pl/sql expression of
    'hello <b>world</b>'I then create a dynamic action executing PL/SQL on click of a button.
    P1_TEST is listed in both "page items to submit" and "page items to return", and it doesn't matter what happens in the pl/sql code - it could just be null;
    When opening the page, I see
    hello world
    as desired.
    After clicking the button, the field contents become escaped and I see hello <b&GT;world</b>which is not desired.
    Is this expected behaviour / a bug? Is there a workaround?
    Cheers
    Scott

    Hi Scott,
    This was indeed a change of behaviour from 4.1.1 to 4.2 and has to do with how APEX handles input escaping (or when saving values into session state). I should say, we plan to revisit the current behaviour to make this more transparent and obvious, but that won't be for 4.2, for your information.
    As you identified, the escaping is happening as part of the 'Page Items to Submit' functionality, so in other words when the item value is saved in session state. APEX has some predefined rules about when and when not to do input escaping based on the item type, and this is what has changed slightly from 4.1.1 to 4.2.
    In 4.1.1, regardless of whether item values are set via the URL or via an Ajax call, the same rules applied for when APEX does input escaping. We always input escape the 'safe' item types. These types used to be documented in the 3.2 documentation, here: http://docs.oracle.com/cd/E14373_01/appdev.32/e11838/sec.htm#CDDBBECI
    (Obviously the item types have changed slightly with the consolidation of some of those into single items, with different settings. But hopefully that is still of use, and we no longer cite them in the same way in recent documentation so I couldn't link to something more recent.)
    In 4.2, this behaviour was 'relaxed' slightly, such that this logic only kicks in when setting values over the URL, not for Ajax calls. This is why this is no longer an issue with your DA, because we no longer obey the same item type escaping in the context of an Ajax call.
    As a workaround for 4.1.1, I would suggest to use a non-safe item type to set your value into (eg a 'Hidden' type), then use JavaScript just to copy that over to your displayed item. The 'unescape' function didn't work, because that does URL unescaping, not HTML unescaping.
    Hope that helps,
    Anthony.

  • Transparent Background for a Label/Display item

    I'm using Forms 10g.
    I'd like to make the background of my labels (display items) transparent. i.e. it should be the same colour as the canvas (eg teal) instead of the ugly white default background.
    Can anyone help?
    Thanks,
    Abigail
    Edited by: Abigail Parmar on Mar 11, 2009 9:47 AM

    Wait a minute! Abigail is not really asking for "transparent" background. All you need is for the background to have the SAME background color as the canvas.
    All of our forms have that feature. Display-only fields have same background color as the canvas, update items have a white background, and the item where the cursor is located gets set yellow.
    We do it with property classes and visual attributes. The canvas is assigned a Visual Attribute = "WINDOWBACKGROUND", and display-only fields are assigned a Visual Attribute of "DISPLAYITEM". Both visual attributes are assigned the same background color, with the foreground (text) color black and navy respectively.
    We have mouse-click processes that allow the user to change the screen background color from the default to something they might like better. That process just changes the background color of the two visual attributes, and both the canvas and all the items' background colors change together.

  • Go_item doesnot work in a control block having all display items

    Hi
    go_item bulitin doesnot work for a block which doesnot have any enabled items(or say display items only) throwing error " No items on the navigation block".
    The requirement is to have all items in that block should be display items only.
    Is there any workaround?
    Thanks in advance.

    Create a navigable item in the block where cursor focus can be placed. I usually make it a visible text item with very narrow width -- just enough so the user can see the cursor blinking.
    Or else make one of your display items a text item, but with update allowed set to No.
    ...but why are you using Go_Item if the item is not an updateable field?

  • How do we update the existing item in Cache (RWB) without know GUID?

    Hi Friends,
        We want to update the existing item in Cache (Value Mapping). Assume that Cache Contains like
         IN --> INDIA
         FR --> FRANCE
         EN --> ENGLAND
        We want to change ENGLAND to LONDON. How it is possible ... ? (Assume that above mapping data is replicated from my text file/Oracle Table, already).
    Kindly reply.
    Kind Regards,
    Jegatheeswaran P.

    Hi Vijay,
        Whatever the value mapping table we created in Intergration Directory, we can display & edit values of particular item. Because, they are stored in the XI default context 'http://sap.com/xi/XI'. In this case, it is not necessary to know the context and GUID value.
        But, in my case, I have replicated value mapping data from external system (SAP table/Text File/Oracle Table) into RWB --> Cache Monitoring --> Runtime Cache. I use my own context like 'http://aprilbiztec.com/FRAMEWORK/FileToFile'. In this case, how do we edit the particular line item. This is my problem.
    Kindly help me.
    Thanks in advance.

  • How can i update an existing item in sap using CSV file?

    Hi,
    i am trying to update an existing Item in SAP using a CSV file.
    in the message log i get an error message that the item already exists.
    what should i do in order to update the existing record?
    Thanks, Udi

    Hi..........
    I would sugest you to use Tab delimited file and choose proper option in order to update the itsm master in DTW......
    Regards,
    Rahul

  • How to update an existing item in a sharepoint list using the WSS adapter for Biztalk

    Is there a way that a record in SP list be updated using WSS adapter in biztalk ?
    BizTalk 2013 and SP 2013 ..
    Regards
    Ritu Raj
    When you see answers and helpful posts,
    please click Vote As Helpful, Propose As Answer, and/or Mark As Answer

    A ListItem has its own unique row id so in all likelihood, an insert with the same data will result in a new list entry. The Lists Web Service however, has an UpdateListItem method which will take an update request. [refer
    http://msdn.microsoft.com/en-us/library/office/websvclists.lists.updatelistitems(v=office.15).aspx ]
    There is another note in the conference (marked answered) to your List Item Update problem. Probably worth a try too. [refer
    http://social.msdn.microsoft.com/Forums/en-US/bee8f6c6-3259-4764-bafa-6689f5fd6ec9/how-to-update-an-existing-item-in-a-sharepoint-list-using-the-wss-adapter-for-biztalk?forum=biztalkgeneral ]
    Regards.

  • Display a database item on display item

    please i have a varchar database item and i want to display the last item in this field on a display item what should i do and i used the row id to get the last value but it didn't work

    Still not clear what you are trying to achieve...
    it is just a non database item that i want to view the data in the database item in itIf it a "non database item", how can it have a relationship with a database value?

  • Need to update the list item in the same sharepoint list with particular condition with Sharepoint Designer 2013.

    Hi All
    I have one sharepoint list with huge data i.e with 20columns and more than 200 records with the fields .
    Suppose lets consider there are A,B,C,D,E,F,G,H columns.
    Now i want to create one form with the fields A,C,E.
    When the user enter the existing data of list for columns A,C..based on C value the E column value should change and update that particular item in the list.
    Please guide me without visual web part can we acheive this by Sharepoint designer 2013 or what would be the preferable solution.
    Please help me on this as it is very urgent from me..
    Thanks in Advance
    Sowjanya G

    Hi,
    According to your post, my understanding is that you wanted to update the list item in the same sharepoint list with particular condition with Sharepoint Designer 2013.
    I recommend to create workflow associated to the list and then start the workflow automatically when an item is changed.
    In the workflow, you can add condition and actions as below:
    If current item: C equal to Test1
         Set E to Test2
    Then the value of the filed E will be changed based on the value of the filed C.
    In addition, if you create the form using InfoPath, you can add rule to the filed C as below:
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Contract Release value is not updated with Limit item value

    We have SRM 4.0 with ECS scenario.
    Contract are created in SRM and replicated to ERP.
    If we create PO with Service line and Limit line using contract in both of these line items, contract Release value is getting updated only with Service line item value.
    But the contract Total value is the addition of Service and Limit value of PO.
    Why Contract Release value is not getting updated with Limit item value. Please help as early as possible.

    Hi Sandeep
    Yes. there are various reasons .upon your contract incorrect status and linkage not establised / or more attachment in SRM GOA.
    what type of contract are you using? GOA or CCTR
    If it is GOA - which version of SRM and service pack ?are you in ?
    If it is a GOA , BLAREL idoc might failed to post the release value in the SRM .
    How contracts are created material / mat group ?
    to fix or understand the issue, you need to recreate the issue.
    what is the ERROR in BLAREL in SRM idoc monitoring ?

  • My performance is very slow when I run graphs. How do I increase the speed at which I can do other things while the data is being updated and displayed on the graphs?

    I am doing an an aquisition and displaying the data on graphs. When I run the program it is slow. I think because I have the number of scans to read associated with my scan rate. It takes the number of seconds I want to display on the chart times the scan rate and feeds that into the number of samples to read at a time from the AI read. The problem is that it stalls until the data points are aquired and displayed so I cannot click or change values on the front panel until the updates occur on the graph. What can I do to be able to help this?

    On Fri, 15 Aug 2003 11:55:03 -0500 (CDT), HAL wrote:
    >My performance is very slow when I run graphs. How do I increase the
    >speed at which I can do other things while the data is being updated
    >and displayed on the graphs?
    >
    >I am doing an an aquisition and displaying the data on graphs. When I
    >run the program it is slow. I think because I have the number of
    >scans to read associated with my scan rate. It takes the number of
    >seconds I want to display on the chart times the scan rate and feeds
    >that into the number of samples to read at a time from the AI read.
    >The problem is that it stalls until the data points are aquired and
    >displayed so I cannot click or change values on the front panel until
    >the updates occur on the graph. What can I do to be a
    ble to help
    >this?
    It may also be your graphics card. LabVIEW can max the CPU and you
    screen may not be refreshing very fast.
    --Ray
    "There are very few problems that cannot be solved by
    orders ending with 'or die.' " -Alistair J.R Young

Maybe you are looking for