CA Service Management

 View Only
  • 1.  Activating automatically a tab in cr detail screen

    Posted Mar 27, 2017 03:33 PM

    Hi there,

     

    I was wondering if it was possible to activate automatically a tab into cr detail screen based on certain conditions. For example, in an incident with service type, the "Service type" would be active. If there's Properties, the Properties would be active. And so on.

     

    My main question is: Is there any javascript function we could call for automatically activating these tabs on cr/in/pr detail screens?

     

    Thanks,

     

    Diogo



  • 2.  Re: Activating automatically a tab in cr detail screen

    Posted Mar 28, 2017 02:44 AM

    Hi Diogo,

     

    I understood, you can show or hide the tabs by conditionally. Following sample code may be answer your need.

     

    <PDM_IF "$args.properties.length" != "0">
       <PDM_MACRO name=tab title="Ek Alanlar" file="xx_prop_tab.htmpl">
      </PDM_IF>

     

    When the web engine generate the detail_cr.htmpl, if there is no property define then properties tab not shown.

     

    Also same think for service type tabs

     

    <PDM_IF "$args.sla_events.length" != "0">
       <PDM_MACRO name=tab title="Servis Türü" file="xx_stype_tab.htmpl" id=stype>
    </PDM_IF>

     

    Türker



  • 3.  Re: Activating automatically a tab in cr detail screen

    Posted Mar 28, 2017 08:54 AM

    This can do the trick but I think that all tabs with possible inputs should be displayed in Edit mode otherwise category  change (from category w/o props to one with) can cause error about missing required fields. So condition should be:

    <PDM_IF "$args.properties.length" != "0" || "$prop.form_name_3" == "edit">

    Talking about dynamically displayed tabs by JavaScript, it should be possible but can take a lot of time due to all callbacks caused by attribute changes that can affect visibility for specified tabs, so I think that preprocessor (PDM) conditions is the easiest (best) way.

     

    Best regards,

    cdtj



  • 4.  Re: Activating automatically a tab in cr detail screen

    Posted Mar 28, 2017 09:05 AM

    Touch a good point. Thank you for your improvement cdtj



  • 5.  Re: Activating automatically a tab in cr detail screen

    Posted Mar 28, 2017 09:28 AM

    Hi birolturker.kara,

     

    Your code will hide or show tabs before the page is loaded. But what I'm looking for is a way to "bring one tab to the top", with all tabs being accessible. This is what I mean for activating a tab.

     

    Thanks,

     

    Diogo



  • 6.  Re: Activating automatically a tab in cr detail screen
    Best Answer

    Posted Mar 28, 2017 09:43 AM

    Thanks for clarification, you can call:

    show_accordion_tab(<tab_index>);

    to switch between tabs.