473,394 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

dynamic coding.

Hello,

I've coded a tab pages somes years ago, with a search engine (with the help
of an other programmer) allowing to search in many divs (any tab show/hide a
div).

Now, I've to change code as new tabs are added. I've a frame where I load
the tabs and fill div with queries, and an other frame where I have the
search form. I'm looking for a way to have dynamic creation of the code,
depending on the loaded divs or tabs.

Here is the javascript code allowing to switch DIV for finding any string in
many DIVS, then show the desired DIV.
....
var oRng1 = win.document.body.createTextRange();
var oRng2 = oRng1.duplicate();
var oRng3 = oRng1.duplicate();
....
oRng1.moveToElementText(win.DIVBrother);
oRng2.moveToElementText(win.DIVCanon);
oRng3.moveToElementText(win.DIVEpson);
....
if(win.DIVBrother.style.visibility=='visible') var bInside =
oRng1.inRange(TRange);
if(win.DIVCanon.style.visibility=='visible') var bInside =
oRng2.inRange(TRange);
if(win.DIVEpson.style.visibility=='visible') var bInside =
oRng3.inRange(TRange);
....
if(win.DIVBrother.style.visibility=='visible') {
TRange.moveToElementText(win.DIVBrother);
strFound=TRange.findText(str);
TRange.select();
}
if(win.DIVCanon.style.visibility=='visible') {
TRange.moveToElementText(win.DIVCanon);
strFound=TRange.findText(str);
TRange.select();
}
if(win.DIVEpson.style.visibility=='visible') {
TRange.moveToElementText(win.DIVEpson);
strFound=TRange.findText(str);
TRange.select();
}
....
TRange=win.document.body.createTextRange();
if(win.DIVBrother.style.visibility=='visible')
TRange.moveToElementText(win.DIVBrother);
if(win.DIVCanon.style.visibility=='visible')
TRange.moveToElementText(win.DIVCanon);
if(win.DIVEpson.style.visibility=='visible')
TRange.moveToElementText(win.DIVEpson);

if(oRng1.inRange(TRange)) {win.tab0.focus(); win.tab0.click();}
if(oRng2.inRange(TRange)) {win.tab1.focus(); win.tab1.click();}
if(oRng3.inRange(TRange)) {win.tab2.focus(); win.tab2.click();}

For now I've 9 tabs, but the customer want to add 3 more, and maybe once
will want to add some new. I'd like to be able to manage this kind of code
dynamically, but don't know how to do.

Anybody may help me change the code above to do it dynamically managing that
the tabs and DIVs come from an access database ? maybe with an array or
whatever.

Thanks.

Bob
Jul 23 '05 #1
1 1831
Bob Bedford wrote:
Hello,

I've coded a tab pages somes years ago, with a search engine (with the
help of an other programmer) allowing to search in many divs (any tab
show/hide a div).


You need to use a J2EE webserver (Tomcat is free) and custom tags. It's
fairly simple to write a <mytags:tabset> tag which will contain
<mytags:tab>s.

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: only_me | last post by:
Not a coding question as such but highly related to asp/dynamic pages issues : has anyone any suggestions on the following ASP sites are generally (always) of a dynamic nature, pages can be...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
2
by: MacKenzieMouse | last post by:
I have been struggling with creating dynamic tables populated with rows and cells the top row has one cell with a label the next row has four cells with a label each the last row has 4 cells...
3
by: NateDawg | last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if anyone has some input it would sure help me out. Ok, I’ve noticed a few gridview problems floating around the forum....
5
by: cwertman | last post by:
I have a question regarding dynamic properties. I have an Object say Account --Id --Prefix --Fname --Lname --Suffix
11
by: toton | last post by:
Hi, I have little confusion about static memory allocation & dynamic allocation for a cluss member. I have class like class Bar{ public: explicit Bar(){ cout<<"bar default"<<endl; }
3
by: john | last post by:
I am VERY new to C++ (1st semester) put not so new to coding and programming (SQL, VB, etc). We are learning about classes. I have a program that needs to call many instances (i think this is...
0
by: pinxi | last post by:
We are seeking to hire a lead programmer to build a dynamic Web-based imaging module which will enable users to upload a digital image or photograph to the site and choose from thousands of...
0
by: senthilnathan1985 | last post by:
Hi to everybody i implementing asp.net in my project with sql server 2005 i have one doubt in creating dynamic table in design page In php this is the code for creating table rows and...
2
by: bsgeethaece | last post by:
Hai... now I am doing Library Management System Project in Java. ..I wants to create a Dynamic Table in one interface.... if u people know plz forward the coding 2 me....thank you
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.