[Javascript] click in table 1 rows the second table change ??

Rakesh Pai rakeshpai at gmail.com
Fri Aug 11 09:19:41 CDT 2006


Your strategy to handle this would depend a lot on the kind of data
you want to display in the second table. Is the table going to be the
same for every selection of the first table, or is it going to be
different depending on the selection in the first table? Also, since
you are using JSP, I assume you must be having a database populating
the records in the first table too. In that case, can you be sure of
how many records you have there?

If you can't be sure beforehand about how many rows of data you have
in the first table AND if the data in the second table is going to
depend on the selection of the first table, I would suggest you Ajax
to power the page.

If you are sure that the number of rows is a fixed small number (10 in
the example you showed above) OR if every item on the first table
generates the same list in the second table, you can decide to carry
out the entire operation on the client-side.

In any case, you can use innerHTML (which I happen to hate) to draw
the second table. A second, more flexible and more robust method,
albeit a little verbose, would be to use DOM manipulation methods to
create the table.

This is really not a difficult to handle situation. If you haven't
understood any of the terminology I've used in this mail, Google it,
and you'll get pointers.

On 8/11/06, Troy III Ajnej <trojani2000 at hotmail.com> wrote:
>
> Hello, Majid.
>  I'm very doubtful in how its going to work.
>  I hate tables and I always had an assistant
>  whose only duty was to build tables. She hated that also, but that was her
> job.
>  You go try first build your tables and than see if you have thought it
> correctly.
>  Because I think your strategy will not do.
>  Is it possible that you need one table with two columns, instead of two,
> with single column?
>  No way, I sense redundancy either way. This is going to get you nowhere.
> Anyway, you build your example tables and see how should they really
> correspond,
>  - than we shall see what could javascript do for you.
> Regards.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>                                          Troy III
>                            progressive art enterprise
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  ________________________________
>
>  > From: yna54 at hotmail.com
> > To: javascript at LaTech.edu
> > Date: Fri, 11 Aug 2006 04:42:41 +0000
> > Subject: [Javascript] click in table 1 rows the second table change ??
>
> >
> > I am trying to have in my jsp page two tables :
> >
> >   First table : Select the package  :
> >   row1
> >   row2
> >   row3
> >   ...
> >   row10
> >
> >   each time the user select a row, the rows in the
> second table change
> > :
> >   for example if the user click in row2 the
> second table will be like
> > this :
> >
> >   Second Table : Select the page to print :
> >   row2Page1
> >   row2Page2
> >   ...
> >   row2Page6
> >   Could you please give me an idea on how to do it,
> thanks your help is
> > appreciated.
> > _______________________________________________
>
> ________________________________
> With MSN Spaces email straight to your blog. Upload jokes, photos and more.
> It's free! It's free!
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
>
>


-- 
Rakesh Pai
Mumbai, India.
rakesh.pai at gmail.com
http://piecesofrakesh.blogspot.com/



More information about the Javascript mailing list