1 2 Previous Next 15 Replies Latest reply: Sep 22, 2011 8:48 AM by Juergen RSS

    Auto filter Shuttle selection list

    pj*433620*ng
      Hi,
      I am using Apex 4.02, just wonder if it possible to use dynamic action to filter the selection list in the shuttle item base on
      value in another text item?

      Thanks
        • 1. Re: Auto filter Shuttle selection list
          vee
          Yes you can,
          Create a Dynamic action that does that
              Event: change
              Item : Dependent item Name
              No condition
              Action : Refresh
              Target: Item
              Item Name: Shuttle Item Name
              Page Items to submit : Dependent item Name
          • 2. Re: Auto filter Shuttle selection list
            Patrick Wolf-Oracle
            Or set the shuttle page item to be a cascading LOV based on your search text field. That's the same as the above dynamic action description but with coding.

            Regards
            Patrick
            -----------
            My Blog: http://www.inside-oracle-apex.com
            APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
            Twitter: http://www.twitter.com/patrickwolf
            • 3. Re: Auto filter Shuttle selection list
              pj*433620*ng
              hi, Vee
              Where can I set the page item to submit?
              I could not find the setting.

              Thanks

              Vincent
              • 4. Re: Auto filter Shuttle selection list
                KartikPatel
                Hi,

                Refer Dimitri Gielis Blog - APEX 4.0: Dynamic Actions - Part 2
                http://dgielis.blogspot.com/2010/02/apex-40-dynamic-actions-part-2.html

                In true action step i.e. on Picture 6 you have to specify page item to submit.

                or refer http://st-curriculum.oracle.com/obe/db/apex/r40/apexdynactions/apexdynactions_ll.htm

                Regards,

                Kartik Patel
                ------------------------------------------------------------------------
                http://patelkartik.blogspot.com/
                http://apex.oracle.com/pls/apex/f?p=9904351712:1

                Edited by: Kartik Patel on Feb 8, 2011 11:05 AM
                • 5. Re: Auto filter Shuttle selection list
                  pj*433620*ng
                  hi,
                  If I chose the Action "Refresh", the Page item to submit won't show...

                  Thanks
                  Vincent
                  • 6. Re: Auto filter Shuttle selection list
                    vee
                    If I chose the Action "Refresh", the Page item to submit won't show...
                    My bad, I had written it down without checking as it came to mind. You are right, "Items to submit" option doesn't show up for Refresh
                    @Patrick : Is there any particular reason why this is not enabled for refresh action.

                    <li>A workaround would be to add another true action to the same Dynamic Action(before the refresh action) that is of PLSQL type , you can choose items to submit or the PLSQL action for the code just put "begin null end;". Since the refresh happens after this action, the item value would be in session.

                    -----
                    If the parent item was a select list you could set that and the shuttle item as a cascaded LOV without any extra code.This was what Patrick had suggested.
                    ------------------------------------

                    <li>Yet another way to the same is a Dynamic Action that does this
                    Event: change
                    Item : Dependent item Name
                    No condition
                    Action : Execute Javascript Code
                      shuttle_item_name  = 'P100_SHUTTLE_ITEM'
                      parent_text_item_name = 'P100_TEXT_ITEM'
                      //Set session state of Text Item before refresh
                      var ajaxRequest=new htmldb_Get(null,$v('pFlowId'),'null',$v('pFlowStepId'));
                      ajaxRequest.add( parent_text_item_name ,$v(parent_text_item_name) );
                      var ajaxResult=ajaxRequest.get();  
                      
                      $('#'+shuttle_item_name).trigger('apexrefresh');
                    Replace the Item names appropriately

                    Hope that solves the problem
                    • 7. Re: Auto filter Shuttle selection list
                      pj*433620*ng
                      Thanks Vee, it's work after I apply your solution 1.
                      • 8. Re: Auto filter Shuttle selection list
                        Patrick Wolf-Oracle
                        Hi Vee,
                        @Patrick : Is there any particular reason why this is not enabled for refresh action.
                        The refresh action just triggers a refresh command for the specified component. The refresh action itself doesn't do any AJAX calls. It's the component itself which has the knowhow how to successfully refresh itself. That's why most of the components which support a refresh do have a "Page Items to Submit".
                        If the parent item was a select list you could set that and the shuttle item as a cascaded LOV without any extra code.This was what Patrick had suggested.
                        Actually it doesn't have to be a select list, it works with any item type. The parent item could for example also be another shuttle item. That's why I would suggest to use the cascade LOV feature instead of using a PL/SQL action and a refresh action to mimic the same functionality. Especially because it will be slower because two AJAX calls will be performed in the background.

                        Regards
                        Patrick
                        -----------
                        My Blog: http://www.inside-oracle-apex.com
                        APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
                        Twitter: http://www.twitter.com/patrickwolf
                        • 9. Re: Auto filter Shuttle selection list
                          vee
                          Thank a lot Patrick, for your clarification

                          Just another question on similar lines,
                          How would the following Custom JS for refresh(I know the declarative way beats it in ease of use ) compare against using the declarative text item and Cascaded LOV item setup
                          shuttle_item_name  = 'P100_SHUTTLE_ITEM'
                            parent_text_item_name = 'P100_TEXT_ITEM'
                            //Set session state of Text Item before refresh
                            var ajaxRequest=new htmldb_Get(null,$v('pFlowId'),'null',$v('pFlowStepId'));
                            ajaxRequest.add( parent_text_item_name ,$v(parent_text_item_name) );
                            var ajaxResult=ajaxRequest.get();
                            
                            //Is there another ajax request here? (I don't see any in firebug console, it could be internal however )
                            $('#'+shuttle_item_name).trigger('apexrefresh');
                          <li>Does the built-in method handle the parent item value submission and return the the new session value of the shuttle item in a single server request itself ?
                          <li>When a refresh event is fired, doesn't the process need to send a new ajax request(internally ) to get the item's value from the session ?.
                          • 10. Re: Auto filter Shuttle selection list
                            Patrick Wolf-Oracle
                            It has the same performance penalty of executing two AJAX calls.

                            The ajaxRequest.get call is a synchronous AJAX call which will also block the browser UI and after that one returns the $('#'+shuttle_item_name).trigger('apexrefresh'); will trigger another an asynchronous AJAX call.

                            Regards
                            Patrick
                            -----------
                            My Blog: http://www.inside-oracle-apex.com
                            APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
                            Twitter: http://www.twitter.com/patrickwolf
                            • 11. Re: Auto filter Shuttle selection list
                              vee
                              Thanks once again Patrick, I think try and keep digging a little more deeper in to these areas.
                              • 12. Re: Auto filter Shuttle selection list
                                Patrick Wolf-Oracle
                                Forgot to answer that
                                Does the built-in method handle the parent item value submission and return the the new session value of the shuttle item in a single server request itself ?
                                Yes it does.
                                When a refresh event is fired, doesn't the process need to send a new ajax request(internally ) to get the item's value from the session ?.
                                It's one AJAX call. The best way to find out what's done internally is to have a look at the Firefox Firebug extension. The "Console" nicely shows all the AJAX requests which are performed.

                                Regards
                                Patrick
                                -----------
                                My Blog: http://www.inside-oracle-apex.com
                                APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
                                Twitter: http://www.twitter.com/patrickwolf
                                • 13. Re: Auto filter Shuttle selection list
                                  pj*433620*ng
                                  Thanks Patrick, I found that the cascade LOV do the same thing and it's easier..
                                  • 14. Re: Auto filter Shuttle selection list
                                    Postie
                                    Patrick is the Javascript example going to be included as std dynamic action?
                                    1 2 Previous Next