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

Similar Messages

  • 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 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";

  • Setting default value for a jcombobox based on the value not the index

    I am trying to set the default value for my combobox to the current year. One way I thought of doing it was to get the index of the value representing the current year and then use setSelectedInex to make it the default. Any ideas?
    The relevent section of code is below.
    GregorianCalendar gregorianCalendar = new GregorianCalendar();
    int year = gregorianCalendar.get(Calendar.YEAR);
    String currentyear = year + "";
    int startyears = 2000;
    int numyears = 25;
    JComboBox endyearcombobox = new JComboBox();
    endyearcombobox.setBorder( BorderFactory.createLineBorder(Color.DARK_GRAY));
    endyearcombobox.setFont(standardfont);
    endyearcombobox.addActionListener( new ActionListener() {
    public void actionPerformed( ActionEvent event ) {
    endyearcombobox = ( JComboBox )event.getSource();
    endyear = endyearcombobox.getSelectedItem();
    boolean same = endyear.equals(oldItem);
    oldItem = endyear;
    String[] endyearlist = new String[numyears];
    for(int i = startyears; i < startyears+numyears; i++){
    String item = new Integer(i).toString();
    endyearcombobox.addItem(item);
    Thanks
    Ged

    Thanks mate,
    That was what I was looking for. I still had a little more manipulation to do, but sent me on the right track and have got it working now. I don't know why I didn't think of it in the first place.
    Ged

  • Get the the value in input field based upon the fast input field

    Hello Experts,
    i am new to webdunpro abap.
    i have a small doubt in webdynpro.
    isuue:-  i have two input filed one is for " MATNR" and second input filed " Material Description"
    I have to chhose the MATNR by pressing f4 (it is standard search help), it will come from MARA table.
    Once it is filled the second inputfiled  shoul filled automaticaly base upon the MATNR with readonly mode.
    Could any body send me the the splutin or any sample code for this
    Thanks in adv!!!

    Hi Rakesh,
                    You can Use OVS help to get your requirement done.
                    Follow the link to know how to use OVS in WDA
                    link : [http://www.****************/Tutorials/WebDynproABAP/OVS/page1.htm]

  • Can we return a value in two field based on a value select in LOV?

    Hello expert.
    i have a lov attached to a non-bind text field. when i select a value from non bind field lov, a record group of another LOV attached to a database item field generated. both text field are in same block.
    LOV record group query of non-bind field is:
    select cli_desc,cli from ivt_cli_mst
    mapping is done for same lov field.
    as: LOV record group query of database item_field :blk_stg_mst.item_cd is
    select a.item_cd,b.short_desc
    from storg_mst a,item_mst b
    where a.item_cd = b.item_cd
    and substr(a.item_cd,3,2) = :blk_stg_mst.nb_cli_cd(non bind LOV attached field)
    and a.store_cd= :blk_store_mst.store_cd
    order by item_cd
    requirement:
    i want as i select a value from LOV in non_bind field , value display in non_bind field as well as database item_field:
    i.e in :blk_stg_mst.item_cd also.
    please help.
    thanks yash

    hi,
    assign LOV to database item.(as usual setting the lov reuturn column to it). in the when validate item of database field assign value to no db field(something like if :db column is not null then :nondb_col := :dbcolumn).

  • 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;

  • 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

  • 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

  • The drop down list values want to vary based on the contents of another drop down field

    hi,
    hi in search page i have two drop down list. i have two tables and one mapping tables. service line and subservice line are tables and i have one mapping table. using rapid application i create one component using mapping table. now in search page i have two drop list. one is servline and another is sub serviceline. in service line i have values like 1,2 k  for subservice 3,4.5,6 for one service line ex. for 1 i have two subservice 3,4 and for 2 i have 5,6. now my requirment in if i choose service line 1 in first drop down list, automatically in second drop down list want to contain values 3, 4. before both the drop down list have values.if i chose one value the correponding mapping value want to come in drop down list in same context node.

    Hi,
    This requirement involves defining p-getter for the service type, and the v-getter of you sub type.
    Since this involves to populate the values of subtype attribute depending on value of service type, u need a round trip.
    This is done in the p-getter of the 1st attribute(service type in your case).
    In the v-getter of the 2nd attribute, 1st fetch the current value of attribute 1, then filter the value in the dropdown table according to ur logic.
    Ref :Drop down values in table view
    Regrads
    Anish

  • 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

  • PO Form with Terms & Conditions that Change Depending on a Value in Another Field

    Hi - I have read through the relevant topics in this forum and have attempted several of them without luck. I am currently working on a form in which there is an empty JFMain (I do not want to populate fields on this page since I don't want things in this page my "static" header - logos, title, etc. since the Terms and Conditions pages should not show any of this.) On my page 2, I have subforms for all my fields except my Terms and Conditions. (These fields are controlled by a data file.) On my remaining pages I have 3 sets of Terms and Conditions - all about a page long - hard-coded as text and placed in subforms with a dummy field off page to ensure they print. What I want to do is print the subforms from page 2 and then the applicable terms from page 3, 4, or 5 depending on the value in a field located in one of the subforms on page 2. What I currently get is my subforms and then ALL my terms printing. Any thoughts?
    My preamble overrides look like this:
    ^define group:D_HEADER \field$POSITION\reserve".11",in\subformHEADER.
    ^define group:G_HEADER @group:D_HEADER.
    ^define group:dummy!FldNotAvail \groupG_Terms_Private_Commodity
    ^define group:dummy2!FldNotAvail \groupG_Terms_Private_Services
    ^define group:dummy3!FldNotAvail \groupG_Terms_Public
    ^define group:JfEndData!EndData @group:D_end.
    I had to place the JFEndData! statement into the Preamble since the last subform with fields called before the Terms subforms has a global field from another subform above it. For whatever reason, it was duplicating this subform after printing the Terms and Conditions.
    I tried adding a nested if statement into field that will control when I want each subform to print but it was ignored. I also tried hardcoding a group call into the preamble with the logic as well with no results. If someone has example code they can share, this would be great.

    I receive Adobe help forum posts via email and I've been saving a few for the pointers they contain. I have some saved that might help you out a bit...
    A reply to the "Please can some one help me out......." post by Mr BoJangles on 10/29/2007 gives some information about forcing a subfield to be displayed.
    A reply to the "Conditional logic" post by Marco Degl'Innocenti on 8/2/2006 gives information on initiating a subform based on the value of a field in the data stream.
    A reply to the logic post by Marco DeglInnocenti on 2/22/07 also gives information on initiating a subform based on the value of a field.
    I hope these can be of help. If you can't access them on the forum I can repost them.

  • Acrobat XI - Populating value of a field based on another field

    pdf built in Acrobat XI
    New to this and I have tried every possible combination I can think of! For simplicty purposes, I have two text fields, Text1 and Text2. I want Text2 to populate based on the value entered into Text1. Have an Action event (Mouse Up) on Text1 as follows:
    var OneT = this.getField("Text1");
    var TwoT = this.getField("Text2");
    TwoT.value=OneT.value;

    [Moved to Acrobat JavaScript forum]
    If you name each field the same, the values will automatically be the same. But if you want to be able to change the value of Text2 after it is autopopulated, you should use a different script and a different event. The following custom Validate script for Text1 will set the value of Text2 when the value of Text1 changes:
    //Custom Validate script for Text1
    getField("Text2").value = event.value;
    If you only want to set the value of Text2 when it is blank, the code could be:
    // Custom Validate script for Text1
    // Get a reference to Text2
    var f = getField("Text2");
    // Only set it value if it is currently blank
    if (!f.valueAsString) {
        f.value = event.value;
    This allows the user to change the value of Text2 without it getting reset when Text1 is changed.

  • Setting the value of a field based on a dropdown list

    I am using the latest production release of JHeadstart 10.1.3.0.91. I am trying to set the value of a field based on selecting the value of another field (drop down list). The drop down list field has the following attributes set autoSubmit="true" immediate="true" valueChangeListener="#{jhsPageLifecycle.updateModelValue}".
    The other field has the partialtrigger set to the first field. ie "depends on" selection from JHeadStart file. The value of the second field is set in the setter of the VO RowImpl java file.
    The value of that field is only populated on the screen if it is set to disabled="true". This seems a bit bizzare behaviour. Can you explain why it cannot set the value of the field when it is not disabled.

    Worked out that if i set the "Clear/Refresh value" attribute on the field that i want updated then it will work ok
    Alan

  • 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.

Maybe you are looking for

  • How can we have cash discount as well as vendor payment terms

    We have vendor payment term of 2% 10 days, net 30. On top of it the vendor gives us 4% discount on certain POs where the total PO amount exceeds 20K. We want to have the 4% discount on the individual line item at the time of the invoice posting and t

  • Problem with decision

    Hello, I have a huge problem with my iPhone 5. After drop a loudspeaker(on the top) doesn't work, so I'm unable to talk with people. Also my front glass is broken, but it's not such a big problem. The question is should I try to sell iP5 and buy iP 5

  • JDBC Messages in Holding state

    Hi all, My scenario is jdbc to jdbc - get data from an stored procedure and execute some updates in other database system. What is happening that today all update messages (jdbc receiver) are set as sucessifull processed in sxmb_moni, but no informat

  • SQLCE Agent Replication Problem, maybe related to SQL Server not on default port

    I've got a problem getting the SQL Server CE Replication setup on a new server. SQL Server is 2008 R2 but we are running on a non-standard port (not 1433) and I'm not sure where I'd tell the agent that or if I need to. I've turned on full diagnostics

  • Appraisal Template - Issue with New Column addition.

    We have added one column u201CPriority %u201D which replaced an existing field (column) in one of the appraisal templates. When the user selects a value from the drop down and saves the template, it is not getting reflected in the portal.  Also the s