Hide/show elements based on the result of the existing function

Hello

I have a function that returns two values that are drawn from a process of application On Demand (thanks Shijesh!):
function myAjaxCall()
{
   var ajaxRequest = new htmldb_Get( null , &APP_ID. , 'APPLICATION_PROCESS=getStatus',0);
   ajaxRequest.add('P11_PATIENT_ID' , $v('P11_PATIENT_ID'))
   //notice the below line.. use of split function
    ajaxResult = ajaxRequest.get().split(',')
   $s( 'P11_CCSS_STATUS' , ajaxResult[0]);
      $s( 'P11_COPAY' , ajaxResult[1]);
}
I'm trying to hide/show the other two items (P11_COPAY_COLLECTED, P11_NO_COPAY_REASON) based on the return value for P11_COPAY.

Is it possible to add an IF statement for the function to show the two elements only if the value is equal to 'Yes'?

I tried this, but then the two values (P11_CCSS_STATUS, P11_COPAY) are not returned, much less any hide/show:
function myAjaxCall()
{
   var ajaxRequest = new htmldb_Get( null , &APP_ID. , 'APPLICATION_PROCESS=getStatus',0);
   ajaxRequest.add('P11_PATIENT_ID' , $v('P11_PATIENT_ID'))
   //notice the below line.. use of split function
    ajaxResult = ajaxRequest.get().split(',')
   $s( 'P11_CCSS_STATUS' , ajaxResult[0]);
      $s( 'P11_COPAY' , ajaxResult[1]);

if ( $v ('P11_COPAY' == 'Yes' ) { 
     $x_ShowItemRow('P11_COPAY_COLLECTED');
     $x_ShowItemRow('P11_NO_COPAY_REASON');
}
else 
{
  // Show Items 
$x_HideItemRow( 'P11_COPAY_COLLECTED');
$x_HideItemRow( 'P11_NO_COPAY_REASON'); 
}
}
Any suggestion on how / if possible?

Thank you
Matt
if ( $v 'P11_COPAY' == 'Yes' )
should be
if ( $v ('P11_COPAY') == 'Yes' ) 

CITY

Tags: Database

Similar Questions

  • Hide/Show Pages based on the drop-down list selection

    Hello

    It drives me crazy. I have 3 boxes in this form (attached) and based on what is checked, I want to hide the first page and navigate to the 1st box checked. It works for the Web Chat feature, but others do not. In addition, the button following Web Chat page, when I click Next, I have a pop alert that should show only if Web Chat is the only selection, but it shows little matter how many selections are made from the boxes.

    As always, any help is appreciated!

    Hi, check if it works properly now.

    Dallas

  • Hide a line based on the State.

    Hello, I have a requirement where I have to hide a line based on the State. I am able to highlight the lines but hide the entire line does not work.

    Condition must be met on a line:

    • Thus, if a sum of EXP5_11, EXP6_11, EXP7_11 and EXP8_11 in a current group is all zeros hide this line. Please refer to the RTF-model.

    Attachments:

    • RTF-model.
    • XML file.
    • Sample output generated when the lines are highlighted the meeting status.

    Any help is much appreciated on how I can hide a line.

    EM-: [email protected]

    If please remove your IF condition and add the following code inside the foreach tag

    This works very well in my test.

  • How can I show or hide a picture based on the size of the screen in CS6?

    I have a website created using Dreamweaver CS6. I used the checkerboard to fluid to hold different views for each of the 3 types - phone, Tablet, desktop computer. It works well, resizes properly. I would like to be able to show a picture in the desktop version but not the mobile version. How I do that? I can see in the .css file that the screens of different size can have their own different settings. Y at - it code I could add that could hide/show and image based on the users on the same page window? Let's say I have a div that is named photo. How could I add a parameter to the div photo in the stylesheet that would hide the image if it were mobile?

    Thank you

    Marilyn

    Thanks, I was able to change my code using your example and it works exactly as I wanted!

  • Hide/show element at the click of another symbol

    Hello

    I want to hide an element by click. The item that is clicked is inside another symbol, which one that should be hidden.

    Please tell me how I can handle this.

    Thank you very much

    // Get the symbol element "kitten_1" and hide the element "kitten_paw"
    sym.getComposition().getStage().getSymbol("kitten_1").$("kitten_paw").hide();

  • Show or hide form fields based on the selection of cfselect

    Hello

    I use ColdFusion 9 and

    I want to show/hide a form field type = checkbox if an assigned value is selected from a drop-down list, but it does not work.

    I use a javascript function.

    My question is: is there the best opportunities with ColdFusion for this or Javascript is the best solution?

    Here is my code:

    < script type = "text/javascript" >

    function show() {}

    Select var = document.getElementById('dropdownlist').selectedIndex;

    if(Select == 1) document.getElementById('area').style.display = 'block ';

    else document.getElementById('area').style.display = "none";

    }

    < /script >

    ....

    < cfquery name = "select_list" >

    Select * from table

    < / cfquery >

    < cfform name = 'form' >

    < name = 'dropdownlist' cfselect onChange = "show (); ">

    < option value = "0" > please select < / option >

    < cfloop query = "select_select_list" >

    < option value = "#select_select_list.id #" > #select_list.name # < / option >

    < / cfloop >

    < / cfselect >

    < div id = 'space' style = "display: none" >

    < cfloop query = "select_list" >

    < style tr = "display: none" >

    < td >

    < name cfinput = "SSG" type = "checkbox" value = "#select_list.id #" > #select_list.name #.

    < table >

    < /tr >

    < / cfloop >

    < / div >

    < / cfform >

    Thank you and best regards!

    Claudia

    Well, thank you for your response.

    I changed the javascript function and replaced the

    with thetag. Then it works.

    Here is a snippet of my code:

    Select * from table

  • [ADF, JDev 12.1.3] How to hide menu items based on the logged in user

    Hallo,

    When the user logs on successfully, the applitacions led him to the main.jspx page.

    The main.jspx page has a menu bar that contains all of the available menus, submenus and menu items.

    After the connection, when the main.jspx page loads I would hide all the menus, submenus and menu items that the user is not qualified to see/use (I read the database).

    You kindly tell me which is the way the cleaner to achieve?

    Thank you

    Federico

    user10709360 wrote:

    Hello rohanwalia,

    Sorry, but I need more help

    I guess that the solution is to create a method in the AM who - reading form the database - returns a structure that indicates for each menu item should be visible or hidden.

    • How can I use the data returned by this method?
    • I call in a managed bean specifically dedicated to the management of the menu? Can I also use the already existing media bean, I created for the page?
    • What scope should have the bean?
    • Don't you think that it is better to define a 'visible' variable Boolean (initilized depending on the result of the AM method) for each menu item and how to bind the Visible property of each menu item to the variable respective in the bean in the bean?
    • Or I can loop the result of the method AM setting the Visible property of the menu items? In this case, I guess that all the menu items must be mapped into the bean by user interface variable. Am I wrong?
    • Is it not possible to write a method which, of the AM directly, hide the menus not necessary on the page (so without using a bean)?
    • In general, which are the correct always to hide menu items:
      • (1) before the page is sent to the browser (as "I can do it with PHP);
      • (2) once the page is loaded in the browser (as I can do it with JavaScript)?

    If you could give me some more detailed advice... I would be very happy.

    Thank you

    Federico

    (1) its best to make the treatment inside the method. You can return the parameters as normal java method.

    (2) Yes, you can use bean already exists in the project. But better to create a separate bean for this task of menu.

    (3) scope should be request unless you need to persist the attributes between requests.

    (4) Yes it is possible. You can define and initialize a Boolean variable with the results you get from the table based on the menu items should be made visible.

    (5) If you use the approach to point 4, then also you have to loop through the table menu items and set Boolean variables of bean. Yes you are right for the second part.

    (6) I'm not sure about this approach. How will you map it to your menu mode. It takes research.

    (7) before the page is loaded. I share with you links in above post with which you can do this.

    I hope this helps.

    Thank you

  • To access the elements of an array of elements based on the value of the attribute

    Hi all

    I create a BPEL 11 g process that calls a web service which returns a data table. I need iterator on the data elements and access based on their attribute value.

    Here is a sample web service load:

    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
       <env:Header/>
       <env:Body>
          <OutputParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/apps/inv/soaprovider/plsql/item_pub/get_item/">
             <GET_ITEM>
                <Row>
                   <Column name="ORGANIZATION_ID" sqltype="NUMBER">101</Column>
                   <Column name="ORGANIZATION_CODE" sqltype="VARCHAR2">MyOrg</Column>
                   <Column name="SEGMENT1" sqltype="VARCHAR2">MySegment</Column>
                   <Column name="DESCRIPTION" sqltype="VARCHAR2">Upload 445</Column>
                   <Column name="PRIMARY_UNIT_OF_MEASURE" sqltype="VARCHAR2">Each</Column>
                   <Column name="PRIMARY_UOM_CODE" sqltype="VARCHAR2">EA</Column>
                   <Column name="ITEM_CREATION_DATE" sqltype="VARCHAR2">01/21/2014 09:22:35</Column>
                   <Column name="ITEM_UPDATE_DATE" sqltype="VARCHAR2">01/21/2014 09:22:35</Column>
                   <Column name="REVISION" sqltype="VARCHAR2">0</Column>
                   <Column name="REVISION_LABEL" sqltype="VARCHAR2">0</Column>
                   <Column name="REV_CREATION_DATE" sqltype="VARCHAR2">01/21/2014 09:22:57</Column>
                   <Column name="REV_UPDATE_DATE" sqltype="VARCHAR2">01/21/2014 09:22:57</Column>
                </Row>
                <Row>
                   ...
                </Row>
                <Row>
                   ...
                </Row>
             </GET_ITEM>
          </OutputParameters>
       </env:Body>
    </env:Envelope>
    

    How can I get some columns based on the name of the column attribute?

    I tried to do this:

    bpws:getVariableData('getItemResponse','body','/ns7:OutputParameters/ns7:GET_ITEM/ns7:Row[$partIndex]/ns7:Column[@name='SEGMENT1'])
    

    and

    bpws:getVariableData('getItemResponse','body','/ns7:OutputParameters/ns7:GET_ITEM/ns7:Row[bpws:getVariableData('partIndex')]/ns7:Column[@name='SEGMENT1'])
    

    but I got this compilation error:

    Error (157): xpath expression "bpws:getVariableData ('getItemResponse', 'body','/ ns7:OutputParameters / ns7:GET_ITEM / ns7:Row [bpws:getVariableData('partIndex')] / ns7:Column [@name = 'SEGMENT1'])" appearing is not valid, because XPath query syntax error. The syntax error occurs when parsing bpws:getVariableData ('getItemResponse', 'body','/ ns7:OutputParameters / ns7:GET_ITEM / ns7:Row [bpws:getVariableData('partIndex')] / ns7:Column [@name = 'SEGMENT1']) expression XPath, posted on 112. The XPath query syntax was false; the exception was: anticipated :). Check the detailed origin described in the text of the exception message and verify that the XPath expression that is named in the error message is correct. The XPath expression is defined in the BPEL process.

    I use JDeveloper 11.1.1.7.0

    Thanks in advance,

    Bill

    Use an entitlement and copy node and you can get it to work by using the syntax below.

    Assign an expression of the copy below syntax: -.

     

           

    Query="/ns1:GET_ITEM/ns1:row[$index]/ns1:column[./@name='Segment1']"/ >

           

         

    Query = "" / client: processResponse / client: result "/ >"

  • Show LOV based on the criteria of display

    Hello
    I have a list of SelectOneChoice in the column of the table. I want to display its elements dynamically based on the criteria of display. So that when I select a row in the table, the list should have only filtered points.
    I use Jdeveloper version 11.1.1.6.0. Here is the code SelectOneChoice.

    < af:selectOneChoice value = "#{row.bindings.IntegrationName.inputValue} '"
    label = "#{row." Bindings.IntegrationName.label}.
    required = "#{bindings." ManageProjectIntegration1.hints.IntegrationName.mandatory}.
    shortDesc = "#{bindings." ManageProjectIntegration1.hints.IntegrationName.tooltip}.
    ID = "soc5".
    readOnly = "#{rank." EnabledFlag eq 'ACTIVE' or backingBeanScope.managed_ManageProjectIntegrationBean.singleIntegration}.
    valueChangeListener = "#{backingBeanScope.managed_ManageProjectIntegrationBean.validateIntegrationName} '"
    Binding = "#{backingBeanScope.managed_ManageProjectIntegrationBean.integrationChoiceList} '"
    autoSubmit = "true" valuePassThru = "false".
    immediate = "false".
    contentStyle = "width: 180.0px;" >
    < f: selectItems value = "#{row.bindings.IntegrationName.items} '"
    ID = "si7" / >

    Thank you
    Harish

    Henin,

    Have you tried to create a list of model engine using the view criteria?

    http://www.baigzeeshan.com/2010/03/how-to-create-ADF-lov-with-view.html

    Arun-

  • Change the Label element based on the value of another element

    Hi guys,.

    I need to put a label of point (A) based on the value of another article (B). I did the following:
    I created a dynamic action.
    When B changes:
    1. present the value of B
    Article 2-updated
    Is element A label: myitem & b.

    Any ideas?

    Best regards
    Fateh

    His work! Check it out now

    Just do it

    $('#mylabel').children('label').children('span').text($v('P1_A'));
    

    Published by: VC on June 9, 2012 11:21

  • Dynamic action - set a value of element based on the selection of lines of report

    Hi people,

    Does anyone have an example how to set up a dynamic action, which could fill an element with the selected ID based on the selection of line of the report on the same page?

    Demo:
    http://Apex.Oracle.com/pls/Apex/f?p=19543:2

    If I select an item in the report, then I would fill in 'Selected ID' element with the value of the selected report EMPNO line.


    Later, I would use it for the display of parts of master / detail on the same page.

    Thank you very much
    Tomas

    For this sample page, add the following JS code to run when the page is loaded.

    $('.highlight-row td').click( function(){
      //fetch record id from the cell contents of first column in row
      id = $(this).parent().children('td:eq(0)').text();
      //set page item to selected id
      $('#P2_SELECTED_ROW').val(id);
    });
    
  • How to hide a field based on the value of a field of a different subform - controls null does not work!

    I use Javascript to define actions. I need to hide a text field, if the value of a field in another subsidiary form is zero.

    -J' tried to check the value in the other field NULL - does not work

    -J' tried affecting a variable str2 where I know that the value in the other field is available, then checking this variable when I initialize the text field - does not work

    What Miss me?

    Hello.

    Try this in the form of native void, referring to the text field (X).

    If (this.rawValue = 1)

    {

    X.Presence = "visible";

    }

    ElseIf (this.rawValue = null)

    {

    X.Presence = 'hidden ';

    }

  • Deactivating a page element based on the value of another element on the page

    Hello
    I have a page element I want to turn off if the value of another article (drop-down list item) is set to a specific value. I followed the example in the book 'Pro Oracle APEX"(p.320) in this regard. He ordered me to do this in the HTML form element attributes for the element section:
    OnChange = "htmldb_item_change (this); html_DisableOnValue (This, 'Closed', 'P3_PRIORITY', 'P3_ASSIGNED_TO'); »

    It works very well. It disables the element I want to disable. HOWEVER, it does not neutralize the article unless the element with the onchange attribute is changed.

    How can I add features to disable the second element, even if the first element does not change, but contains the value 'Closed' when the user of the first load of the page?

    Thanks for your help and your insight!
    -Reid

    Hello Reid,

    The easiest way would be to (also) a Condition only read the item that you want to disable.

    Greetings,
    Roel

    http://roelhartman.blogspot.com/

  • County, based on the soundex function

    Hi all

    I a bit confused with request asked of me.
    the query is
    indicate the account number of the last part of each word in the same row according to the soundex function
    for example
    the first line has set out four in the same line
    ACD BCD AAA
    AFD BCF
    BDE AAC AFC
    BCF AAE
    Does it say I have divided the each statement and get soundex for the last part which is located in this example is------.
    AAA
    BCF
    AFC
    AAE 
    So the soundex only for AAA and AAE is same average I've update table b in the column of Gen by two and son on for others.
    create table  a(id number(9), Gen_Value varchar2(200));
    
    insert into a vlaues(1, 'ACD BCD AAA, AFD BCF , BDE AAC AFC,BCF AAE');
    insert into a vlaues(2, 'AVF BCD, BBA BBG BCEV, GACD MNF BCV');
    insert into a vlaues(3, 'AFC ABC, BBG HUH ABCE, JHU KK MNK');
    
    
    create table  b(id number(9), Gen_Value varchar2(200), id number(9));
    insert into b values( 'AAA', '0',1);
    insert into b values ('BCEV  ','0',2);
    insert into b values ('AFC','0',1);
    insert into b values ('BCD','0',2);
    insert into b values ('MNK','0',3);
    insert into b values ('ABCE','0',3);
    The result is
    Gen   count  id 
    AAA    2     1
    BCEV   2     2
    AFC     1     1
    BCD     1     2
    MNK    1     3   
    ABCE  2     3
    see you soon
    Benjamin

    Published by: 973907 on November 29, 2012 12:54 AM

    Published by: 973907 on November 29, 2012 12:55

    973907 wrote:
    We choose one of them. 'AAA' or AAE. or the word that has long term.

    No prob

    with data as (
     select
      id
     ,gen_value||',' gen_value
     from a
    )
    ,r  (id, gen_value, l) as (
     select
      id
     ,substr(gen_value, instr(gen_value, ',') + 1)
     ,substr(
       trim(substr(gen_value,1, instr(gen_value, ',') - 1))
      ,instr(trim(substr(gen_value,1, instr(gen_value, ',') - 1)),' ',-1)
     )
    from data
    union all
     select
      id
     ,substr(gen_value, instr(gen_value, ',') + 1)
     ,substr(
       trim(substr(gen_value,1, instr(gen_value, ',') - 1))
      ,instr(trim(substr(gen_value,1, instr(gen_value, ',') - 1)),' ',-1)
     )
    from r
    where
    length(gen_value) > 0
    )
    
    select
     soundex(l)
    ,count(*) cnt
    ,max(l) keep ( dense_rank last order by length(l), l desc nulls first) v
    from r
    group by
     soundex(l)
    order by
     1
    
    SOUNDEX(L) CNT V
    A000 2 AAA
    A120 3 ABCE
    B210 3 BCEV
    B230 1 BCD
    M200 1 MNK 
    
  • Customize a page based on the SQL function

    Hello

    Please someone help me solve this problem.

    In a page I am Image. By clicking on the image, a page will open. The image is created using the code of the controller.

    The values are displayed in the second page based on the clicked image.

    While the page is being prepared a SQL function must obtain an entry and based on the input TextField should be changed to read-only or not.

    Thanks in advance,
    Roselyne

    There is no log file for OFA...

    Set the profile FND: Diagnostics to 'yes '.

    You can see the error on the screen.

    Prasanna-

Maybe you are looking for