Skip to Content
avatar image
Former Member

Execute functions according tab (IP)

Hello

(Release 7.0 and IP)

I have arranged in Web application designer our planning input masks. So in the 'header' section I have placed the standard planning function Save, Refresh and Cancel (button group)

In the 'body' section I have two input layouts (input ready query), which are assigned each to a tabstrip.

Now I like to perform a planning function , when I push the save button.

So this planning function should only be executed, when the user saves data in the input layout of the first tab strip. In contrary the planning function shouldn't be executed, when the user saves data in the input layout of the second tab.

Now when I assign this planning function to the save button, it is performed always regardless of this two different input layouts.

I am very interested and curious of your ideas and hints how to get this function to be performed depending of the input layouts

Thanks a lot

Christian

Edited by: Christian Baumann on Sep 16, 2010 12:34 PM

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Sep 16, 2010 at 03:40 PM

    Hello Christian,

    here's how I would do it: First, create two save buttons in your header (one for tab A and one for tab B). Then add a JavaScript item.

    function howto_display_buttons_based_on_tabs( ) {
      var buttonA = "BUTTON_GROUP_ITEM_1_btn0_acButton";
      var buttonB = "BUTTON_GROUP_ITEM_1_btn1_acButton";
      var tabA = "TABSTRIP_CONTAINER_ITEM_1_tabStrip_tabstrip-itm-0";
      var tabB = "TABSTRIP_CONTAINER_ITEM_1_tabStrip_tabstrip-itm-1";
    
      if ( !document.all(buttonA) ) { al$ert( "Button A does not exist"); return; }
      if ( !document.all(buttonB) ) { al$ert( "Button B does not exist"); return; }
      if ( !document.all(tabA) ) { al$ert( "Tab A does not exist"); return; }
      if ( !document.all(tabB) ) { al$ert( "Tab B does not exist"); return; }
    
      if ( document.all(tabA).getAttribute("st") == "s" ) {
        document.all(buttonB).style.display = "none";
      } 
    
      if ( document.all(tabB).getAttribute("st") == "s" ) {
        document.all(buttonA).style.display = "none";
      } 
    }
    
    document.body.on$load = new Function("java$script:howto_display_buttons_based_on_tabs( );");
    

    Regards,

    Marc

    SAP Techology RIG

    PS: SDN does not allow posting all javascript code. Please remove all $ characters.

    Add comment
    10|10000 characters needed characters exceeded