Change focus in a Spry Tabbed panel

Ask a Question related to Macromedia Exchange Dreamweaver Extensions, Design and Development.

  1. #1

    Default Change focus in a Spry Tabbed panel

    I have a tabbed panel with three tabs.
    email form
    client form - default tab
    information

    Is there a way to change the default tab to the tab that the user clicks on?
    Or change the default temporarily.

    When the email form is submitted the panel gose back to the default panel
    after the form is submitted. I am trying to get the email tab to stay open so
    the user can see there confirmation text.

    email [email]soatman@comcast.net[/email]

    Thanks for any help!

    Steve





    soatman Guest

  2. Similar Questions and Discussions

    1. Combine Spry Tabbed Panel and Spry HTML Panel
      I would like to maintain the presentation of the tabbed panel and utilize its ability to load content from a Spry Dataset, but I would also like to...
    2. How to use Spry Tabbed Panels?
      Hello, I made spry tabbed panels but I'd like them to work on a rollover or mouseover instead of a click. Here's what I tried but it didn't...
    3. Spry Tabbed Panels
      Can contribute edit spry tabbed panel content?
    4. Help! Refresh default tabbed panel
      Hi, I have a problem with my spry tabbed panels. The default tab is set to be the 1st tab, when I move to 2nd tab and navigate through the...
    5. How do i hyperlink between spry tabbed panels
      OK, i'm using the spry tabbed panels in Dreamweaver CS3. I have 9 tabs and the idea is that the user can link to content in 8 of the tabs from the...
  3. #2

    Default Re: Change focus in a Spry Tabbed panel

    soatman wrote:
    > I have a tabbed panel with three tabs.
    > email form
    > client form - default tab
    > information
    >
    > Is there a way to change the default tab to the tab that the user clicks on?
    > Or change the default temporarily.
    You can set which tab you want to open by using the defaultTab option in the Spry Tabbed panels. Take a look at the code for the first sample on this page as it defaults to the "Tab 3" tab:
    [url]http://labs.adobe.com/technologies/spry/samples/tabbedpanels/tabbed_panel_sample.htm[/url]

    It creates the tabbed panel with the following code:
    var tp1 = new Spry.Widget.TabbedPanels("tp1", { defaultTab: 2 });

    For your case, I would suggest using server side code to change the value of the defaultTab, using 0 as the default, and whatever tab number of the one with the server response in it. Remember that Spry uses a 0 based count, as in tab 1 is 0, tab 2 is 1, etc.

    FYI: Spry forum is over here:
    [url]http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid=72&catid=602[/url]



    --
    Danilo Celic
    | [url]http://blog.extensioneering.com/[/url]
    | WebAssist Extensioneer
    | Adobe Community Expert
    danilocelic AdobeCommunityExpert Guest

  4. #3

    Default Re: Change focus in a Spry Tabbed panel

    Danilo Celic,

    Yes thank you. I am able to set the default. my need is.

    I have a couple of forms that are in php script the form actions is
    server_self validation. These are in two of the tabs. When one is submitted
    the tab panel gose back to the default but I need it to stay on the same tab
    after the form is submitted and not go to the default tab. Is there a way of
    not having a default. So even after the form is submitted it stays in that
    tab? Maybe a way of having the default change to which even tab is pressed.

    soatman Guest

  5. #4

    Default Re: Change focus in a Spry Tabbed panel

    soatman wrote:
    > Danilo Celic,
    >
    > Yes thank you. I am able to set the default. my need is.
    >
    > I have a couple of forms that are in php script the form actions is
    > server_self validation. These are in two of the tabs. When one is submitted
    > the tab panel gose back to the default but I need it to stay on the same tab
    > after the form is submitted and not go to the default tab. Is there a way of
    > not having a default. So even after the form is submitted it stays in that
    > tab? Maybe a way of having the default change to which even tab is pressed.
    With the tabbed panels they start off with either the first tab, or a specified tab. For your case you would set the tab to use based upon your server side processing. In PHP for example:

    In your sirever side processing:
    $tabToShow = 0; // 0 = 1st tab.

    // Then perpform whatever processing you want and set the tab to show
    // based upon whatever process decisions you want, for example:
    if(processingForm()){
    $tabToShow = 2; // 2 = 3rd tab
    }


    Then in the Spry code (probably near the bottom of your page):

    var tp1 = new Spry.Widget.TabbedPanels("tp1", { defaultTab: <?php echo($tabToShow);?> });


    This will by default start off on tab 0 (1st tab), or any other tab you want, by simply setting $tabToShow to whatever tab you want. Then in your processing script, you can

    Or you could add a url parameter to the action of the form within the tab you're working with and use code similar to the last example on this page (you'll have to check the code):
    [url]http://labs.adobe.com/technologies/spry/samples/utils/URLUtilsSample.html[/url]

    Here's a couple of relevant snippets of JavaScript from that page. The first is from the top of the page, the second from the bottom:
    // Grabs the values of the URL parameters for the current URL.
    var params = Spry.Utils.getLocationParamsAsObject();

    //The defaultTab value checks to see if the url param is defined. If it is not, it sets it to 0.
    var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1", {defaultTab:(params.panel ? params.panel : 0)});


    To do this, you'll have to pull the SpryURLUtils.js file from the download package and link it into your page:
    [url]http://labs.adobe.com/technologies/spry/home.html[/url]


    I've also seen posted a customized "history" version of the Spry Tabbed panels that saves the panel to display in a cookie, but the page isn't currently available for some reason:
    [url]http://www.3rd-eden.com/Spry-it.com/examples/History/tabbedpanels/[/url]

    --
    Danilo Celic
    | [url]http://blog.extensioneering.com/[/url]
    | WebAssist Extensioneer
    | Adobe Community Expert
    danilocelic AdobeCommunityExpert Guest

  6. #5

    Default Re: Change focus in a Spry Tabbed panel

    Danilo Celic,

    I see what you have for the php script, that is what most of this site is done
    in.
    I will try this out. I will comment back afterwards!

    [url]http://so5328.aisites.com/AI_class_IMD312_programming/final_project/index.php[/url]

    Thanks alot!

    Steve

    soatman Guest

  7. #6

    Thumbs up Re: Change focus in a Spry Tabbed panel

    Perfect

    var tp1 = new Spry.Widget.TabbedPanels("tp1", { defaultTab: <?php echo($tabToShow);?> });
    worked like charm.

    have been spending a day to figure it out.
    But this worked in 1 second.

    Thanks a million
    http://www.topworlddirectory.com
    Unregistered Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139