A
download dynapi.api.ext.tabmanager2.html
Language: NonCode
LOC: 0
Project Info
DynAPI
Server: SourceForge
Type: cvs
...i\dynapi\dynapi3x\examples\
   datasource-paging.db
   datasource.db
   ...cross_frame_access.html
   ...me_access_-_frame1.html
   ...me_access_-_frame2.html
   ...dragdrop-collision.html
   demo.dragicon.html
   demo.dragover.html
   demo.dynlayer-attack.html
   ....dynlayer-dragdraw.html
   demo.oncontentchange.html
   demo.onlocationchange.html
   demo.slideshow.html
   demo.spaceship-circle.html
   demo.spaceship-path.html
   ...emplate.imageframe.html
   ...yndocument-addhtml.html
   ...r-anchor-anchoring.html
   ...dynlayer-anchor-ii.html
   ...-anchor-stretching.html
   ...pi.dynlayer-anchor.html
   ....dynlayer-autosize.html
   ...ynlayer-blackboard.html
   ...pi.dynlayer-create.html
   ...i.dynlayer-destroy.html
   ....dynlayer-relative.html
   ...api.dynlayer-slide.html
   ....api.ext.dragevent.html
   ....ext.inline-widget.html
   dynapi.api.ext.inline.html
   ....api.ext.keyevents.html
   ...pi.ext.tabmanager1.html
   ...pi.ext.tabmanager2.html
   dynapi.api.mouseevent.html
   ...ment.capturehotkey.html
   ...unctions.fadecolor.html
   ...functions.getimage.html
   dynapi.functions.html
   ...ctions.imageloader.html
   ...ions.subclassevent.html
   dynapi.fx.bezier.html
   dynapi.fx.circleanim.html
   dynapi.fx.fader.html
   dynapi.fx.flashsound.html
   dynapi.fx.glideanim.html
   dynapi.fx.hover.html
   dynapi.fx.motionx.html
   dynapi.fx.pathanim.html
   dynapi.fx.slideanim.html
   dynapi.fx.snapx.html
   dynapi.fx.swiper.html
   dynapi.fx.textanim.html
   dynapi.fx.timerx.html
   ...rdermanager-boxfix.html
   ...ordermanager-inner.html
   ...ordermanager-outer.html
   ...rdermanager-random.html
   dynapi.gui.button.html
   dynapi.gui.checkbox.html
   dynapi.gui.explorer.html
   ...i.gui.focusmanager.html
   dynapi.gui.graphics.html
   ...i.gui.groupmanager.html
   ...pi.gui.highlighter.html
   dynapi.gui.htmlbutton.html
   ...i.gui.htmlcalendar.html
   ...i.gui.htmlcheckbox.html
   dynapi.gui.htmlclock.html
   ...ui.htmlcolorpicker.html
   ....gui.htmlcontainer.html
   ...gui.htmldatepicker.html
   ...i.htmldropdownmenu.html
   dynapi.gui.htmlfile.html
   ....gui.htmlhyperlink.html
   ...pi.gui.htmllistbox.html
   ...ui.htmlmenu-images.html
   ...htmlmenu-startmenu.html
   dynapi.gui.htmlmenu.html
   ...ui.htmlprogressbar.html
   ...ui.htmlradiobutton.html
   ...i.gui.htmlrollover.html
   ...i.gui.htmltextarea.html
   ...pi.gui.htmltextbox.html
   dynapi.gui.imageclip.html
   dynapi.gui.knob.html
   dynapi.gui.label.html
   dynapi.gui.list.html
   dynapi.gui.listbox.html
   dynapi.gui.loadpanel.html
   dynapi.gui.marquee.html
   ...i.panelbar-stacker.html
   ...pi.gui.progressbar.html
   ...pi.gui.radiobutton.html
   dynapi.gui.scrollbar.html
   ...emplatemanager-htc.html
   ...ui.templatemanager.html
   dynapi.gui.tree.html
   ....viewpane-explorer.html
   ...viewpane-loadpanel.html
   dynapi.gui.viewpane.html
   dynapi.library-file1.js
   dynapi.library-file2.js
   dynapi.library-load.html
   dynapi.util.cookie.html
   ...atasource-acronyms.html
   ...il.datasource-forms.asp
   ...l.datasource-forms.html
   ...l.datasource-paging.asp
   ....datasource-paging.html
   ...atasource-testfile.html
   ...pi.util.datasource.html
   ...pi.util.filereader.html
   dynapi.util.filereader.xml
   ...ement-dynamic-code.html
   ...ement-dynamic-data.html
   ...til.ioelement-post.html
   ...lement-postresponse.asp
   ...lement-postresponse.php
   ...element-postresponse.pl
   ...lement-soda-calc-js.asp
   ...ement-soda-calc-vbs.asp
   ...ioelement-soda-calc.php
   ...oelement-soda-sync.html
   ...ment-soda-tester-vb.asp
   ...lement-soda-tester.html
   ...element-soda-tester.php
   ...til.ioelement-soda.html
   ...ioelement-testfile.html
   ...il.ioelement-upload.asp
   ...l.ioelement-upload.html
   ...il.ioelement-upload.php
   dynapi.util.ioelement.html
   ....util.stringbuffer.html
   ioelmsrv.jscript.asp
   ioelmsrv.php
   ioelmsrv.pl
   ioelmsrv.pm
   ioelmsrv.soda.jscript.asp
   ioelmsrv.soda.php
   ioelmsrv.soda.pl
   ioelmsrv.soda.vbscript.asp
   ioelmsrv.vbscript.asp
   speedtest.button.html
   speedtest.checkbox.html
   ...est.dynlayer-basic.html
   ...dynlayer-deep_nest.html
   ....dynlayer-oncreate.html
   ...yer-setclass-basic.html
   ...-basic-blueprint_def.js
   ...-basic-blueprint_ns4.js
   ...r.inline-basic-dom.html
   ...layer.inline-basic.html
   ...line-deep_nest-dom.html
   ...etcontentwidth.dom.html
   speedtest.knob.html
   speedtest.listbox.html
   speedtest.radiobutton.html
   speedtest.scrollbar.html
   ...reatewidget.button.html
   upload.asp

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>DynAPI Examples - Tab Manager 2</title>
<script language="Javascript" src="../src/dynapi.js"></script>
<script language="Javascript">
dynapi.library.setPath('../src/');
dynapi.library.include('dynapi.api');
dynapi.library.include('dynapi.functions');
dynapi.library.include('dynapi.util.DataSource');
dynapi.library.include('dynapi.gui.FocusManager');
dynapi.library.include('dynapi.api.ext.TabManager');
</script>
<style type="text/css">
td { font:10px Helvetica; background:#dddddd; }
.center { text-align:center; }
</style>
<script language="Javascript">
// data source error function
function dsConfirm(ds,err) {
  var elm,t,c;
  elm=ds.ioelement.getScope();
  // IE only - used to display page content of a failed response.
  if(!(dynapi.ua.ie && elm.document && !elm.document._tranState)) t='';
  else t='------\n'+elm.document.body.innerText;
  c=confirm(err+'\n\nWould you like to retry the operation?\n\n'+t);
  if(c) ds.retry();
};
// data source listener
var dsListener={};
dsListener.onalert=function(e,err) {
  var ds=e.getSource();
  if(err.indexOf('DataSource: Server Timeout')>=0) dsConfirm(ds,err);
};
// data source callback
function dsConnect(ds,s,err) {
  if(s!=true) dsConfirm(ds,err);
  else ds.moveFirst();
};
// tab manager listener
var tmListener={
  onblur:function(e) {
    var o=e.getSource();
    o.setBgColor('#cccccc');
  },
  onfocus:function(e) {
    var o=e.getSource();
    o.setBgColor('#aaaaaa');
  },
  onsubmit:function(e) {
    var o=e.getSource();
    o.setBgColor('#eeeeee');
    o.callSubmitFn();
  }
}
// default tab attributes
function Tab(html,x,id) {
  this.base=DynLayer;
  this.base(html,x,1,50,16,'#cccccc');
  this.setClass('center');
  if(id) this.setID(id)
}
Tab.prototype=new DynLayer();
// example 1
var e1=dynapi.document.addChild(new DynLayer(null,0,0,309,48));
// menubar 1
var m1=e1.addChild(new DynLayer(null,1,1,309,19,'#666666'));
m1.addChild(new Tab('&lt;&lt; First',1),'tab1').addSubmitFn('ds1.moveFirst()');
m1.addChild(new Tab('&lt; Prev',52),'tab2').addSubmitFn('ds1.movePrev()');
m1.addChild(new Tab('Add',103)); // tab 3
m1.addChild(new Tab('Submit',154)); // tab 4
m1.addChild(new Tab('Next &gt;',205),'tab5').addSubmitFn('ds1.moveNext()');
m1.addChild(new Tab('Last &gt;&gt;',256),'tab6').addSubmitFn('ds1.moveLast()');
m1.createTabManager(m1.tab1,m1.tab2,m1.tab5,m1.tab6); // exclude tab3 & tab4
m1.addTabListeners(tmListener)
m1.tab1.onCreate(function() { this.setFocus(true); } );
// data source 1
var ds1=new DataSource();
ds1.setSource('dynapi.util.datasource-testfile.html','GET');
ds1.connect(dsConnect);
ds1.addEventListener(dsListener);
e1.addChild(new DynLayer(null,1,21,17,25,'#cccccc'),'dri').setDataSource(ds1,'dataRowIndex');
e1.addChild(new DynLayer(null,20,21,80,25,'#cccccc')).setDataSource(ds1,'user_id');
e1.addChild(new DynLayer(null,102,21,205,25,'#cccccc')).setDataSource(ds1,'full_name');
e1.dri._setDSValue=function(d) { this.setHTML((d+1)+''); }
// example 2
var e2=dynapi.document.addChild(new DynLayer(null,0,0,410,48));
// menubar 2
var m2=e2.addChild(new DynLayer(null,0,0,410,19,'#666666'));
m2.addChild(new Tab('&lt;&lt; First',1,'ds2-moveFirst'),'t1');
m2.addChild(new Tab('&lt;&lt; -10',52),'t2');
m2.addChild(new Tab('&lt; Prev',103,'ds2-movePrev'),'t3');
m2.addChild(new Tab('Add',154));
m2.addChild(new Tab('Submit',205));
m2.addChild(new Tab('Next &gt;',256,'ds2-moveNext'),'t4');
m2.addChild(new Tab('+10 &gt;&gt;',307),'t5');
m2.addChild(new Tab('Last &gt;&gt;',358,'ds2-moveLast'),'t6');
m2.t2.addSubmitFn(function() { ds2.setRecordPosition(I2-10); });
m2.t5.addSubmitFn(function() { ds2.setRecordPosition(I2+10); });
// m2 tab elements t1,t3,t4,t6 will have id callbacks, '-' replaced with '.' ;)
m2.createTabManager(m2.t1,m2.t2,m2.t3,m2.t4,m2.t5,m2.t6);
m2.addTabListeners(tmListener)
// data source 2
var ds2=new DataSource(),I2=0;
ds2.setSource('dynapi.util.datasource-acronyms.html','GET');
ds2.connect(dsConnect);
ds2.addEventListener(dsListener);
e2.addChild(new DynLayer(null,1,21,17,25,'#cccccc'),'dri').setDataSource(ds2,'dataRowIndex');
e2.addChild(new DynLayer(null,20,21,80,25,'#cccccc')).setDataSource(ds2,'mnemonic');
e2.addChild(new DynLayer(null,102,21,307,25,'#cccccc')).setDataSource(ds2,'description');
e2.dri._setDSValue=function(d) { I2=parseInt(d); this.setHTML((I2+1)+''); }
// example 3
// tab manager and focus manager listener
var fmListener={
  onfocus:function(e) {
    var o=e.getSource();
    o.__oldBg=o.getBgColor();
    o.setBgColor('#999999');
  },
  onblur:function(e) {
    var o=e.getSource();
    o.setBgColor(o.__oldBg);
  },
  onsubmit:function(e) { // tab manager
    var o=e.getSource();
    o.setBgColor('#eeeeee');
  }
}
// default box attributes
function Box(x,y,c) {
  this.base=DynLayer;
  this.base(null,x,y,50,50,c);
  this.setFocus('auto')
  this.setClass('center');
}
Box.prototype=new DynLayer();
var e3=dynapi.document.addChild(new DynLayer(null,0,0,410,75));
e3.addChild(new Box(0,0,'#cccccc'));
e3.addChild(new Box(80,0,'#cccccc'));
e3.addChild(new Box(160,0,'#cccccc'));
e3.addChild(new Box(240,0,'#cccccc'));
e3.addChild(new Box(320,0,'#cccccc'));
e3.addChild(new Box(360,25,'#bbbbbb'));
e3.addChild(new Box(280,25,'#bbbbbb'));
e3.addChild(new Box(200,25,'#bbbbbb'));
e3.addChild(new Box(120,25,'#bbbbbb'));
e3.addChild(new Box(40,25,'#bbbbbb'));
e3.createTabManager(); // all children
e3.addTabListeners(fmListener);
// hidden information
var e4=dynapi.document.addChild(new DynLayer(null,null,null,380,150));
FORM=null;
function getForm() {
  if(FORM) return;
  FORM=TabManager.getForm(e4);
  var html4='When using the [Tab] key in Mozilla this text field prevents default tab focus. It may be <a href="" onclick="FORM.setVisible(false);return false;">hidden</a> (unfortunately the cursor is still visible).<br>When using NS4 on Linux with broken key events make sure this text field is <a href="" onclick="FORM.setVisible(true);return false;">visible</a> and click in the field to force focus and allow key input.'
  e4.addChild(new DynLayer(html4,30,0,350,100));
}
</script>
</head>
<body bgcolor="#eeeeee">
<table border=0 cellspacing=4 cellpadding=4>
<tr><td colspan=2 align="center">Tab Manager Demonstration 2</td></tr>
<tr>
<td valign="top">
<p>Names Datasource<br>
<script>dynapi.document.insertChild(e1,'relative');</script>
<p>Acronyms Datasource<br>
<script>dynapi.document.insertChild(e2,'relative');</script>
<p>Tab Manager and Focus Manager<br>
<script>dynapi.document.insertChild(e3,'relative');</script>
</td>
<td valign="top"><ol>
<li>In NS4 click in the window and use the numeric keypad (Num Lock) arrow keys to tab around the menus and the space key to select.
<li>For other browsers use the numeric keypad or standard arrow keys to tab around the menus and the enter or space key to select.
<li>On some browsers it is possible to use the [SHIFT+Tab] and [Tab] keys to move left and right repectively. Use up and down arrow keys to move between the menus as before.
<li>To prevent default tab focus when using the [Tab] key in Mozilla or when trying to use NS4 on Linux with broken key events, click <a href="" onclick="getForm();return false;">here</a>.</ol>
<script>dynapi.document.insertChild(e4,'relative');</script>
</td>
</tr>
</table>
</body>
</html>

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us