6 Replies Latest reply: Oct 8, 2013 2:33 PM by fxmatz RSS

    dynamic forms

    salute-Salem

      db and dev 10g rel2 ,

      hi all ,

      i am developing a medical laboratory application , the problem is regarding the results of the patients' tests ,

      there a lot of test types , each test has it is own form , and each form has it's own items ,

      sure there are items in common between forms , but the problem is the number of tests is about 200 test , and that requires 200 form .

       

      what to do in order to reduce the work , sure i can not draw 200 form for each test ,

      i heared about something called "build the form dynamically" , but did not know how although i search for it , and i do not know if it is the right solution for the problem

      , if you can guide me with this solution or another one (simpler) ofcourse ?

       

      thanks in advance

        • 1. Re: dynamic forms
          Q_STEPHENSON

          The issue is no matter how you look at it you're gonna have to code for 200 test scenarios. How many tables do you have in your DB design.

          • 2. Re: dynamic forms
            Andreas Weiden

            Depends on how complex these tests are. If there are just some fields to show, you could create a form with a bunch of number-fields and build a table to configure your test. Then at runtime, depending on the test chosen you can set the item-properties (such as the prompt_text min- and max-value and Visible/not visible).

            • 3. Re: dynamic forms
              salute-Salem

              It is just some fields , the data will not be stored in the database .

               

              2-do you want me to create a number of fields , and in a when-new-form-instance for example write this

              if test_name is .......

              then

              set_item_property(item_name,visible,property_false) ;

              set_item_property(item_name,prompt,...........) ;

              end if ;

              and do that for a number of fields ?

              if so i think i will be forced to write a lot of (if statements) depending on the test name ?

               

              i think drawing 200 forms would be simpler , if i understand you correctly .

              ???

              • 4. Re: dynamic forms
                Marwim

                2-do you want me to create a number of fields , and in a when-new-form-instance for example write this

                if test_name is .......

                then

                set_item_property(item_name,visible,property_false) ;

                set_item_property(item_name,prompt,...........) ;

                end if ;

                and do that for a number of fields ?

                if so i think i will be forced to write a lot of (if statements) depending on the test name ?

                 

                i think drawing 200 forms would be simpler , if i understand you correctly .

                ???

                Not necessarily.

                You can build a table like

                TestItemvisiblepromptlowhigh...
                xyznumber1YValue fr01000whatever
                xyztext1N
                xyztext2YTheter
                abcnumber1YValue kl [%]0100

                 

                In your form you only need to read the value accourding to the current test and apply it to your item.

                This is how we store e.g. the accessible menue items depending on the role of a user. No hard coding in your forms and easy to maintain. At least easier than building and maintaining 200 forms modules.

                 

                Regards

                Marcus

                • 5. Re: dynamic forms
                  Andreas Weiden

                  My idea was similar to the one marwim already posted. Create a table-structure to store for each test which fields are relevant and how they should be shown.

                  • 6. Re: dynamic forms
                    fxmatz

                    Hi,

                     

                    I have tried a little demo of a dynamic data read Forms defined as a select in a table:

                     

                    Forms11g - Procedure-Block mit dynamischem SQL in der Datenbank definiert

                    Preview

                     

                    From this multi record block I would navigate to a single record Form that includes the CRUD functionality.

                     

                    Hope it helps,

                    Friedhold