Menu

new fields

Help
MisterT
2005-06-16
2013-06-03
  • MisterT

    MisterT - 2005-06-16

    Hi!
    We are using dbforms in a project. Now we like to add a function, to create a new field (column) in a given table at runtime. Can dbforms handle this?

    Thanks in advance for all informations!

    regards T.

     
    • Henner Kollmann

      Henner Kollmann - 2005-06-16

      New field in the database? Or new field in the configuration?

      Henner

       
      • MisterT

        MisterT - 2005-06-16

        We like to add new field(s) in the database tables at the runtime.

        regards T.

         
      • MisterT

        MisterT - 2005-06-16

        The question is: can we see and use the new fields via dbforms as soon as they are created in the DB?

        As far as I now, dbforms is structured in static table definitions in the dbforms-config.xml.

        regards T.

         
        • Henner Kollmann

          Henner Kollmann - 2005-06-16

          Yes it is. But you can change the field definition at runtime with some code.

          Henner

           
    • MisterT

      MisterT - 2005-06-16

      You mean the definitions in the dbforms-config?

      Ok, that's right, I will try it with an xml parser. Hopefully the dbforms framework will notice the changes immediately.

      But now we have to explore the field structure of a table in a dynamic manner within the JSPs.

      Is there an object in dbforms with a fields list in it?

      regards T.

       
      • Henner Kollmann

        Henner Kollmann - 2005-06-17

        No the framework will not notice the changes  immediately. The only possibility is to add fields with program code. You must access the config data by a servlet and add the field definitions at runtime.

        Yes there is an object with the fields list. Have a look at the Config object, there is  a method tableByName or so. With the table in your hand you have access to the fields list.

        regards,
        Henner

         
        • MisterT

          MisterT - 2005-06-17

          OK, now I see. We have to access the config object. Since this access will produce temporary modifications in the fields list object (it will be lost on next application startup), I think we will write the new table field to the xml config file too.

          Thanks for your hints Henner!

          regards T.

           

Log in to post a comment.