6 Replies Latest reply: Dec 13, 2013 10:17 AM by Metabaron RSS

    Displaying values stored via checkbox created from Table

    Metabaron

      Hi Everyone,

       

      I have a 'form' page that I have to let users input data into the database.

       

      one of the items on the input page is

       

      a 'checkbox'.

      the checkbox value list is created via 'Create Dynamic List of Values', which i point to a table with the values in it.

       

      the 'list of values definitaion' look like so:

       

      select DEPT_NAME as display_value, DEPT_CODE as return_value

        from COM_REF_DEPARTMENT

      order by 1

       

      Everything up to this point works as i would expect.

       

      I have a page that shows the details of a given item. Everything displays fine apart from the value generated by the checkboxbox.

      this just displays the codes for the items in the table and not the names, each one seperated by a colon. [standard APEX tuff so far].

      The item is "display only".

       

      I want to know what i have to do to convert these codes back to their names via the relevent table.

       

      I have tried to using the 'List of values' section, but guess thats just for creating the list of values in a list or check box.

       

      I've also tried putting the SQL from the list of values in the 'Source value of expression' field, but that didnt work either.

       

      Any ideas????

        • 1. Re: Displaying values stored via checkbox created from Table
          Metabaron

          ....well Im getting there.

           

          I found a value called 'Based On' in the 'seetings' section.

           

          If i change that to 'Display Value of List of Values' then this works. But, only if one checkbox is clicked.

           

          If more than one checkbox is clicked then it just shows the codes with the semi colons.

          Obvisouly it cant get a match because its reading the agregate rather than splitting it in the components.

          ie its trying to get a match in the database on a list of all the check values with the semi colons rather than seperating out the values and doing a translation on each.

          • 2. Re: Displaying values stored via checkbox created from Table
            Pars

            Hi,

            create plsql process -on submit before computation for insert

            like following

            begin

            insert ....

            into ....

            from ..

            where ...

            end;

             

             

            Pars.

            • 3. Re: Displaying values stored via checkbox created from Table
              Metabaron

              Hi Pars,

               

              Could you explain your answer.

              I don't understand what you are trying to do here.

               

              The values are being stored correctly. eg a code E where the checkbox is Enquirers, code A where the checkbox is Aplicants and code C where the checkbox is Current.

               

              So im not sure why you're suggesting i make alterations to the submit function.

               

              The problem im having is displaying the values correctly when displaying them on another page.

              If there is just one checkbox ticked i get what i want. the conversion on the 'Based on' table list works.

               

              The problem is if they tick two boxes. for example if they clicked enquirers and applicants i would get E:A.

              This is happening because the 'Based on' conversion is falling over because there is no value of E:A in the look up.

              APEX is not looking at the 'E' and the 'A' seperatly.

              • 4. Re: Displaying values stored via checkbox created from Table
                Pars

                Hi,

                Metabaron wrote:

                 

                I want to know what i have to do to convert these codes back to their names via the relevent table.

                 

                I have tried to using the 'List of values' section, but guess thats just for creating the list of values in a list or check box.

                 

                I've also tried putting the SQL from the list of values in the 'Source value of expression' field, but that didnt work either.

                 

                Any ideas????

                ok i feel you have problem while inserting value in table from above Explanation

                 

                 

                my apologies for in previous thread misunderstand.

                 

                 

                Pars.

                • 5. Re: Displaying values stored via checkbox created from Table
                  Joni Vandenberghe

                  Hi Metabaron,

                   

                  And when you have a value of E:A when two checkboxes are checked then what do you insert into your database?

                  I would expect you insert one row with E and one row with A.

                  Can we see your insert process?

                  What does your DB model looks like? Can your DB model handle inserting two rows in that case.

                  If your actually inserting the value "E:A" in your column then ofcource your going to have problems, not just in displaying, but also in joining, indexing,...

                   

                  Regards,

                  Joni

                  • 6. Re: Displaying values stored via checkbox created from Table
                    Metabaron

                    hi Joni,

                     

                    I am just inserting "E:A" into the database.

                    I am happy to do this as i can just say something like:

                     

                    select from table where catagory like '%E%'

                     

                    if i want to find the "E" values.

                     

                    I know this isn't strict normalisation but i don't think i need it in this circumstance. well, apart from this problem.

                    I don't need to index or join on this column.