7 Replies Latest reply: Dec 12, 2011 1:52 PM by ramp RSS

    Please help me on Data Grid or Smiliar thing in JSP ?

    904227
      I am developing a J2EE application where I have the following scenario:

      On a JSP Page there's a button 'Fetch' which when clicked fetches some dynamic records based on some criteria from the Oracle DB and displays them on the JSP page.
      Now these records, say 50, have to be displayed in a table like format where the first column of every row will be a radio button.

      Now as I click any one radio button and click on the submit button below my records table, the next page should read the entire record corresponding to that particularly clicked radio button.


      In .NET , I have heard of Data Grids API doing this, but in Java I don't find any solution on how to implement this UI situation.
      Any custom tags or API known to you for this, please share.

      Awaiting for your creative responses. :)
        • 1. Re: Please help me on Data Grid or Smiliar thing in JSP ?
          gimbal2
          Plain old JSP doesn't have any components, its just a low level templating system to be able to generate dynamic content. If you want such components you'll have to investigate the web frameworks; for example Javaserver Faces (AKA JSF) has a whole host of components and many extension frameworks which add a whole lot more, generally "web 2.0" enabled.

          But probably you don't need to go that far. What you seem to want is to simply generate a HTML table and fill it with the data from a JDBC resultset, then add some simple HTML form logic to be able to select a row and submit to a second JSP page. What exactly is stopping you from implementing these very basic things?
          • 2. Re: Please help me on Data Grid or Smiliar thing in JSP ?
            904227
            Thanks for the reply but my problem still remains unsolved:
            Because when you say, *" add some simple HTML form logic to be able to select a row and submit to a second JSP page"*, this is where I'm exactly stuck with.

            Can you or someone give me an example of this part of code ?

            gimbal2 wrote:


            But probably you don't need to go that far. What you seem to want is to simply generate a HTML table and fill it with the data from a JDBC resultset, then add some simple HTML form logic to be able to select a row and submit to a second JSP page. What exactly is stopping you from implementing these very basic things?
            • 3. Re: Please help me on Data Grid or Smiliar thing in JSP ?
              DrClap
              You're asking how to write HTML to include a link to a URL? The <a> element would be my choice for that. But really, you ought to have a basic grasp of HTML before you start trying to write JSPs.

              Or did your question mean something else? At any rate if you're going to write JSPs, your first step should be to design the HTML you want, and then write JSP to produce that HTML. That may seem obvious but you'd be surprised how many people don't seem to understand that.
              • 4. Re: Please help me on Data Grid or Smiliar thing in JSP ?
                gimbal2
                kmrobin wrote:
                Because when you say, *" add some simple HTML form logic to be able to select a row and submit to a second JSP page"*, this is where I'm exactly stuck with.
                As said, you need to learn the web basics dude. HTML, CSS, Javascript. You can try piecing it together from the web, but I would highly recommend you get a good book. To have a basic introduction into HTML in relation to servlets and JSPs, this free one I have spammed about a thousand times on this forum now is very good:

                http://pdf.coreservlets.com/
                • 5. Re: Please help me on Data Grid or Smiliar thing in JSP ?
                  904227
                  All,

                  Thanks for your time to post the responses.
                  I think you all aren't able to interpret my problem statement correctly.

                  If DataGrids and their action triggering would have been a plain HTML/Javascript thing then perhaps there hadn't been separate APIs in other web languages for this.

                  Anyways thanks to all who advised of reading the html books. I was to create my own jar for this similar functionality as available in other languages, and just thought if some geek could help me out on developing this specific API, but let it be.
                  I've no option but to proceed on my own.
                  Thanks all. :)
                  • 6. Re: Please help me on Data Grid or Smiliar thing in JSP ?
                    EJP
                    I think you all aren't able to interpret my problem statement correctly.
                    I don't see any evidence of that. All I see is evidence that you didn't understand any of the responses.
                    If DataGrids and their action triggering would have been a plain HTML/Javascript thing then perhaps there hadn't been separate APIs in other web languages for this.
                    The conclusion is that you should be using one of those, such as JSF, as you were already advised in all those inadequate responses. Alternatively you can continue to fantasize that such a facility is present in JSP when it isn't.
                    just thought if some geek could help me out on developing this specific API
                    You may have thought it but you didn't ask for it. You asked for 'Any custom tags or API known to you for this, please share'. You got the answer to the question you asked.
                    I've no option but to proceed on my own.
                    I agree.
                    • 7. Re: Please help me on Data Grid or Smiliar thing in JSP ?
                      ramp
                      kmrobin wrote:
                      All,

                      Thanks for your time to post the responses.
                      I think you all aren't able to interpret my problem statement correctly.

                      If DataGrids and their action triggering would have been a plain HTML/Javascript thing then perhaps there hadn't been separate APIs in other web languages for this.

                      Anyways thanks to all who advised of reading the html books. I was to create my own jar for this similar functionality as available in other languages, and just thought if some geek could help me out on developing this specific API, but let it be.
                      I've no option but to proceed on my own.
                      Thanks all. :)
                      jsp/servlets, json and jquery data tables - http://datatables.net/