Menu

currentRow scripting variable

Help
woodchuck
2005-08-16
2013-06-03
  • woodchuck

    woodchuck - 2005-08-16

    hihi,

    i noticed when i display one row at a time, the currentRow scripting variable is correct (references correct row object).

    however, when i display more than one row of table data (eg. maxRows="4"), the currentRow object seems to be the next row object, not the current one.

    i am using the currentRow object within the <db:body> section and using it like the following:

    <c:out value="${currentRow_myTable.myField}"/>

    has anyone else experienced this too?  i can't see what i may be doing wrong to cause this in the jsp...

    tia,
    woodchuck

     
    • Henner Kollmann

      Henner Kollmann - 2005-08-16

      That's right and correct. See comments in DbBodyTag and testpage testBOOKSListDynaBug.jsp

      tia,
      Henner

       
      • woodchuck

        woodchuck - 2005-08-16

        ah!  now i understand.  thanks!

        woodchuck

         
        • Henner Kollmann

          Henner Kollmann - 2005-08-17

          Yes, therefore the testBOOKSListDynaBug.jsp  page to show different workarounds!
          Henner

           
          • meg

            meg - 2005-12-10

            Hi Henner,

            Like woodchuck, I'm also trying to set manually the form's current row. I did successfully but I have another issue. That's my navigation buttons don't work correctly. They always point to the first row of recordset.

            How can I refresh the status of the buttons accord to the current row? Thanks so much.

            Best regards,
            Meg.

             
            • Henner Kollmann

              Henner Kollmann - 2005-12-10

              I do not understand your question....

              Have you seen the bookstore test pages?

              in testBOOKSSingle.jsp the state of the buttons do reflect the position.

              Regards,
              Henner

               
      • woodchuck

        woodchuck - 2005-08-17

        hihi,

        this works correctly (even with maxRows > 1):

        <c:out value="(${rsv_myTable.currentRowAsMap.myField})"/>

        woodchuck

         
    • meg

      meg - 2005-12-12

      I'm really sorry about the unclear question. Sometimes I make inunderstandable questions when I'm really depressed. Please understand! :D. Anyway, hope that the following can express my thinking.

      First of all, I have a where clause in the <db:dbform ...> tag. And this where clause is built dynamically based on some criterias which is entered by users.
      Then, I have 4 navigation buttons (first, previous, next and last) and an update button in the form.
      Because the form's data is complex, I have to manage the updating. I mean that the updating isn't done by dbforms, that i control the update action.
      Whenever i apply new search criterias, data is queried successfully and the navigation buttons work properly.
      But when i try to do updating, cause of the form is submitted to server, the dbforms is queried data again, so my navigation buttons work incorrectly.
      For example: Before clicked on update, i'm at the record #2. After clicked on update, i'm always at the record #1. (because the where clause is applied again).
      I solved a part of problem. Now my page brings me to the record #2 (by using the setCurrentRow() method), but not my navigation buttons.
      My question is how can I tell to navigation buttons that I'm at the record #2, not #1.

      Thank you so much, :)
      Meg.

       
      • Henner Kollmann

        Henner Kollmann - 2005-12-12

        Do you need a appointment by my women? She is a psychiatrist :-)

        Working with dynamic where clauses is not such a good idea. Navigation will not work probably as you may noticed.

        setCurrentRow is a very internal method and will not update the state of any control!
        You can't do this.

        Hope that helps,

        best regards
        Henner

        A better solution is to use one of the well documented filter mechanism dbforms have.

        Some of them can be controlled dynamically.
        If you look at the very new feature of version 2.6_development you and use the forms interceptor you can make each of them dynamic.

        An example of howto is in the bookstore example.

         
        • meg

          meg - 2005-12-16

          No, i don't want for sure :D, and actually i cannot due to location. :)

          Anyway, i replaced the whereClause to sqlFilter as your suggestion and finally i solved the problem.

          Many thanks for your help!

          Have a good day,
          Meg.

           

Log in to post a comment.

MongoDB Logo MongoDB