?
Solved

PHP & Ajax, YUI tab problem, tabView / DOM

Posted on 2007-03-27
4
Medium Priority
?
683 Views
Last Modified: 2008-01-09
PHP & Ajax, tabView / DOM

I am using YUI's tabView for creating tabs. The content of the tabs are made with PEAR's Flexy. A tab may consist of several select boxes, text fields and check boxes for instance, where the options in the select boxes has been set by the class handling the template system.

The problem occurs when I want to add new tabs. The content in the new tabs should be the same as in the first one. I've tried using innerHTML, but it doesn't seem to work (or I haven't understood it properly). So I wonder if using DOM and building the content dynamically with Javascript can do the magic? I need a way for setting the different select boxes etc. in the tabs, with unique IDs/names. I also need a way for the template class to get the new tabs. Any idèas?
0
Comment
Question by:kkarumu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 18

Expert Comment

by:Mark Gilbert
ID: 18804911
Hi Kkarumu, whilst I haven't tried YUI's tabview, I have played around with ajax, and have achieved some pretty remarkable results.  As you are using php, and are getting to grips with ajax, may I please recommend that you look at xajax:

http://www.xajaxproject.org

With a tab, what I would imagine is that you would query your database, and instead of doing a row per record, you would do a column per record.  So simply setup a function in xajax that is used to query the database, create some html which creates your tabs, using a <td> loop instead of a <tr> loop, and get your tabs dynamically generated.  You will find that with this logic, and the ease of using xajax, you can update your divs without any diffs at all.  I was personally really surprised as how easy it was to use.

There are other options such as limiting your tabs per row depending on column counts.  Such as 5 columns, then start a new row, while the tabs are created with embedded tables to ensure a kind of consistancy.  This obviously takes a little trial and error, however you may find this link useful:

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_21697147.html
0
 
LVL 1

Author Comment

by:kkarumu
ID: 18819951
Thanx for your comment, the main problem was that the same fields on all tabs had the same id, I solved it by sending id og the tab to php and add that to the fields.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 19539298
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question