Henner,

 

I debugged DBFormsTag. The problem lies in the sortFields function when it receives a str parameter like the following:

 

str= ";[EMAIL PROTECTED]@root_5;[EMAIL PROTECTED]@root_5;[EMAIL PROTECTED]@root_5;[EMAIL PROTECTED];[EMAIL PROTECTED]@root_5"

 

In this part of the routine:

 

          try {

                    ident1 = Integer.parseInt(tmp1.substring(tmp1.indexOf(

                                       "_", 2) + 1, tmp1.indexOf("@")));

                    ident2 = Integer.parseInt(tmp2.substring(tmp2.indexOf(

                             "_", 2) + 1, tmp2.indexOf("@")));

          } catch (Exception e) {

                    ident1 = -1;

                    ident2 = -1;

          }

          if (ident2 < ident1) {

                    arr.set(i, tmp2);

                    arr.set(j, tmp1);

                    tmp1 = tmp2;

          }

 

If temp1 or temp2 is [EMAIL PROTECTED] than it will throw an exception setting both indexes in -1 and thus leaving [EMAIL PROTECTED] in its current position. I have temporarily patched it like this:

 

          } catch (Exception e) {

                    ident1 = -1;

                    ident2 = -1;

                    if (tmp1.indexOf("ins") != -1){

                             ident1 = arr.size();

                    }

                    else if (tmp2.indexOf("ins") != -1){

                             ident2 = arr.size();

                    }

          }

 

Please let me know if you run into the same problem with the test page I sent and if so what the solution is.

 

Thanks,

 

Julio

 

 


From: Julio Ortuzar O. [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 13, 2004 12:46 PM
To: 'Henner Kollmann'
Cc: '[EMAIL PROTECTED]'
Subject: RE: [dbforms] Possible bug in

 

Henner,

 

I’m attaching file \tomcat\webapps\bookstore\tests\testAuthorBooksSubFormWithJavascriptFieldsArray.jsp

 

1-     Load the page

2-     Click on the last row of the “Click here to check!” field on the subform. Everything should be ok.

3-     Hit the new button on the subform.

4-     Click on the “Click here to check!” field. You should get an error.

5-     Click on the IE back button and refresh the page.

6-     Click on the last row again of the “Click here to check!” field. You should get an error again.

 

Thanks,

 

Julio

 


From: Henner Kollmann [mailto:[EMAIL PROTECTED]
Sent: Friday, November 12, 2004 2:05 PM
To: 'Julio Ortuzar O.'
Cc: [EMAIL PROTECTED]
Subject: AW: [dbforms] Possible bug in

 

Could you build a test page based on the bookstore example to reproduce?

 

Thanks

Henner

 


Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Julio Ortuzar O.
Gesendet: Freitag, 12. November 2004 17:40
An: 'Henner Kollmann'
Cc: [EMAIL PROTECTED]
Betreff: RE: [dbforms] Possible bug in

2.4_20040804

 

Thx,

 

Julio

 


From: Henner Kollmann [mailto:[EMAIL PROTECTED]
Sent: Friday, November 12, 2004 5:42 AM
To: 'Julio Ortuzar O.'
Cc: [EMAIL PROTECTED]
Subject: AW: [dbforms] Possible bug in

 

Which version do you use?

 

regards,

 

Henner

 


Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Julio Ortuzar O.
Gesendet: Donnerstag, 11. November 2004 22:20
An: [EMAIL PROTECTED]
Betreff: [dbforms] Possible bug in

Hi,

 

I have a form with another nested form. Problem occurs when I use _javascript_FieldsArray on both to get the _javascript_ Fields Arrays.

 

The fields with * below belong to the subform. If you notice, the “_ins0” variable is at pos (length-2) instead of (length-1) as I should be. At least that is the real name of the input variable in html when inserting a new row.

 

This means I’m getting an error when I fetch the var name on navnew event since it gives for example "[EMAIL PROTECTED]@root_1" instead of "[EMAIL PROTECTED]".

 

 

<SCRIPT language="_javascript_">

<!--

 

    var dbFormFields = new Array();

    dbFormFields["dispatch_whouse_type_id_from"] = new Array("[EMAIL PROTECTED]", "f_30_insroot_4");

    dbFormFields["dispatch_freight_cost"] = new Array("[EMAIL PROTECTED]", "f_30_insroot_9");

*   dbFormFields["product_amount"] = new Array("[EMAIL PROTECTED]@root_5", "[EMAIL PROTECTED]@root_5", "[EMAIL PROTECTED]", "[EMAIL PROTECTED]@root_5");

    dbFormFields["dispatch_freight_cost_curr"] = new Array("[EMAIL PROTECTED]", "f_30_insroot_10");

    dbFormFields["dispatch_whouse_id_to"] = new Array("[EMAIL PROTECTED]", "f_30_insroot_7");

*   dbFormFields["dispatch_rcpt_type_id"] = new Array("[EMAIL PROTECTED]@root_1", "[EMAIL PROTECTED]@root_1", "[EMAIL PROTECTED]", "[EMAIL PROTECTED]@root_1");

*   dbFormFields["product_id"] = new Array("[EMAIL PROTECTED]@root_4", "[EMAIL PROTECTED]@root_4", "[EMAIL PROTECTED]", "[EMAIL PROTECTED]@root_4");

    dbFormFields["dispatch_whouse_type_id_to"] = new Array("[EMAIL PROTECTED]", "f_30_insroot_6");

    dbFormFields["dispatch_movement_date"] = new Array("[EMAIL PROTECTED]", "f_30_insroot_8");

    dbFormFields["dispatch_rut_dv"] = new Array("[EMAIL PROTECTED]", "f_30_insroot_2");

*   dbFormFields["product_type_id"] = new Array("[EMAIL PROTECTED]@root_3", "[EMAIL PROTECTED]@root_3", "[EMAIL PROTECTED]", "[EMAIL PROTECTED]@root_3");

    dbFormFields["dispatch_company_rut"] = new Array("[EMAIL PROTECTED]", "f_30_insroot_1");

    dbFormFields["dispatch_rcpt_num"] = new Array("[EMAIL PROTECTED]", "f_30_insroot_3");

*   dbFormFields["production_id"] = new Array("[EMAIL PROTECTED]@root_8", "[EMAIL PROTECTED]@root_8", "[EMAIL PROTECTED]", "[EMAIL PROTECTED]@root_8");

    dbFormFields["dispatch_obs"] = new Array("[EMAIL PROTECTED]", "f_30_insroot_11");

    dbFormFields["dispatch_whouse_id_from"] = new Array("[EMAIL PROTECTED]", "f_30_insroot_5");

 

    function getDbFormFieldName(name){

      return getDbFormFieldName(name,null);

    }

 

 

    function getDbFormFieldName(name,pos){

      var result = dbFormFields[name];

      if(pos==null) return result[result.length-1];

      return result[pos];

    }

--></SCRIPT>

 

 

Rgds,

 

Julio

Reply via email to