struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john lee <sh_thorn_b...@yahoo.com>
Subject Re: sj:tabbedpanel javascript
Date Fri, 09 Aug 2013 18:43:33 GMT
view source
 
the related option for jquery(after sj_query convert into jquery), it shows following  
<script type='text/javascript'> 
 jQuery(document).ready(function () {  
 var options_partmoreinfo = {}; 
 options_partmoreinfo.jqueryaction = "tabbedpanel";  
 options_partmoreinfo.id = "partmoreinfo";  
 options_partmoreinfo.oncom = "tabcomplete";  
 options_partmoreinfo.oncha = "tabchange";    
 jQuery.struts2_jquery_ui.bind(jQuery('#partmoreinfo'),options_partmoreinfo);    
 }); 
<script type='text/javascript'>jQuery(document).ready(function () {  var options_partmoreinfo
= {};  options_partmoreinfo.jqueryaction = "tabbedpanel";  options_partmoreinfo.id = "partmoreinfo";
 options_partmoreinfo.oncom = "tabcomplete";  options_partmoreinfo.oncha = "tabchange";  jQuery.struts2_jquery_ui.bind(jQuery('#partmoreinfo'),options_partmoreinfo);
  }); </script>
  
that is why i use the following
 
    $('#partmoreinfo').tabs("selectedTab", "partmoreinfo_id", 3);
 or     
   $("#partmoreinfo").tabs( "taboptions", "partmoreinfo_id", 3);
 
to access the attribute selectedTab of sj:tabbedpanel's attrubte "selectedTab", but not working.
 
<sj:tabbedpanel id="partmoreinfo" selectedTab="%{partmoreinfo_id}">
>        <sj:tab id="tab1" target="Accessories" label="Accessories"/>
>        <sj:tab id="tab2" target="Replacement" label="Replacement Parts"/>
>        <sj:tab id="tab3" target="Cross" label="Cross Reference"/>
>        <div id="Accessories"> Accessories here </div>
>        <div id="Replacement"> Replacement Parts here </div>
>        <div id="Cross"> Cross Reference here </div>
>   </sj:tabbedpanel>
 
Please advise
 
thanks again
 
john
     
 

________________________________
 From: Chris Pratt <thechrispratt@gmail.com>
To: john lee <sh_thorn_bird@yahoo.com> 
Cc: Struts Users Mailing List <user@struts.apache.org> 
Sent: Friday, August 9, 2013 1:27 PM
Subject: Re: sj:tabbedpanel javascript
  

I have no idea what you mean.  The sj:tabbedpanel generates HTML Elements
and some jQuery based JavaScript.  It'll all be there in the source.
What's not "match"ing?
  (*Chris*)


On Fri, Aug 9, 2013 at 11:00 AM, john lee <sh_thorn_bird@yahoo.com> wrote:

> thanks for reply,
>
> i did view source before ask question here, but sj:tabbedpanel convert
> into jquery, even view source, still not match.
>
> john
>
>    *From:* Chris Pratt <thechrispratt@gmail.com>
> *To:* Struts Users Mailing List <user@struts.apache.org>; john lee <
> sh_thorn_bird@yahoo.com>
> *Sent:* Friday, August 9, 2013 12:43 PM
> *Subject:* Re: sj:tabbedpanel javascript
>
> Use the "View Source" feature in your browser to see what's being
> generated, then you should be able to see for yourself how to use
> JavaScript to interact with the on-screen components.
>   (*Chris*)
>
>
> On Fri, Aug 9, 2013 at 10:25 AM, john lee <sh_thorn_bird@yahoo.com> wrote:
>
>
> try to using javascript to set sj:tabbedpanel's attribute, but not working
>
> what is the correct format for access attribute sj:tabbedpanel's
> atrtribute in javascript?
>
> thanks in advance
>
> John
>
>
>
> <script language="javascript">
>
> function setpartmoreinfo(id) {
>         $("#Cross").tabs( "option", "partmoreinfo_id", id);
>       }
> </script>
>
> <a href="#" onclick="javascript:setpartmoreinfo(2)">change display<a>
>
>  <sj:tabbedpanel id="partmoreinfo" selectedTab="%{partmoreinfo_id}">
>        <sj:tab id="tab1" target="Accessories" label="Accessories"/>
>        <sj:tab id="tab2" target="Replacement" label="Replacement Parts"/>
>        <sj:tab id="tab3" target="Cross" label="Cross Reference"/>
>        <div id="Accessories"> Accessories here </div>
>        <div id="Replacement"> Replacement Parts here </div>
>        <div id="Cross"> Cross Reference here </div>
>   </sj:tabbedpanel>
>
>
>
>
>
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message