How to access table fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • EvrimAgha
    New Member
    • Aug 2007
    • 11

    #1

    How to access table fields

    Hi

    In beginning I apologize to sending this question to two newsgroups (Java and JavaScript) ,if it is not appropriate. I was not sure which is the correct newsgroup to send it to.

    I have a JSP that builds a table and shows the values in fields according to what has been passed to it through a request.setAttr ibute of a servlet.

    For example the two dimensional array "test" has this data:

    Col1 Col2 Col3
    Row1 a b c
    Row2 d e f



    and JSP will read this from request variable and display it.

    These values (a,d) are displayed as hyper links to a page testpage.jsp.

    What I need to do is, when user clicks a , I need to set b and c in a variable array and pass it to the next page , or when user clicks d I need to pass e and f to next page.

    1. Could you please tell me how to do that ?

    2. Do I need Javascript/ Ajax ? or it can be done in Java?

    3. How is it possible to access and change a request variable from JavaScript ?


    Appreciate your help in advance
    Evrim
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    If you already know beforehand what will appear in the second and third column when rendering the page in JSP, you can set the URL of the first column data to include b and c or e and f, e.g. [HTML]<td><a href="testpage. jsp?field1=b&fi eld2=c">a</a></td>[/HTML]

    Comment

    Working...