I have something similar to you:

<!-- Generated by CGI::Widget::Tabs v1.14 --> <table class="tab"> <tr> <td class="tab_spc"></td> <td class="tab"><a href="?tab=%26%2339%3BPROD_RTP%26%2339%3B">&#39;PRO +D_RTP&#39;</a></td><td class="tab_spc"></td> <td class="tab"><a href="?tab=%26%2339%3BPROD_OMA%26%2339%3B">&#39;PRO +D_OMA&#39;</a></td><td class="tab_spc"></td> </tr> </table>

Using my business example, One thing I notice is that I don't have the "tab_actv" like you do. Also, for my underlying html data that each tab would reference, I'm only getting the ROW data for my first tab (PROD_RTP). Wouldn't I need a loop of some sort to generate the sql results from all the headings? The code below only prints the html from the results of the value from $tab->active, which in my case is whatever is assigned as default...for example: $tab->default("PROD_RTP"). If I expand the webpage to include several more tabs, how does the database handle statement (my $sth = $dbh->prepar($sql)) execute each query to render the html? Just seems like I need a loop.

my $sth = $dbh->prepare($sql); $sth->execute($tab->active); my @rows; while (my @f = $sth->fetchrow_array) { push @rows, { CLIENT => $f[0], URL => $f[1], }; } my $script="$ENV{'HOME'}/scripts/template.pl"; my $template = HTML::Template->new(filename => $script); $template->param(TITLE=>'ENV Spreadsheet'); $template->param(HEADINGS=>$heading, ROWS=>\@rows );

In the hypothetical Football and Baseball example, the rest of the html output would have the ROW data for Teams and their associated URL. When you click on the Baseball Tab, How does the Baseball tab know that the Baseball teams and baseball team URLS belong to said tab?

Thanks for your time poj.


In reply to Re^6: Help with CGI::WIDGET::TABS by dirtdog
in thread Help with CGI::WIDGET::TABS by dirtdog

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.