CA Service Management

 View Only
Expand all | Collapse all

Hide checkbox in tab except on certain category

Jump to Best Answer
  • 1.  Hide checkbox in tab except on certain category

    Posted Aug 10, 2016 12:43 PM

    We have a custom checkbox in our Outage tab, and we want to hide it except on a specific Category.

     

    I have followed this code successfully for conditionally hiding things via a checkbox: Conditionally display of field

    <PDM_MACRO name=dtlCheckbox hdr="test" attr=string1>
    jQuery(function(){

    jQuery(':checkbox').change(function(){
      if(jQuery(this).is(':checked'))
            {
      jQuery('select[name="SET.urgency"]').hide();
      jQuery('label[for="df_2_0"]').hide();
      }
      else
      {
      jQuery('select[name="SET.urgency"]').show();
      jQuery('label[for="df_2_0"]').show();
      }
    }

    )});

     

    But I'm having 2 issues.

    1) How do I select the value out of Category?

    2) How do get to the Outage tab checkbox?



  • 2.  Re: Hide checkbox in tab except on certain category
    Best Answer

    Posted Aug 10, 2016 01:07 PM

    Accessing controls with its id is not a good idea. If you move/delete/add control in your tab, the id may change.

     

    If you want to show it only on a specific category, you can do it with a pdm_if

     

    <pdm_if "$args.category.sym" == "CategoryName">

    <pdm_macro name=dtlCheckbox attr=attribute hdr=header>

    </pdm_if>

     

     

    And if you plan to show it on several category, you can add an attribute to your category : z_showSpecificCheckbox, integer.

     

    And

    <pdm_if "$args.category.z_showSpecificCheckbox" == 1>

    <pdm_macro name=dtlCheckbox attr=attribute hdr=header>

    </pdm_if>