How to hide a form view field dynamically based on condition?

Actually I have two dropdowns. First dropdown has two entries( Yes and No). If I select YES in the first dropdown then second dropdown will get hide as well as if I select NO in first dropdown then the second dropdown will be show as mandatory(*) and populate with some entries.
Kindly help me out with the code.
Regards
Munna.

Hi Munna,
You can control the dynamic field hiding by using the form iterator class.
Please follow the below step to hide the field,
First create custom class with interface IF_CHTMLB_FORM_ITERATOR, then add the code in RENDER_CELL_START and constructor methods.
You need to add the below code in your .htm page
lr_form_iterator type ref to "new class name.
create object lr_form_iterator
  exporting iv_context_node = BTCUSTOMERH iv_opport_h = BTOPPORTH.( these are context nodes you need to pass which are having your fields, so that you can access the fields inside the render_cell_start method)
  cl_chtmlb_config=>set_iterator( lr_form_iterator ).
You need to write the code in Render_cell_start method of the new class. You need to access the context nodes to the new class and then use them to get the field1 value. If the field1 value is YES you can set empty instance to the EV_REPLACEMENT_BEE for the field2.
lv_current = gv_context_node->collection_wrapper->get_current( ). " you can set the gv_context_node in constructure method.
    IF lv_current IS BOUND.
      lv_current->get_property_as_value(
                              EXPORTING
                                iv_attr_name = 'Field1'
                              IMPORTING
                                  ev_result = lv_trailclass ).
    ENDIF.
data: lv_bee TYPE REF TO cl_bsp_bee_table.
if field1 = YES.
Case iv_bidnding_string
when 'Field2'.
create object lv_bee.
EV_REPLACEMENT_BEE = lv_bee.
endcase.
You can use the below link for more details
Change Property of the Label and Input field in UI for Form View - Part 2
For the second issue, you can achieve it by modifying the get p and Get V method of the second attribute.
let me know if you need more clarification on this.
Best Regards,
kasi.

Similar Messages

  • How to hide the select-options fields on radiobutton select in webdynpro

    hi
    Could you please help how to hide the select-option fields in webdynpro
    there are four radio buttons
    for every radiobutton there is corresponding the select_option filed is associated to it
    user as only provision select  one radio button and reset of the select-option fileds should be hidden
    which ever the radio button is selected corresponding the select-options fileld should be displayed
    please find the attachement below

    Hi Nine,
    To hide select options you should use interface method REMOVE_SELECTION_SCREEN_ITEM of IF_WD_SELECT_OPTIONS.
    Sample code :
    Write the below code in the Event handler of Radio Button.
    DATA lv_r_helper_class TYPE REF TO if_wd_select_options.
    lv_r_helper_class = lo_interfacecontroller->init_selection_screen(
    lv_r_helper_Class->REMOVE_SELECTION_SCREEN_ITEM(exporting i_id = 'Select_option1_id1').
    This will hide first select option of your screen.Similarly pass select_option_id2 to hide it and so on.
    Regards,
    Ravikiran.k

  • How to hide OM infotype screen field

    Hello Experts.
    Please let me know how to hide OM infotype Screen field ? i want to hide Percentage field on IT1011.
    I know i can create alternative screen "Z" and hide the field and attach alternative screen to the Module pool.
    Please let me know if i can do this using BADI so there will not be any change to standard.
    Regards,
    Saurabh

    Hi Shiva,
    To get the detail about a table filed you can use DDIF* function module.
    Here in this particular case you can use FM   DDIF_FIELDINFO_GET.
    Pass the table name & field name.
    After executing that FM you can check   DFIES_TAB  in Tables parameter. i t will be having an entry.
    Check for filed name as   KEYFLAG  , if it is not initial ie.  X then supplied filed is Primary Key.
    If KEYFLAG is initial then supplied filed is not a primary key.
    Thanks & Regards
    Satyam

  • How to hide watermark when viewing in acrobat 8 standard

    Hi,
    2 of my colleagues (also having same versions of acrobat) manage to open a pdf file without the watermark showing.
    I have been googling around and found that there is an option to set.
    To specify when the watermark appears, select or deselect Show When Printing and Show When Displaying On Screen.
    But i couldn't find the option on my PC(windows xp). I would like to know how to hide the watermark when viewing in acrobat 8.?
    Thanks,

    Thank you, i understand now.
    so in that case, why does my 2 colleagues can view the pdf file with the watermarks hidden. While for me, i can see the watermark when i view the same file?
    appreciate your clarification.

  • How to hide the Media type field if no video is uploaded in paglayout

    Hi,
    I am creating a custom page layout with custom content type through visual studio 2010 for sharepoint 2010.
    i need to create a field which supports to upload a video file.
    so i created a site column and added it to my content type and added to my page layout.
    <Field ID="{7F5AE2F9-C1A2-4BFD-876C-56ECFB7B0210}" Name="Video" DisplayName="Article Video" Type="MediaFieldType"  Group="Article Layout Columns" />
    <FieldRef ID="{7F5AE2F9-C1A2-4BFD-876C-56ECFB7B0210}" Name="Video"/>
    In my page layout i added the field in both edit and display mode as
       <PublishingWebControls:MediaFieldControl ID="MediaFieldControl1" FieldName="Article Video" runat="server"/>
    All is well the video is displayed and i can add video.
    My req is i need to show the video div in display mode only if video is added else it should be hidden in display mode.
    how to do that?
    Aruna

    Hi,
    According to your post, my understanding is that you want to hide the Media type field if no video uploaded.
    After the video uploaded, the HTML of the Media Type Field will be changed. We can use jQuery to detect the change and hide/show it.
    The following script for your reference:
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function () {
    if($("selector")==""){
    $("divID").hide();
    </script>
    More information:
    http://msdn.microsoft.com/en-us/library/gg699337(v=vs.85).aspx
    https://api.jquery.com/hide/
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Display form view title dynamically..

    Hi Experts,
    I have a requirement could u plz give me some inputs..
    i am fetching account details based on account name. it is displaying both business partner and contact person details.
    when i select CP on the result then CP details is displayed in the top of form view along with contact person number on the top of the title like Identify Account (ID: 20000907). i want to change that contact person no into there corresponding BP number dynamically..
    plz refer the below image.
    thanks & regards,
    Srinivas

    Hi Fabian Mayerhofer,
    thanks a lot i full fill my requirement..
    this is the code i wrote in IF_BSP_WD_HISTORY_STATE_DESCR~GET_STATE_DESCRIPTION of view BuPaMainVS
    in component CRMCMP_BPIDENT.
    CONSTANTS:lc_bp_role1 TYPE bu_partnerrole VALUE 'BUP001'.
       DATA lv_bp_number      TYPE bu_partner.
       DATA: lr_cucobupa    TYPE REF TO cl_crmcmp_b_cucobupa_impl.
       DATA: lv_bp_role       TYPE bu_partnerrole,
             lv_bp_number2        TYPE bu_partner,
            lv_customer       TYPE string,
            lv_bp_partner TYPE bu_partner.
       TYPES : BEGIN OF ty_but100,
                partner TYPE but100-partner,
                rltyp TYPE but100-rltyp,
              END OF ty_but100.
       TYPES : BEGIN OF ty_but050,
               partner1 TYPE but050-partner1,
               partner2 TYPE but050-partner2,
               END OF ty_but050.
       DATA : lt_but100 TYPE STANDARD TABLE OF ty_but100,
              lt_but050 TYPE STANDARD TABLE OF ty_but050,
              ls_but100 TYPE ty_but100,
              ls_but050 TYPE ty_but050.
       TRY .
           lr_cucobupa ?= get_custom_controller( if_iccmp_global_controller_con=>cucobp ).
         CATCH cx_sy_move_cast_error.
           RETURN.
       ENDTRY.
       description = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_IC_APPL/IDENTIFY_CUSTOMER' ).
       IF lr_cucobupa->is_bp_search_done( ) EQ abap_true.
         lv_bp_number = lr_cucobupa->typed_context->customers->get_s_struct( attribute_path = 'STRUCT.BP_NUMBER' component = 'BP_NUMBER') .
    ENDIF.
         CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
           EXPORTING
             input  = lv_bp_number
           IMPORTING
             output = lv_bp_number.
         SELECT partner rltyp FROM but100 INTO TABLE lt_but100 WHERE partner = lv_bp_number and rltyp = lc_bp_role1.
    *    READ TABLE lt_but100 INTO ls_but100 WITH KEY rltyp = lc_bp_role1 BINARY SEARCH.
         IF sy-subrc = 0.
           SELECT partner1 partner2 FROM but050 INTO TABLE lt_but050 WHERE partner2 = lv_bp_number.
           IF sy-subrc = 0.
             READ TABLE lt_but050 INTO ls_but050 INDEX 1.
             IF sy-subrc = 0.
               lv_bp_partner = ls_but050-partner1.
               IF lv_bp_partner IS NOT INITIAL.
                 CONCATENATE lv_bp_partner ')' INTO lv_bp_partner.
                 CONCATENATE description '(ID:' lv_bp_partner INTO description SEPARATED BY space.
               ENDIF.
             ENDIF.
           ENDIF.
    ELSE.
           CONCATENATE lv_bp_number ')' INTO lv_bp_number.
           CONCATENATE description '(ID:' lv_bp_number INTO description SEPARATED BY space.
    endif.
    thanks & Regards,
    Srinivas

  • How to  hide information on the rtf template based on some condition

    Hi,
    I'm writing a new rtf template for our custom PO print program in EBS 11.5.10.. In reports 6i, you can have a format trigger on a frame or repeating frame and you can achieve this.. Can you please let me know if this is possible in XMLP and how can i do it..
    Thanks,
    Shree

    Hi Shree,
    see for example if you want to get the employees record group by department number then...in this case if you want to hide some columns of employees then use if condition...where you are using ur column name.....
    like this .....if you want to hide salary column for dept no 20 then
    if dept no<> 20 then sal end if;...... use this at the column def....
    its like a dynamic data column generation.....for the exact code you can refer to XML Publisher User Guide......Chapter is Creating RTF Template.....section is dynamic Data Columns...
    Regards
    Ravi

  • How to change the column header name dynamically based on sysdate

    Post Author: senthi_gokul
    CA Forum: WebIntelligence Reporting
    Dear All,
            i have designed some reports. i would like to change the column header dynamically based on sysdate. up to 24 months. can u help me, which add month function using the universe. i dont know if-then-else function is having the universe tool or not?

    Post Author: prasingh
    CA Forum: WebIntelligence Reporting
    Are you saying you are not able to create an object by value (select: statement) as sysdate and put it onto the headers of your report? You can use the add_months() function on the object to add the numbers of months you wish.
    Please let me knnow for more.. You can get in touch with me on [email protected] for quick reply. 

  • Creating Files Dynamically based on Condition

    Hi Experts,
    I want to create a scenario in which I want to have N number of target files based on some condition.
    Suppose I have following Source structure .
    <ns0:MT_Employee_Src xmlns:ns0="urn://FileToFile_ERD">
       <Details>
          <EmpId>1</EmpId>
          <Name>Rabi</Name>
          <Designation>ABAP</Designation>
       </Details>
          <EmpId>4</EmpId>
          <Name>Satya</Name>
          <Designation>ABAP</Designation>
       </Details>
    </ns0:MT_Employee_Src>
    My requirement is I want to have 2 different target files based on EmpId.
    And this should be dynamic that means N number of EmpId in my source will create N number of files.
    Can anyone help me to solve this?
    Any kind of suggestion will be appreciated.
    Thanks
    Rabi

    Hi All,
    As my requirement was to create N files dynamically based on some condition so I first used 1:N multimapping without BPM.
    Then I followed RP's steps.
    Follow those steps
    1) in the message Mapping go to Signature T..Outbounded.
    2)later go back to main tab . you shoud create a mapping like this:
    3)<EmpId>--> change the context to MT_Employee_Src. to do that press right button on the field and go to context menu option.
    map this field to the proper header target structure E.X: MT_Employee_Tgt
    4) doing this you will create as many target files as <EmpId> you receive.
    5) map the rest of the fields
    This is great.And  this helped me a lot and finally gave solution.
    I want to share one thing that I faced.
    when you are doing 1:N multi-mapping then you have to change the occurrence of target .
    Then your source and target structure will be changed .If you are taking the source schema from mapping then remove the extra tags those got generated due to multi mapping such as
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
    - <ns0:Message1>
    </ns0:Message1>
      </ns0:Messages>
    And then use the file and it will work fine.
    Thanks
    Rabi

  • How to hide a input text field in a login form.

    First of all let me state i'm kind of new to AS3.
    I'm making a login form, and i've managed to make it work,
    but when the form actually moves frames, both the user_field, and
    password_field, remains visible...
    What am I missing to make those fields disappear?.
    Here is my code.
    Elliot J. Balanza
    thanks.

    If I understood your task correctly - why not to use
    object.visible = false of remove them from container?

  • How to hide the Form Feed char in JTextArea

    We have reports (written in C) that are being displayed in a JTextArea.
    In our old app, the Form Feed character (ASCII 12) was invisible naturally without having to code around it. In a JTextArea, it appears as a "[]" character. Does anyone know how to make this character invisible to the JTextArea? Removing it is not an option, as it is needed for it's print routine.
    I've been searching these forums and the web all morning with no luck.

    Not sure how the Form Feed character worksIt lets the printer know that a new page is to be started at that point.
    Does it always appear with the New Line character?Usually but not always.
    Thanks for the reply. It's more involved than just printing standard lines of text, so perhaps I should have been more clear.
    The C report already has pagination built in from when it was run from our legacy GUI. In other words, each report knows how many chars wide and how many lines down each page will be. It is different for each report, but they all hover around 150 chars wide and 60 lines down per page, since they are all presented to the user (and printed) in landscape.
    In the C code: at the end of each report line a "\n" is appended. At the end of each page, an ASCII 12 character is appended. A header is at the top of each page (different for each report, but usually 2 or 3 lines) that shows the page # and other info.
    So, as you are viewing the report, you would see page 1 header, some report content, page 2 header, some more report content, page 3 header, etc. as you scroll down.
    So now if you view it in Java: if the user wishes to print, the report is sent to our ReportPrinter class, who tokenizes the report based on "\f" and makes a ReportPage object (implements Printable) for each token. Each ReportPage is then appened to a java.awt.print.Book object, who in turn is sent to the PrinterJob.
    Given that the report already has his pages figured out and has a form feed char at the end of each page, the report comes in to the JTextArea with [] chars preceding each page header (approximately every 60th line, depending on the report).
    I tried using a JTextPane, but no luck. It was also much slower reading in the report. I just want the textpane to not display the non-printable characters ("\f" in this case).

  • How to lock a form (all fields read only) using a button (JavaScript)

    Hi guys,
    I have a form with several input fields, check boxes. Using a button in the form, I would like to lock it using a JavaScript. Locking means in my case that all input fields, checkboxes, etc. are read only (cannot be changed anymore).
    I already use the following approach:
    data.form.MyInputField.access = "readOnly";
    The problem is, that this approach is not comforable from maintenance perspective. I would like a more generic or more simple way.
    Generic:
    loop over all fields and set them to "read only"
    Simple:
    xfa.form.lock; // but this does not work
    Do you have any ideas how to solve this requirement in another way as I currently do?
    Thanks,
    Thomas

    Now I used the following script:
    // set the whole form as container
    var objContainer = data.Report;
    // call the method to set all fields to read only (recursion)
    disableAllFields(objContainer);
    function disableAllFields(objContainer) {
         for (var i=0; i < objContainer.nodes.length; i++) {          
              switch (objContainer.nodes.item(i).className) {
                   case "field" :
                   case "exclGroup" :
                        objContainer.nodes.item(i).access = "readOnly";
                        break;
                   case "subform" :
                        disableAllFields(objContainer.nodes.item(i));
                        break;
                   default:
    It works but is there another possibilitiy such like
    form.lock;
    Thanks,
    Thomas

  • How to hide a report builder field if it is zero

    I am using Coldfusion Report Builder. If the value of a feild is zero, how can I hide it or show a blank. Keep in mind this field is a DollarFormat() field.

    scottnweber wrote:
    I am using Coldfusion Report Builder. If the value of a feild is zero, how can I hide it or show a blank. Keep in mind this field is a DollarFormat() field.
    When you click on the field in Report Builder, look near the bottom of the Properties window, in the "Print Control" section.
    You will see an entry labelled "Print When Condition". Put an expression next to it that returns true or false.
    For example, in your case, you would put something like the following:
    MyField neq 0
    Where "MyField" is the name of your field. This expression will only allow the field to be printed when its value is not zero.
    Since you're targeting the value of the field you don't have to worry about the formatting that you used next to "Expression" in the "Data" section of the Properties window.

  • How to hide folder region in a dynamic page application

    I am using a dynamic page with the following code to render a published portlet in a dynamic page. I can then control how the portlet displays when added the portlet to a custom page by an end user. I wanted to know if there is way to hide some of the portlet regions in the code. (example) Hide news and sub-folders.
    <ORACLE>DECLARE
    l_portlet_record portal30.wwpro_api_provider.portlet_runtime_record;
    BEGIN
    l_portlet_record.provider_id := 41325216;
    l_portlet_record.portlet_id := 56937;
    l_portlet_record.exec_mode := 1;
    l_portlet_record.has_title_region := FALSE;
    l_portlet_record.has_border := FALSE;
    portal30.wwpro_api_provider.show_portlet(l_portlet_record);
    END;
    </ORACLE>

    Moderator advice: Please don't post in threads that are long dead and don't hijack another poster's thread. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.
    Moderator action: Locking this thread.
    Moreover, your question is answered in this thread. Didn't you at least read it before resurrecting it?
    db

  • How to hide Interactive form in Web dynpro screen

    Hi all,
    I am working on an application where a user will enter the vendor number and based on that vendor the information of the vendor such as his name, address should get filled in the interactive form that we have created. I am able to get the vendor information at the back end and I have created a print button and hitting on that print button will actually fill the form. But now my problem is when I run the application the form is already displayed on the web dynpro screen (without any vlaues) and when I hit print button the form gets filled with correct values but I don;t want form to be pre displayed until and unless user hits print button. Can you please tell me how can I do this.
    Thanks,
    Rajat

    Hi Thomas,
    Thanks for quick reply.
    Let me explain you what I want... I am very new to webdynpro so my questions may sound very basic or may be weird.
    I have an application where the user will enter the vendor number on the web dynpro screen and then will hit the button PRINT and when he hits print  button the PDF form should be displayed on the web dynpro screen. So far when I run my application the vendor number (input field) is there and a print button is also there but beneath there is the whole interactive form is showing up (a balnk) and when I enter the vendor number and hit print the same form will get filled up with the required data.
    What I want is when I execute my application and on the web dynpro screen only the vendor number field and the print button should be visible and not the PDF form, the PDF form should only be displayed once user hit print button. I tried to change the value of the property from visible to none and what it did was the PDF form was not visible on the web dynpro screen on both the occassion i.e. when I execute the the web dynpro applkication and after when user hits print button.
    Thanks,
    Rajat

Maybe you are looking for

  • Here we go again.  You really have to be kidding, right?

    As of today, the complete 4 week new release list for music is gone again for the 3rd time since store 7 launched. Let's review: It was not until after the first week of the launch that the complete new release list was fully operable (first time sys

  • Flash in Iweb 08 not working on all internet browsers!

    I have incorperated flash movies into a site or two, for some reason they work fine if your using firefox or safari, but they don't work right if your using Internet Explorer. (which is what alot of people still use) I was just wandering if anyone el

  • DM Switch Device Wizard prompts in another language?. German maybe?.

    I recently switched from a Palm Treo 700p to a red Blackberry Curve 8330.  I installed the Desktop Manager using the User Tools CD and updated it to the most current version (4.7) without running into any problems.  However, when I try to use the Swi

  • Custom query returns inaccurate number

    I'm using the following report for sales analysis. The report works fine except that the resulting numbers in the columns "Units 1st Qtr", "Units Prior Qtr", "Units This Year", and "Units Prior Year" are ten times larger than they should be. The numb

  • Exporting to dynmic PDF file name

    Post Author: geraldo CA Forum: Exporting Hallo all, I'm using Crystal XI and looking for a solution to export reports into multiple PDF Files and using a dynamic database field name as the filename.pdfe.g. dynamic fiele is customer_id: 1234 output sh