13 Replies Latest reply: Feb 14, 2014 3:33 AM by Pavan RSS

    update collection dynamic process not working properly

    Pavan

      hi all,

      this is pavan,

      i am using apex 4.2.3,

      i am trying to get add row dynamically with out refresh i am able to do it, when i am adding data in table and clicking on the previous data is not fetching its refreshed and the empty rows are coming, means the collection not updated

      for this i referred https://apex.oracle.com/pls/apex/htmldb/f?p=31517:294:129399391179038:ADD_ROWS:NO:::

      and help with updating a tabular form using a Dynamic Action

      and APEX_COLLECTION

       

      but i am unable to get it i tried here http://apex.oracle.com/pls/apex/f?p=52985:5:101957963538920:::::

       

      am i miss anything please let me know,

       

      thanks in advance,

       

      Regards,

      Pavan

        • 1. Re: how to update collection dynamically
          Pavan

          hi all,

          i don't why it is not working i tried but the data is not storing in collection,i didn't get any error also,

          if possible please look into it, if i miss anything please let me know,

          created sample in apex.oracle.com/pls/apex ,

          workspace : ajit_personal

          username: Ajit

          password :ajit

          application id: 52985

          page : 5

           

          thanks in advance,

          Regards,

          Pavan

          • 2. Re: how to update collection dynamically
            vincent_deelen

            Hi Pavan,

             

            GusC seems to be coping with the same problem. Please check Re: Development Recommendations 

             

            Regards,

            Vincent

            http://vincentdeelen.blogspot.com

            • 3. Re: how to update collection dynamically
              Pavan

              Hi Vincent thanks for replay,

              and like similar problem but he has another issue,

              and as you said the problem is update_member attribute related only

              i have doubt if the problem is to_number conversion (cxx and nxx) how it is worked in kubicek blog,

              and even i put the the to_char or general way i given but its not worked, but in your workspace its working,

              i didn't get what is real problem is.

              if possible can you explain me bit more please.

               

              Thanks in advance,

              Regards

              Pavan

              • 4. Re: how to update collection dynamically
                vincent_deelen

                Hi Pavan,

                 

                Check your page again please.

                I've changed some code (commented your code, and put in some new)

                Your update didn't look like it worked because you had a mistake in your column mapping: you assigned the text items as f05,f06 and f07, yet your query was based on collection columns c001,c002 and c003. So basically you were updating columns 5-7 and looking at columns 1-3.

                I've also changed your before header process, yours worked ok, but using apex_collection.create_or_truncate_collection is easier in use as it doesn't require the check for an existing collection.

                 

                Regards,

                Vincent

                http://vincentdeelen.blogspot.com

                • 5. Re: how to update collection dynamically
                  Pavan

                  thanks for replay Vincent,

                  i have a doubt in that, if i am having two collections in same page, so collection has start from c001,c002 like right,

                  but apex_item this is for page we can assign one number to one item, how this time we can give like you said matching 1 to c001 like,

                   

                  if possible just check the same page i created but again not working , i confused can you explain once possible,

                   

                  thanks in advance,

                  Pavan

                  • 6. Re: how to update collection dynamically
                    vincent_deelen

                    Hi Pavan,

                     

                    It does work for two collections. You forgot to set the "Page Items to Submit" attribute of your dynamic action pl/sql action.

                     

                    Regards,

                    Vincent

                    http://vincentdeelen.blogspot.com

                    • 7. Re: how to update collection dynamically
                      Pavan

                      thanks for replay Vincent,

                      sorry for the mistake, and like actually if it is form APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY the value always start from c001 right, for two collections also it start from c001 if we want display the field then how we can match, if want update collection it start from c004,

                       

                      if possible just check the same page i created the scenario if i put nulls ex(select null,null,null,deptno,dname,loc from dept), its working fine but i think it not good practice,

                      like scenario when it comes the first table consists 10 columns then its not good to put 10 nulls i think,

                      if possible let me know how we can modify this, to get better solution or i have to follow the null solution,


                      thanks in advance,

                      Pavan

                      • 8. Re: how to update collection dynamically
                        vincent_deelen

                        Hi Pavan,

                         

                        Funny you mention the create_collection_from_query. I thought about that one two. Problem is, as you mention it always starts at column c001. I can see no other way than using a number of "null" columns to force your actual query columns to start at an ather c00x-number. I don't think create_collection_from_query is very suitable when you want to use more than one collection based report on your page.

                         

                        --UPDATE

                        Pavan, you might want to check this old forum post: Re: column count of dynamic query

                        It describes a function to count the number of columns in a dynamic query. If you want to use create_collection_from_query, you can use that function to count the number of columns in your first collection query, and use the result to determine the number of "null"-columns you need to  include in your second query.

                         

                        Regards,

                        Vincent

                        http://vincentdeelen.blogspot.com

                         

                        Message was edited by: vincent_deelen

                        • 9. Re: how to update collection dynamically
                          Pavan

                          Thanks for replay Vincent,

                          thanks for spending your valuable time for me,

                          i got it, you think its funny to mention ending query, but i worked with both scenarios that is the problem,

                           

                          and one more thing if possible how to refer apex_item.date_popup in jquery selector like we referring for text field- input[name="f02"], and for select list item select[name="f03"] ,

                          like for this any documentation is available please let me know,

                          thanks in advance,

                          Regards,

                          Pavan

                          • 10. Re: how to update collection dynamically
                            vincent_deelen

                            Pavan,

                             

                            Apex_item.date_popup gets rendered as input field, so you should be able to reference it the same way you do a text field: input[name="fxx"].

                             

                            Regards,

                            Vincent

                            http://vincentdeelen.blogspot.com

                            • 11. Re: how to update collection dynamically
                              Pavan

                              hi Vincent,

                              thanks for replay,

                              before i tried like that only but its not working,that's way i am asking,

                              even its not calling the function i used alert,

                              if possible i make the changes in same page can you look into it once,


                              thanks in advance,

                              Regards,

                              Pavan

                              • 12. Re: how to update collection dynamically
                                vincent_deelen

                                Pavan,

                                 

                                Check your page again. You should use the jQuery based date picker (apex_item.date_popup2). The old date pop up doesn't trigger a change event in the input field, the new pop up does.

                                Note that in your current setup you will store the date value in a varchar2 column (c003), thus turning it into a character value rather than a date value.

                                 

                                Regards,

                                Vincent

                                http://vincentdeelen.blogspot.com

                                • 13. Re: how to update collection dynamically
                                  Pavan

                                  hi Vincent,

                                  thanks for replay and spending your valuable time for me,

                                  i checked its going fine i read APEX_ITEM.DATE_POPUP2 its returning varchar2 only,

                                  i have a doubt why it is not worked with  APEX_ITEM.DATE_POPUP.

                                   

                                  thanks in advance,

                                  Regards,

                                  Pavan