2 Replies Latest reply: Aug 19, 2013 1:23 AM by Manish RSS

    How can i pass client arguments in javascript when i have using client listener in selectOneRadio component

    Manish

      Hi All,

       

      i'm using jdev version 11.1.1.5.0

       

      i want to pass attribute in my javascript function which i have called in adf SelectOneChoice component using clientlistener.

       

      i have followed this tutorial

       

      http://www.oracle.com/technetwork/developer-tools/adf/learnmore/34-extra-arguments-to-javascript-169176.pdf

       

      but problem is that <af:clientAttribute> is not valid child of  <af:selectOneRadio> component.

       

      so how can i pass argument when i have using <af:selectOneRadio> component.

      any other way to do this?

       

      thanks

       

      Manish

        • 1. Re: How can i pass client arguments in javascript when i have using client listener in selectOneRadio component
          kdario

          JDeveloper will show error when you put af:clientAttribute to some elements(af:table, etc.) but usually this works as expected in runtime.

          So, just try to run page...

           

          Dario

          • 2. Re: How can i pass client arguments in javascript when i have using client listener in selectOneRadio component
            Manish

            Hi Dario,

             

            i have run but it is not working as per requirment.

             

            actually i'm using glass pane on SelectOneRadio component to prevent user input when busy.

             

            for this purpose i have done like this link

            http://www.oracle.com/technetwork/developer-tools/adf/learnmore/27-long-running-queries-169166.pdf

             

            but in my use case i'm using bounded task flow (jsff page) and deployed in webcenter portal that's why i have to use popup id like

             

            r1:0:p11 (where r1 is region id and p11 is popup id).

             

            code is following-

             

             

             

                              function enforcePreventUserInput(evt){         

                        var pid="r1:0:p11";

                    var popup = AdfPage.PAGE.findComponentByAbsoluteId(pid);

              

             

             

               if (popup != null){

                  AdfPage.PAGE.addBusyStateListener(popup,handleBusyState);       

            evt.preventUserInput();

                } 

              }    

                      

            //JavaScript call back handler

            function handleBusyState(evt){

             

            var pid="r1:0:p11";

              var popup = AdfPage.PAGE.findComponentByAbsoluteId(pid);    

                 

                 

                if(popup!=null){

                  if (evt.isBusy()){

                    popup.show();  

                  }

            else if (popup.isPopupVisible()) {

                    popup.hide();

                   AdfPage.PAGE.removeBusyStateListener(popup,handleBusyState);

                  }

               }

            }

             

            this code running well on local environment but when i have deployed it as bounded task flow on staging server it is not show popup

            i think that is  happen because of it is not find region id at run time

             

            so i'm using client attribute to pass region id run time.

             

            for this purpose i have created method on managed bean and call to value of client attribute.

             

            code-

             

            <af:clientAttribute name="pid" value="#{pageFlowScope.CMASRAPPROVAL.popupid}"/>

             

                public String getPopupid() {

                    FacesContext context = FacesContext.getCurrentInstance();

                    RichPopup popup = (RichPopup) CmsarUtillClass.findComponent("p11");

                    ExtendedRenderKitService service =Service.getRenderKitService(context, ExtendedRenderKitService.class);

                                        String pid=(String)popup.getClientId(context) ;

                                        System.out.println(pid);

                    return pid;

                }

             

            and in javascript method change

            var pid="r1:0:p11";

            to

              var pid =evt.getSource().getProperty("pid");

             

            but it is not show popup.

             

            i think now you understand my problem.

            and thanks for reply.

             

            Manish