Call a Function when switching tabs in TabbedPanel

I am using Allan Jardine's DataTables javascript library , along with the Spry TabbedPanel. I have one table in each of a number of Tabs. The table in the tab opened by default (or if I use ShowPanel()) is fine. However, if I switch tabs, the other tables, which were hiden when the page was opened,  are not correctly initialised, and don't display correctly. Doing anything that causes the displayed table to be redrawn results in the table displaying correctly, and from then on I can switch tabs and the tables are fine.
DataTables has an API function fnDraw(), which will cause a specified table to be redrawn. Is it possible to cause TabbedPanel to call a user specified function when the tabs are swapped, so I can call fnDraw()? I think this woiuld solve my problem.
Thanks
Ron

Thanks.
But I found a simpler way. At the end of the jQuery(document).ready(function(), which initialises the datatables, I added
var ret=TabbedPanels1.showPanel("expiredquotes");
oTable2.fnDraw();
var ret=TabbedPanels1.showPanel("confirmedquotes");
oTable3.fnDraw();
var ret=TabbedPanels1.showPanel("openquotes");
Which opens each of the "other" tabs and redraws the respective DataTable while they are "visible". Then at the end I display the 'default' Tab. I only need to do this once, when the page is opened, after which the tables are correctly formatted.
Regards
Ron

Similar Messages

  • Code to call a function when enter key is pressed

    hi all,
    In a table control program i need to call a function when i press enter key...
    but im not able to do that since the function is always called when i press a push button on the screen.... can any one help me in this.. please....

    Hi John,
          You are not getting any value in SY-UCOMM when you press "Enter",because the function code is not set for 'Enter" key in "Function Key" of the GUI-STATUS..
    First define some fucntion code say 'ENT' for the Enter button available in "Fucntion key" of the GUI status.Once you done and activate the program and test it.The function code which u defined will be coming to SY-UCOMM field when you press 'ENTER" button and you can handle the various fucntionality whichevcer you want on "ENTER" .
    Eg:
    case sy-ucomm.
    When 'ENT'.
    Endcase.
    Regards,
    Vigneswaran S

  • After update to Firefox 25, tabs will "go back" 2 to 3 pages, when switching tabs or exiting full screen.

    It happens most frequently when exiting full screen from a video. i.e. youtube, dailymotion, nbc.com - any site with embedded video players.
    When exiting full screen, the page skips backwards 2 to 3 pages. And no, I'm not clicking related videos while in full screen the whole time - this is while initiating full screen and exiting full screen, all from the same video page.
    This happens less frequently when switching tabs - but if I switch to another tab, then back, the first tab will load the page I was on 2 pages ago.
    More info: When this happens, the "forward arrow" is greyed out and the page that that loads is on the "back arrow" list twice - further down the list where it should be, as well as at the very top of the list, as though I had clicked on a link to that page.
    This all started immediately upon restarting Firefox after updating to version 25 - no other changes have been made to my computer.

    Thanks for the canned responses, but you guys are way off.
    More information: It's related to HTML5 - whenever I fullscreen an HTML5 video, Firefox skips backwards to the most recent HTML5 video before that one, when exiting fullscreen. This last time, it skipped backwards past 4 pages that had no HTML5 content at all, to the one that did.

  • IPhone 4S Safari freezes when switching tabs

    Hi.
    Mobile Safari in my iPhone 4S freezes when switching tabs.  This does not happen every time Safari is running, but it happened one too many already.  Safari freezes even if I only have one tab and wanted to create a new one.  The app would usually freeze while doing the switch, tho it also froze just before the tabs switch.  Has anyone experienced the same?  Please help.  Thank you.   

    User troubleshooting after a reset is a restore. First from a backup and if that doesn't help, then as a new device. Remember a restore will delete data from the phone. Make sure you have everything backed up and synced to the computer before attempting the restore. If that does not help, make an appointment with the Apple Genius Bar to check for hardware faults.

  • Firefox unmaximizes itself when switching tabs in task bar

    When switching tabs using the windows taskbar during an extended online session spanning multiple tabs and windows, the window will unmaximize itself. Switching tabs using the physical tab works correctly. This only occurs with the "Show tabs preview in the Windows Taskbar" opton enabled. Closing all open firefox windows and restarting firefox is the only fix I have found.

    Hi achenbachs630420,
    This is expected behavior for the Windows 7 operating system. However when I have Firefox in fill screen mode for a window and hover over the taskbar the preview will show up and the full screen will remain, and I have the same feature selected, weird?
    '''Try Firefox Safe Mode''' to see if the problem goes away. [[Troubleshoot Firefox issues using Safe Mode|Firefox Safe Mode]] is a troubleshooting mode that turns off some settings, disables most add-ons (extensions and themes).
    If Firefox is open, you can restart in Firefox Safe Mode from the Help menu:
    *In Firefox 29.0 and above, click the menu button [[Image:New Fx Menu]], click Help [[Image:Help-29]] and select ''Restart with Add-ons Disabled''.
    *In previous Firefox versions, click on the Firefox button at the top left of the Firefox window and click on ''Help'' (or click on ''Help'' in the Menu bar, if you don't have a Firefox button) then click on ''Restart with Add-ons Disabled''.
    If Firefox is not running, you can start Firefox in Safe Mode as follows:
    * On Windows: Hold the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac: Hold the '''option''' key while starting Firefox.
    * On Linux: Quit Firefox, go to your Terminal and run ''firefox -safe-mode'' <br>(you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    When the Firefox Safe Mode window appears, select "Start in Safe Mode".<br>
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] article to find the cause.
    ''To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    When you figure out what's causing your issues, please let us know. It might help others with the same problem.

  • MuseJSAssert: Error calling selector function:TypeError: a.tabs is null

    Hello someone could help me, I have a problem with my page, export it from muse and get me this message
    MuseJSAssert: Error calling selector function:TypeError: a.tabs is null
    thanks

    Hi,
    Could you please try publishing your Muse site to test Business catalyst site and share the link to the page where you facing this error?
    Regards
    Anshul Sharma

  • Focus-requests when switching tabs in JTabbedPane

    I have a tabbed pane with a JTextArea in each tab. I would like to switch focus to the corresponding area each time I select a tab or create a new one. A ChangeListener can detect tab selections and call requestFocusInWindow() on the newly chosen tab's text area.
    For some reason, the focus only switches sporadically. Sometimes the caret appears to stay, sometimes it only blinks once, and sometimes it never appears. My friend's workaround is to call requestFocusInWindow() again after the setSelectedIndex() calls, along with a Thread.sleep() delay between them. Oddly, in my test application the delay and extra focus-request call are only necessary when creating tabs automatically, rather than through a button or shortcut key.
    Does the problem lie in separate thread access on the same objects? I tried using "synchronized" to no avail, but EventQueue.invokeLater() on the focus request worked. Unfortunately, neither the delay nor invokeLater worked in all situations in my real-world application. Might this be a Swing bug, or have I missed something?
    Feel free to tinker with my test application:
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    /**Creates a tabbed pane with scrollable text areas in each tab.
    * Each time a tab is created or selected, the focus should switch to the
    * text area so that the cursor appears and the user can immediately type
    * in the area.
    public class FocusTest2 extends JFrame {
         private static JTabbedPane tabbedPane = null;
         private static JTextArea[] textAreas = new JTextArea[100];
         private static int textAreasIndex = 0;
         private static JButton newTabButton = null;
         /**Creates a FocusTest2 object and automatically creates several
          * tabs to demonstrate the focus switching.  A delay between creating
          * the new tab and switching focus to it is apparently necessary to
          * successfully switch the focus.  This delay does not seem to be
          * necessary when the user fires an action to create new tabs, though.
          * @param args
         public static void main(String[] args) {
              FocusTest2 focusTest = new FocusTest2();
              focusTest.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              focusTest.show();
              //Opens several tabs.
              for (int i = 0; i < 4; i++) {
                   try {
                        //adding the tab should automatically invoke setFocus()
                        //through the tabbed pane's ChangeListener, but for some
                        //reason the focus often doesn't switch or at least doesn't
                        //remain in the text area.  The workaround is to pause
                        //for a moment, then call setFocus() directly
                        addTabbedPaneTab();
                        //without this delay, the focus only switches sporadically to
                        //the text area
                        Thread.sleep(100);
                        setFocus();
                        //extra delay simply for the user to view the tab additions
                        Thread.sleep(1900);
                   } catch (InterruptedException e) {
         /**Adds a new tab, titling it according to the index of its text area.
          * Using "synchronized" here doesn't seem to solve the focus problem.
         public static void addTabbedPaneTab() {
              if (textAreasIndex < textAreas.length) { //ensure that array has room
                   textAreas[textAreasIndex] = new JTextArea();
                   //title text area with index number
                   tabbedPane.addTab(
                        textAreasIndex + "",
                        new JScrollPane(textAreas[textAreasIndex]));
                   tabbedPane.setSelectedIndex(textAreasIndex++);
         /**Constructs the tabbed pane interface.
         public FocusTest2() {
              setSize(300, 300);
              tabbedPane = new JTabbedPane();
              //Action to create new tabs
              Action newTabAction = new AbstractAction("New") {
                   public void actionPerformed(ActionEvent evt) {
                        addTabbedPaneTab();
              //in my real-world application, adding new tabs via a button successfully
              //shifted the focus, but doing so via the shortcut key did not;
              //both techniques work here, though
              newTabAction.putValue(
                   Action.ACCELERATOR_KEY,
                   KeyStroke.getKeyStroke("alt T"));
              newTabAction.putValue(Action.SHORT_DESCRIPTION, "New");
              newTabAction.putValue(Action.MNEMONIC_KEY, new Integer('T'));
              newTabButton = new JButton(newTabAction);
              Container container = getContentPane();
              container.add(tabbedPane, BorderLayout.CENTER);
              container.add(newTabButton, BorderLayout.SOUTH);
              //switch focus to the newly selected tab, including newly created ones
              tabbedPane.addChangeListener(new ChangeListener() {
                   public void stateChanged(ChangeEvent evt) {
                        //note that no delay is necessary for some reason
                        setFocus();
         /**Sets the focus onto the selected tab's text area.  The cursor should
          * blink so that the user can start typing immediately.  In tests without
          * the delay during the automatic tab creation in main(), the cursor
          * sometimes only blinked once in the text area.
         public static void setFocus() {
              if (tabbedPane == null) //make sure that the tabbed Pane is valid
                   return;
              int i = tabbedPane.getSelectedIndex();
              if (i < 0) //i returns -1 if nothing selected
                   return;
              int index = Integer.parseInt(tabbedPane.getTitleAt(i));
              textAreas[index].requestFocusInWindow();
    }

    Did you ever get everything figured out with this? I have a similar problem ... which I have working, but it seems like I had to use a bunch of hacks.
    I think the problem with the mouse clicks is because each event when you click the moues (mousePressed, mouseReleased, mouseClicked) causes the tab to switch, and also these methods are called twice for some reason - for a total of 8 events giving the tab the focus instead of your textarea.
    This works, but seems aweful hacky:
         class TabMouseListener extends MouseAdapter
              private boolean switched = false;
              public void mousePressed( MouseEvent e ) { checkPop( e ); }
              //public void mouseReleased( MouseEvent e ) { checkPop( e ); }
              //public void mouseClicked( MouseEvent e ) { checkPop( e ); }
              public void checkPop( MouseEvent e )
                   if( e.isPopupTrigger() )
                        mousex = e.getX();
                        mousey = e.getY();
                        int index = tabPane.indexAtLocation( mousex, mousey );
                        if( index == -1 ) return;
                        tabMenu.show( tabPane, mousex, mousey );
                   else {
                        if( !switched )
                             switched = true;
                             e.consume();
                             int index = tabPane.indexAtLocation( e.getX(), e.getY() );
                             if( index != -1 )
                                  tabPane.setSelectedIndex( index );
                                  TabFramePanel panel = (TabFramePanel)tabPane.getComponentAt( index );
                                  if( panel != null ) panel.getInputComponent().requestFocus();
                        else {
                             switched = false;
                             TabFramePanel panel = (TabFramePanel)tabPane.getSelectedComponent();
                             if( panel != null ) panel.getInputComponent().requestFocus();
         }Do you know of a better way yet?
    Adam

  • Dot source/calling a function with switch from the cmd line

    Hi
    This is driving me crazy and I know its something really obvious.
    If I have an example script like so, called myexample.ps1
    [CmdletBinding()]
    param
    [Parameter(Mandatory=$false, HelpMessage="My Switch")]
    [switch] $Myswitch,
    [Parameter(Mandatory=$false, HelpMessage="Email Address")]
    [string] $email
    Function Main
    [CmdletBinding()]
    param
    [switch] $Myswitch,
    [string] $email
    if ($Myswitch)
    Write-Host "Switch Enabled"
    Write-Host "Email is $email"
    else
    Write-Host "Switch Disabled"
    Write-Host "Email is $email"
    Main -email $email #This is the line that I think is at fault
    I have two issues
    1) How do I correctly write the code so that the script can be called with either or both parameters. The switch ($Myswitch) is the one that is really causing me issues.
    2) Is invoking it the easiest method/best/most common method of calling it via a batch file
    Here's my understanding
    a) I could dot source it (. .\myexample.ps1) to load the functions into the current session, then call the function
    Main -email hello.com -Myswitch
    or
    Main -email hello.com
    b) or I could Invoke it, which I think is my preference as my final goal here is for it to be called via a batch file in a scheduled task
    & 'C:\Users\myusername\Desktop\MyExample.ps1' -email hello -myswitch
    or
    & 'C:\Users\myusername\Desktop\MyExample.ps1' -email hello
    Any push in the right direction will be appreciated :)

    Why the function?  Just call the file.  We don't "Invoke" scripts. Just call the script..
    # MyExample.ps1
    [CmdletBinding()]
    param(
    [Parameter(Mandatory=$false, HelpMessage="My Switch")]
    [switch] $Myswitch,
    [Parameter(Mandatory=$false, HelpMessage="Email Address")]
    [string] $email
    if ($Myswitch){
    Write-Host "Switch Enabled"
    Write-Host "Email is $email"
    }else{
    Write-Host "Switch Disabled"
    Write-Host "Email is $email"
    Now jsut call it like a normal script:
    .\MyExample.ps1 -email someemail -MySwitch
    It is as simple as that.
    If it has to be a function as in a library then you must either dot source or create a module.
    ¯\_(ツ)_/¯

  • Call a function when the active document is closed

    Hi friends
    I have a portion of my script (at true a specific function) that I´d need to be executed every time the user close the app.activeDocument in Photoshop.
    I know there´s a Photoshop script called "Script Event Manager" where we can associate actions and scripts with events (like closing the document). I´d not like to use this script because..as I told...it´s not my entire script to be runned when closing a file..but only a function.
    Tried to search in the Script Event Manager for any event called "onClose" () but sure there´s nothing.
    How could I insert an event in the body of my own script that calls a function every time user close the active document?
    Thank you a lot for the help
    Best Regards
    Gustavo.

    As I said before the close event is really not that useful. In addition to the document already being closed the event descriptor will only have the path to the closed file if it was saved as part of the close event.
    But if you want to play around with this to see if it will be helpful to you here is one way. You will need to add the notifer. This only needs to be done once unless it is removed.
    app.notifiersEnabled = true;
    app.notifiers.add( "Cls ",new File('~/desktop/closeEventHandler.jsx') );
    Then for the event handler script, something like this.
    try {
        if (arguments.length >= 2) {
        var filePath;
        var desc = arguments[0];
        if( desc.hasKey( stringIDToTypeID('in') ) ) filePath = desc.getPath(stringIDToTypeID('in'));
        if( filePath != undefined ) alert( decodeURI( filePath ) );
    } catch (e) {}

  • Web Interface - Call a function when web interface starts

    Hello,
    my problem is to call a function (fox formula) when the web interface starts. This function may execute only once.
    Can somebody help me?
    Thanks
    Stefan

    Hi,
    1. Create a custom class ZCL_BPS in SE24 inheriting the properties from superclass CL_UPWB_BSP_APPL.
    2. Redefine the method LOAD of this class ZCL_BPS and call your FOX formula over here using function module API_SEMBPS_FUNCTION_EXECUTE.
    eg. code
    METHOD LOAD .
    TRY.
    CALL METHOD SUPER->LOAD
      EXPORTING
        APPLICATION_NAME = APPLICATION_NAME
      RECEIVING
        APPLICATION      =  APPLICATION.
    CALL FUNCTION 'API_SEMBPS_FUNCTION_EXECUTE'
      EXPORTING
        I_AREA           =  'ZAREA01'
        I_PLEVEL         =  'LEVL001'
        I_PACKAGE        =  'PACK001'
        I_FUNCTION       =  'PFUN001'
        I_PARAM          =  'FOXF001'.
    ENDTRY.
    ENDMETHOD.                    "LOAD
    3. Replace CL_UPWB_BSP_APPL  by ZCL_BPS in the Application Class property of your Web Interface.
    This works for sure.
    Please grant points if it solves your purpose.
    Regards,
    Deepti

  • Call JavaScript function when my Condition is true in JSP

    Hi all,
    in my jsp i wanna call a javascript function (user defined) when a particular condition si met. How to go about it ? Can anyone plz help me out. Help appreciated.

    hi
    yes! we can do it as follows:
    in the JSP code u can include the javascript function
    first u declare the Javascript function before the </head> tag in the HTML
    and in the JSP u can just call the function which is as follow:
    <script>call the JavaScript function()</script>
    for example:
    <html>
    <head>
    <script language="JavaScript">
    function sayhi() {
    alert("hi");
    </script>
    </head>
    <body>
    <%
    zStr = request.getParameter("str");
    if(zStr.equals("true")) {
    %>
    <script>sayhi();</script>
    <%
    else {
    %>
    </body>
    </html>

  • Tabs and pages not drawn when switching tabs.

    When switching between tabs or opening new tabs, the tab and the page are not drawn. But if I scroll down the page is drawn.
    This doesn't happen always. It happens randomly.
    Here's some sample sample images:
    https://dl.dropboxusercontent.com/u/14279386/imghost/tabrender/1.png
    https://dl.dropboxusercontent.com/u/14279386/imghost/tabrender/2.png
    I've been having this problem since a few versions back.

    If it works in Safe Mode and in normal mode with all extensions (Firefox/Tools > Add-ons > Extensions) disabled then try to find which extension is causing it by enabling one extension at a time until the problem reappears.
    Close and restart Firefox after each change via "Firefox > Exit" (Windows: Firefox/File > Exit; Mac: Firefox > Quit Firefox; Linux: Firefox/File > Quit)
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    In Firefox Safe mode these changes are effective:
    *all extensions are disabled (about:addons)
    *default theme is used (no persona)
    *userChrome.css and userContent.css are ignored (chrome folder in profile folder)
    *default toolbar layout is used
    *JavaScript JIT compilers are disabled
    *hardware acceleration is disabled (Options > Advanced > General)
    *plugins are not affected
    *preferences are not affected

  • AIR app crashes when switching tabs

    Hi there:
    I posted in another forum about this, but it seems the issues
    aren't really related, so a recap:
    quote:
    Originally posted by:
    patrickcheatham
    I am trying to run an AIR app which _crashes_ as soon as it
    needs to access a file or files on the hard drive (via an HTML
    component). Sometimes it just crashes, sometimes I get an error
    that the app can't find Adobe AIR. I have followed most or all of
    the suggestions in
    this
    thread.
    Attached code is a crash report.
    Thanks!
    The app can be found
    here
    The crash report can be found
    here
    The crash report has WebKit all over it; interstingly, when a
    user reported installing the Safari 4 Beta recently, all crashing
    stopped (that doesn't really make sense to me, but OK).
    quote:
    Originally posted by:
    patrickcheatham
    I have further input on this:
    1) The crash occurs when the user switches tabs;
    specifically, when the user switches from a tab which does _not_
    contain an HTML component, to one which _does_ contain an HTML
    component. Said HTML component looks for local content.
    2) The crash occurs when the app tries to phone home to
    Adobe; this phoning home appears to occur during item 1 above
    _and/or_ when the app is launched.
    Any help from above or insight appreciated.
    Thanks,
    Patrick

    Hi Mirela:
    It may be that the issue is a non-issue with AIR 1.5.1
    (versus v1.5), so we'll see. Frustrating, nonetheless, especially
    since it is a sporadic issue.
    You can follow other users' experiences in the forum at
    panosalado.com.
    Thanks for taking the time to download it and try it out --
    and for the feedback. Good to hear a positive! :)
    Cheers,
    Patrick

  • How to call jquery function when i close modal dialog box ?

    Hello,
    I need to call one jquery function when I click on close button of modal dialog box.Can anyone please let me know how can I implement it ?
    Thanks,
    Dipti Chhatrapati

    Hi Dipti,
    If my understanding is correct, you are using SP Modal Dialog and want to track the close event of this dialog. Then you may use
    dialogReturnValueCallback parameter of Options variable. Follow is the code sample:
    function ShowModal() {
        ExecuteOrDelayUntilScriptLoaded(function () {
            var options = {
                url: 'page1.aspx',
                tite: 'Add Title',
                width: 800,
                height: 450,
                allowMaximize: true,
                showClose: true,
                dialogReturnValueCallback: scallback
            SP.UI.ModalDialog.showModalDialog(options);
        }, 'sp.js');
     function scallback(dialogResult, returnValue) {
          if (dialogResult == SP.UI.DialogResult.OK) {
               // call your Jquery method here...
    Thanks, Ram

  • Refreshing when switching tabs

    Hi,
    I have created a webcenter site that has tabs used in iframes. What I would like to do is to refresh the bottom frame when a person switches tabs so the old data id removed. Does anyone know how to achieve this?
    Any help would be appreciated.
    -Joe

    What technology are you using? WebCenter Content with a Javascript frontend? Do you use JQuery or some other framework?
    Can you post the existing code that needs changing?

Maybe you are looking for

  • Dá prá instalar um aplicativo no Firefox OS a partir de um arquivo?

    Temos a opção de instalar aplicativos a partir de um arquivo em outras plataformas como por exemplo o Android (apk), WindowsPhone (xap) e Symbian (sis). É possível fazer isso a partir do Firefox OS? Outro detalhe, considerando que os aplicativos para

  • Pixelated Images

    Hi...Is there a trick to getting the images to look crisp and clear? All my uploaded images look pixelated and I have tried everything from resizing myself to exact dimensions, to uploading as jpegs and pngs.  Nothing works.   I have the new version

  • Has anyone else lost all their phone numbers?

    Just checked Contacts while trying to make a phone call and i don't see any of my phone numbers..I had probably 50+ in my contacts list.  What gives?  What do I do now?

  • How to pass src value into img tag in ADF

    Hi, My Dev : 11.1.2.3.0 How to pass row values into <img> tag.,I used the below code but it's taking empty., I tried both ways like #{row.CdFilePath}   and   ${row.CdFilePath} <af:iterator var="row"                   value="#{bindings.xxx.collectionM

  • Is this a scam or a true Apple email?

    I just receivded the following message from [email protected] times in a row: Dear [my full name in there], To reset your Apple ID password, simply click the link below. That will take you to a web page where you can create a new password. Please not