How to hide a field based on the value of a field in a different subform - null check doesn't work!

I'm using Javascript to set the actions. I need to hide a text field if the value of a field in another sub-form is null.
- tried checking the value of the other field for null - doesn't work
- tried setting a variable str2 where I know the value of the other field is available then checking that variable when I initialize the text field - doesn't work
What am I missing?

Hi.
Try this in the originating sub form referring to the text field (X). 
if (this.rawValue = 1)
          X.presence = "visible";
else if (this.rawValue = null)
          X.presence = "hidden";

Similar Messages

  • How to Visible/Hide an Item based on the value of another Item

    Hi
    I need to visible and hide a textitem based on the value of another item.This form has 3 blocks, and the both item is in the first Master Block.
    My code is:
    if :RECORDTYPE=7 then
         Set_Item_Property('BLOCK.ITEM',VISIBLE,PROPERTY_TRUE);
         Set_Item_Property('BLOCK.ITEM',ENABLED,PROPERTY_TRUE);
    ELSE
         Set_Item_Property('BLOCK.ITEM',VISIBLE,PROPERTY_FALSE);
    Set_Item_Property('BLOCK.ITEM',ENABLED,PROPERTY_FALSE);
    :BLOCK.ITEM:=NULL;
    end if;     
    I wrote the code in the Validate Trigger, but not working when moving Next Record & Previous Record
    Thanks in advance
    Rizly

    Read the 'Propagation of Property Changes' section towards the end of the page for Set_Item_Property in the online help. I'm not sure what you mean by locking automatically but perhaps it's because of this.
    You should also ensure the item you're setting to invisible is not the current item (check :system.cursor_item and go to a different item if necessary).

  • Change value of another field based on the value of selectOneRadio

    Hello
    I need to display one of two city fields based on the value of a radio group. If the value of the radio group is "Yes", then display the non mandatory city field, if the value is "No", then display mandatory city field. Please can someone help me? The code is below
    <af:subform id="contactForm3" default="true">
                <af:panelForm binding="#{processScope.backing_regDetails.contactPanel3}">
                  <af:selectOneRadio binding="#{processScope.backing_regDetails.radio1}"
                                     labelAndAccessKey="#{MatrixResource['ContactDetails.inBoroughQuestion']}"
                                     layout="horizontal"
                                     valuePassThru="true"
                                     required="true"
                                     onchange="javascript.refresh;" >
                      <f:selectItems value="#{processScope.backing_regDetails.items}" />
                  </af:selectOneRadio>
                  <af:inputText onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                labelAndAccessKey="#{MatrixCommon['Label.SAO']}"
                                binding="#{processScope.backing_regDetails.houseNameText}"                           
                                maximumLength="240"/>
                  <af:inputText required="true"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value=0;"
                                maximumLength="240"
                                label="#{MatrixCommon['Label.PAO']}"
                                binding="#{processScope.backing_regDetails.numberStreetText}"/>
                  <af:inputText onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                maximumLength="240"
                                labelAndAccessKey="#{MatrixCommon['Label.District']}"
                                binding="#{processScope.backing_regDetails.districtText}"/>
                  <af:inputText maximumLength="60"
                                rendered="#{!backing_regDetails.radio1}"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                labelAndAccessKey="#{MatrixCommon['Label.TownCity']}"
                                required="true"
                                binding="#{processScope.backing_regDetails.cityText}"/>
                 <af:inputText maximumLength="60"
                                rendered="#{backing_regDetails.radio1}"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                labelAndAccessKey="#{MatrixCommon['Label.TownCity']}"
                                required="false"
                                binding="#{processScope.backing_regDetails.cityText}"/>
                  <af:inputText maximumLength="60"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value='0';"
                                labelAndAccessKey="#{MatrixCommon['Label.County']}"
                                binding="#{processScope.backing_regDetails.countyText}"/>
                  <af:inputText columns="7"
                                onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value=0;"
                                labelAndAccessKey="#{MatrixCommon['Label.Postcode']}"
                                binding="#{processScope.backing_regDetails.postcodeText}"/>
                  <af:selectOneChoice onchange="javascript:document.forms[0].elements['contactForm3:locationId'].value=0;"
                                      binding="#{processScope.backing_regDetails.countrySelect}"
                                      value="#{processScope.backing_regDetails.enteredAddress.countryId}"
                                      labelAndAccessKey="#{MatrixCommon['Label.Country']}">
                      <f:selectItems value="#{backing_regComponents.countryChoiceList}"/>
                  </af:selectOneChoice>
                  <af:inputHidden value="#{processScope.backing_regDetails.enteredAddress.locationId}"
                                binding="#{processScope.backing_regDetails.locationIdHidden}"
                                id="locationId"/>
                  </af:panelForm>
                  </af:subform>Edited by: aademola on Nov 13, 2008 7:35 AM
    Edited by: aademola on Nov 13, 2008 7:42 AM

    Hi,
    you should be able to apply this example to your 10.1.3 project
    see 4.3.2 of http://download.oracle.com/docs/cd/E12839_01/web.1111/b31973/af_lifecycle.htm#CIAHCFJF
    Frank

  • F4 help based on the Value in other field

    Hello
    I have a requirement in which there are two fields say field1 and field 2 in an ALV grid (in which  new data can be entered). The F4 help of field 2 should be based on the value  the user enters on field1.I have checked out the BC_ALV* programs but there are no clear help .
    I have tried setting the parameter id of the first field value and then get that parameter id on_f4 event of the second field.But where can i set the parameter id of the first field . on_f4 of first field does not have its value and there is no event after_f4 . There is a parameter e_afterf4 in data change event but to tirgger that there shud be some event right.
    Moreover If at all i get the first field value , i can use FM F4_int_table_value_request to show the refined f4 in field 2 . But I am passing the a field symbol table in my grids set table for first display . what can i pass as parameters here to the FM  F4_int_table_value_request?

    hello Kallu ,
      gt_f4_wa-getbefore  = 'X'. --->refreshing layout before F4
      gt_f4_wa-chngeafter = 'X'--> refreshing layout after f4.
    see the sample code of F4...no need to pass dynpro details.....
    *---locals.
      data:  lt_return type table of ddshretval,
             ls_return type ddshretval,
             begin of lt_kostl occurs 0,
              kokrs type kokrs,
              datbi type datbi,
              bukrs type bukrs,
              prctr type prctr,
             end of lt_kostl,
             ls_f4           type  lvc_s_modi.
      field-symbols: <ls_wa>         type any,
                    <t_f4> type lvc_t_modi.
    *---get defalut values.
      refresh lt_kostl.
      select kokrs
             kostl as prctr
             datbi
             bukrs
        from csks
        into  corresponding fields of table lt_kostl
               where kokrs eq g_kokrs
                 and datbi ge sy-datum
                 and bukrs eq yfit_00049-bukrs.
    *---call fm to display int values.
      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
          retfield        = 'YFIT_00050-PRCTR'
          window_title    = 'Profit Center list'
          value_org       = 'S'
          display         = space
        tables
          value_tab       = lt_kostl
          return_tab      = lt_return
        exceptions
          parameter_error = 1
          no_values_found = 2
          others          = 3.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      else.
        read table lt_return into ls_return
                   with key fieldname = 'F0004'.
        if sy-subrc eq 0.
          assign er_event_data->m_data->* to <t_f4>.
          ls_f4-fieldname = e_fieldname.
          ls_f4-row_id    = es_row_no-row_id.
          ls_f4-value     = ls_return-fieldval.
          ls_f4-error     = space.
          ls_f4-tabix     = space.
          ls_f4-style     = space.
          ls_f4-style2    = space.
          ls_f4-style3    = space.
          ls_f4-style4    = space.
          append ls_f4 to <t_f4>.
        endif.
      endif.
      er_event_data->m_event_handled = 'X'.
    regards
    Prabhu

  • ADF Table cell color based on the value in that field

    Dear All,
    I want to create a table for our new application which contains a table used to represent the data in a chart format or matrix format,
    and each cell of the table should be filled with a colour out of three colors, based on the value belongs to which range eg:(1-8 ->green, 9-20 - yellow etc),
    I dont know how to implement this. Please help...
    Ranjith

    Check this out.
    How to highlight ADF table row based on column value?
    -Arun

  • Sorting an ArrayList based on the value of a field in one of the objects.

    Hi,
    I have the following problem:
    A server app returns an array list of simple objects with a bunch of fields.
    One of these fields is an int.
    How do I go about sorting the list based on the size of the int?
    Thanks in advance!

    Thanks a lot.
    The Comparator solution is actually ridiculously simple.....
    public class MyComparator implements Comparator {
    public int compare(Object o1, Object o2) {
         if (Integer.parseInt(((ZMData)o1).getAantalposts())>Integer.parseInt(((ZMData)o2).getAantalposts())) {
              return 1;     
         if (Integer.parseInt(((ZMData)o1).getAantalposts())<Integer.parseInt(((ZMData)o2).getAantalposts())) {
              return -1;     
         return 0;
    }Thanks again.

  • Can we change the data type of a field based on the value of the field

    HI Gurus,
    My Requirement is as below -- Could you please guide me
    in the Printable Adobe form -- for ex - as usual for dates fields in the Object Pallette the object type is a date/time field  and for quantity/currency fields corresponding fields are taken
    now in case the either the date, quantity or currency is initial in place of displaying 0.00 or empty date we need to display N/A (Not Applicable)
    for this I would like to change the data type of the field
    to put it simply --
    we need to change the data type of date field from DATE&TIME to Char type to hold N/A or  Quantity field to Char field to hold N/A
    how can we realize this in SAP adobe forms
    Thanks in Advace
    Ramchander Rao.K

    Hello Ramchander,
         You cannot change the data type of the field at run time in Adobe forms because the type of field you choose at the time of design level is associated with the data type itself.
    If you want to achieve your requirement, then your main idea should be to set the data type as CHARACTER itself while designing the field in the adobe form itself. CHAR field will comfortably hold the value of Calculation/amount field, Currency field, Amount, Date, Time HHMMSS, Unit Accuracy, Currency key, Floating point number, Numeric text, Client, Language and many other data types.
    After designing the field as TEXT field in Adobe form you have two options.
    Option 1:
    Select the Date field initially as type TEXT field or CHAR field in Adobe forms.
    Suppose the name of the field is TEXTFIELD1, then write the Javascript code on this field in Initialize event as below.
    if ( this.rawvalue == null )
         this.rawvalue = "N/A";
    If the field is not blank, then it will show the date. Else it will show "N/A".
    Option 2:
    Select the Date field initially as type TEXT field or CHAR field in Adobe forms. Do the formatting part in ABAP itself. It will increase the performance. Avoid Javascript as much as possible.
    Suppose you have a DATE variable l_dats of type DATS. Then take another variable l_date of type CHAR. Then write the below ABAP code.
    MOVE l_dats TO l_date.
    IF l_date IS INITIAL.
         l_date = 'N/A'.
    ENDIF.
    Bind the l_date to the TEXT field in the form.
    Even in this case, if the field is not blank, then it will show the date. Else it will show "N/A".
    But I will suggest you to use Option 2 of keeping the AMOUNT, QUANTITY, DATE, TIME fields etc as CHAR or TEXT fields in Adobe form and do the required formatting in ABAP itself.

  • How do I remove an icon from the dock of an iMac 10.9.5.?  Dragging doesn't work although I have tried a number of different places.  I recall right clicking used to give me a remove option.

    How do I remove an icon from the dock of an iMac Maverick, 10.9.5?  I've tried dragging different places: desktop, finder list etc.  No luck.

    Drag up towards the centre of the screen & hold for a second or so. The icon will have the 'smoke cloud' appear, let go & it will be removed.
    There should also be a 'Remove from Dock' option in the popup menu. It is in the 'Options' section . ctrl+click will 'right click' if right clicking is disabled.
    If this is not possible the Dock is locked (this may happen on a 'Managed Mac' normally setup by a company or school etc). See your tech support in this case.

  • Filter data based on the value of sorce field in mapping

    Hi,
    I have a scenario (IDOC to file) where i have to move data to target file,  only when one of the source fields has particuler value. Otherwise skip the record, no need to write into output file.
    Please let me know how to handle it in mapping, without BPM.

    Karthik,
    Ofcourse there is no need of BPM, You can use the IF without Else function in your mapping with using Equals function.
    Example:
    Field1 ---> Equals (Particualr Value) -
    > IF -
    > Then -
    > pass it to Target field.
    Since there is no Else option, therefore whenever condition will fail, nothing will be passed to the target field.
    Regards,
    Sarvesh

  • Populate one text field on a form based on the value in another

    I am new to APEX and building my first application.
    When a user enters a value in one field, I would like to run a SQL command and then display a value in another field based on the value in the first field. For instance, if a user enters a part number in one field, when they tab off of the field, I would like to display the name of the part in the part name field.
    Thanks

    Thanks. That put me on the right track. I used that link to find the link http://htmldb.oracle.com/pls/otn/f?p=11933:11:2890374750690437 and then using the two was able to put together a solution.
    I am down to one last issue. I am able to return the name back from the process and display it with an alert statement. Unfortunately, I am unable to display the value on the form.
    I am doing the following.
    <script language="JavaScript1.1" type="text/javascript">
    function f_getCustomerName(id)
    var v_id = id;
    var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=getCustomerName',$v('pFlowStepId'));
    get.addParam('x01',$v('P2_CUSTOMER_ID'));
    gReturn = get.get();
    get = null;
    gReturn = (!gReturn)?'null':gReturn;
    /* The below do not work
    $s('P2_CUSTOMER_NAME',gReturn);
    document.getElementById('P2_CUSTOMER_NAME').value = gReturn;
    document.getElementById('P2_CUSTOMER_NAME').value = 'TEST';
    alert(document.getElementById('P2_CUSTOMER_NAME').value );
    alert(gReturn);
    //-->
    </script>
    Process: getCustomerName
    declare
    l_customer_id customer.customer_id%type;
    l_customer_name customer.customer_name%type;
    begin
    l_customer_id := to_number(wwv_flow.g_x01);
    select customer_name
    into l_customer_name
    from customer
    where customer_id = l_customer_id;
    htp.p(l_customer_name);
    end;

  • Populate text field based on the lov selected value

    Hi,
    based on the value selected in lov, i want to populate another text field. Below is the code I have written
    In PFR:
    if(pageContext.isLovEvent())
    String lovInputSourceId = pageContext.getParameter(SOURCE_PARAM);
    if ("lovCategory".equals(lovInputSourceId))
    java.util.Hashtable lovResults = pageContext.getLovResultsFromSession(lovInputSourceId);
    if(lovResults!=null)
    String value =(String)lovResults.get("lovCategory");
    amobj.categorycode(value);
    AMImpl code:
    public void categorycode(String code) {
    sundryCodeVOImpl vobj = getsundryCodeVO1();
    vobj.setWhereClause( "lookup_code = "+"'"+code+"'");
    vobj.reset();
    vobj.executeQuery();
    String desc = vobj.first().getAttribute("Description").toString();
    String attr = vobj.first().getAttribute("Attribute1").toString();
    testEOViewImpl vobj1 = gettestEOView1();
    vobj1.getCurrentRow().setAttribute("CodeDescription",desc);
    vobj1.getCurrentRow().setAttribute("PurchasingCategoryCd",attr);
    vobj1.executeQuery();
    With this code, the updated values for the attributes CodeDescription, PurchasingCategoryCd are getting inserted into the database table but they are now showing up in the text fields when a value is selected in lov.
    Please tell me what is the mistake I'm doing.
    Thanks
    Sunny

    I'm using Lov Map to populate the lov field say field A. But I need to populate another field say field B based on the value selected in field A.
    to give an example of my requirement. Consider a view object having attributes col1,col2,col3 and having following data.
    col1--col2--col3
    1-----a-------x
    2-----b------y
    3-----c------z
    I 'll populate the lov of field A with values in col1. when user selects value 1 in field A. automatically field B should show value 'a'. If user selects value 2 in field A, field B should show value 'b' so on.
    Thanks
    Sunny

  • Plot a chart dynamically based on the values selected

    Hi All,
    I have some requirement like this i want to plot a chart . The chart should change dynamically based on target_name and date. What type of UI should I use ? I tried using multiselect or shuttle for choosing the target_name and date picker tool for date once i choose all this the chart should appear. Can I have a custom button called submit so once all the values are entered it plots chart ? Please help me out with our ideas.
    Thanks in Advance

    Hi,
    Using the dependent value sets you can govern the values which can be selected based on a specific value selected in a particular segment. Example if Country name is selected in segment 1 then specific states names as per the country selected can be displayed in segment 2.
    As per the requirement described you want to enable different fields based on the value selected in segment1, currently there is no standard mechanism available to enable/disable fields based on a value and you will have to do an extension/customization to meet this requirement.
    Thanks,
    Sanjay

  • Setting the Link Group Name in  Deep Link based on the value of a column

    Using Jdeveloper 11g, Jheadstart 11g
    Is it possible to override the link group name in deep linking. For example can I conditionally set that field based on the value of the item.
    Regards
    Edited by: aliegeh on Jul 25, 2010 8:35 AM
    Edited by: aliegeh on Jul 25, 2010 8:43 AM

    Thanks for the suggestion.
    Here is what I am trying to do:
    I have a table with one visible column that has the following entries:
    1. Create
    2. Modify
    3. Verify
    4. Approve
    5. View
    If the user clicks on row 1 (Create) then the link group name should be "CreateEmployees" to create new employees
    If the user clicks on row 3 (Verify) then the link group name should be "MaintainEmployees" for verification and so on.
    (This is role based and each role will have access to one or more of the rows in the tabler)
    It basically mimics a work-flow type of scenario.
    I tried to modify the template and looked at the line:
    action="$JHS.facesConfigGenerator.addItemGroupLinkTaskFlowCall((${JHS.Current.item})}" but got stuck there.
    Is there a way to change "JSH.current.item" in the template to read the group link name from another column say by using #if statements.
    One way I also tried was to introduce a column for each action such as CreateAction, VerifyAction etc which kind of agrees with your suggestion but the drawback is the need to modify the table if another task is required.
    Regards
    Edited by: aliegeh on Jul 25, 2010 8:36 AM
    Edited by: aliegeh on Jul 25, 2010 8:42 AM

  • Fields required based on a value in another field

    Hi,
    I am looking to have fields required (Annual Revenues and # of Employees) based on the value of another field (Ownership). Basically, if the value is Public the user is required to enter the Annual Revenue and Employees fields. I thought about using dynamic layouts but the only key field for Accounts is Account Type.
    Thanks,
    Caryn

    Hi Caryn!
    I think it is not possible for making #Employees and Revenues required depending on Ownership(as it is a look up field).. it should be possible if you want to do it on any other criteria other than ownership by just renaming the Account Type, Disable all the values of Account Tyope add new values to Pick List and make it driving picklist upon your requirements..
    If you require Account Type, create a custom picklist "Account-Type" and add the values.

  • How to enable/disable the input fields based on the data entered/user action in the web dynpro abap?

    How to enable/disable the input fields based on the data entered in the web dynpro application abap?  If the user enters data in one input field then only the next input field should be enabled else it should be in disabled state. Please guide.

    Hi,
    Try this code.
    First create a attribute with the name readonly of type wdy_boolean and bind it read_only property of input field of which is you want to enable or disable.
    Next go to Init method.
    Set the readonly value as 'X'.
    DATA lo_el_context TYPE REF TO if_wd_context_element.
         DATA ls_context TYPE wd_this->element_context.
         DATA lv_visible TYPE wd_this->element_context-visible.
    *   get element via lead selection
         lo_el_context = wd_context->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_context IS INITIAL.
         ENDIF.
    *   @TODO fill attribute
    *   lv_visible = 1.
    *   set single attribute
         lo_el_context->set_attribute(
           name =  `READONLY`
           value = 'X').
    After that Go to the Action  ENTER.
    First read the input field ( first input field, which is value entered field) , next give a condition
    if input value is not initial  then set the readonly value is '  '.
    DATA lo_nd_input TYPE REF TO if_wd_context_node.
         DATA lo_el_input TYPE REF TO if_wd_context_element.
         DATA ls_input TYPE wd_this->element_input.
         DATA lv_vbeln TYPE wd_this->element_input-vbeln.
    *   navigate from <CONTEXT> to <INPUT> via lead selection
         lo_nd_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
    *   @TODO handle non existant child
    *   IF lo_nd_input IS INITIAL.
    *   ENDIF.
    *   get element via lead selection
         lo_el_input = lo_nd_input->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_input IS INITIAL.
         ENDIF.
    *   get single attribute
         lo_el_input->get_attribute(
           EXPORTING
             name =  `VBELN`
           IMPORTING
             value = lv_vbeln ).
    if lv_vbeln IS not INITIAL.
        DATA lo_el_context TYPE REF TO if_wd_context_element.
        DATA ls_context TYPE wd_this->element_context.
        DATA lv_visible TYPE wd_this->element_context-visible.
    *  get element via lead selection
        lo_el_context = wd_context->get_element( ).
    *  @TODO handle not set lead selection
        IF lo_el_context IS INITIAL.
        ENDIF.
    *  @TODO fill attribute
    *  lv_visible = 1.
    *  set single attribute
        lo_el_context->set_attribute(
          name =  `READONLY`
          value = ' ' ).

Maybe you are looking for

  • FM working but variable is not getting displayed

    Hi Experts I have created Function module as below for BEx Variable.   c_eq(2)  type c value 'EQ',    " for between             C_i(1)   type c value 'I',     " for inclusive             C_space(1) type c  value  ' ',             c_1(1)   type n valu

  • Problems to download photos from iPhone since ver 8.0

    Since I updated the SW to ver 8.0 I have problems to get the pictures out of my iPhone towards my Windows 8.1 PC (before it worked) Before I connected it to my PC and my iPhone 5S appeared as a harddisk with a DCIM folder. Inside it, and as it looked

  • ODS Objects in update rules

    Hello, I'm using an ODS object lookup in multiple update rotines, Is there a way to list all the update rules that uses the ODS object. for (e.g) I'm looking up ODS 51 in the update routines for ODS 53 and ODS 56 and also in other update rules, I wan

  • Unable to publish in the Activity Stream of my portal

    Recently I've been working on a Portal Site and in the page of Activity Stream, I couldn't publish anything after I clicked on "publish" button. This problem only happened on that specific space, not other spaces. Another thing I noticed is: under th

  • Workflow Agent Listener and Workflow Background Engine

    Hi all, I try to update roles via User Management responsibility but when applying them it throws the following warning: "Updates to Role data will not be visible in the application until the following processes are started : Workflow Agent Listener