CA Service Management

 View Only
  • 1.  ca_fdEnableFields dont work

    Posted Jul 28, 2015 03:43 PM
      |   view attached

    I have a form called agendamento i have a select called cbExec with two options. In the onLoad agendamento i have the function ca_fd.js.loadAgendamento();

    This function is a script in the agendamento a have this:

     

    {
      loadAgendamento: function(){
       
       var cbExec = ca_fdGetSelectedOptionValues(formId, 'cbExec');
    
       //Habilita campo Execução se status for Aprovar Execução
       if ( _.request.status == 500 ){
          ca_fdEnableFields(ca_fd.formId, new Array('cbExec','dtAgendamento'));
        }else{
          ca_fdDisableFields(ca_fd.formId, new Array('cbExec','dtAgendamento'));
        }
    
        //toogle campos de data
        this.toogleScheduler();
      },
    
      toogleScheduler :function(){
        var isScheduled = ca_fdGetSelectedOptions(formId, 'cbExec')[0];
        if(isScheduled){
          ca_fdShowFields(ca_fd.formId, new Array('dtAgendamento'));
        }else{
          ca_fdHideFields(ca_fd.formId, new Array('dtAgendamento'));
        }
      }
    }
    

     

    why I can not change the value of select cbEx with the mouse and only if I use the tab key?


    PS: The status of the request is 500



    Attachment(s)

    zip
    agendamento.xml.zip   1 KB 1 version


  • 2.  Re: ca_fdEnableFields dont work
    Best Answer

    Posted Jul 30, 2015 02:55 PM

    Hi Poyato,

     

    I created a small test case using two select fields, 'fruit' and 'veg', and invoke loadFields below onLoad of the form. When I request the associated service the 'fruit' select field is displayed and disabled. Once the request reaches 'Pending Approval' status (400) and I select 'Approve/Reject' or 'Perform Action' (to edit the form) I am able to select the 'fruit' dropdown using the mouse without a problem. I verified this in both IE and Chrome.

    {  
      loadFields:function(){  
         
        if ( _.request.status == 400 ){  
          ca_fdEnableFields(ca_fd.formId, new Array('fruit','veg'));  
        }else{  
          ca_fdDisableFields(ca_fd.formId, new Array('fruit','veg'));  
        }  
      
        this.toogleScheduler();  
      },  
      
      toogleScheduler:function(){
    
        var isScheduled = ca_fdGetSelectedOptions(ca_fd.formId, 'fruit')[0];  
        if(isScheduled){  
          ca_fdShowFields(ca_fd.formId, new Array('veg'));  
        }else{  
          ca_fdHideFields(ca_fd.formId, new Array('veg'));  
        }  
      }  
    } 
    

     

    Thanks,

    Jason



  • 3.  Re: ca_fdEnableFields dont work

    Posted Jul 30, 2015 05:38 PM

    My Select is disabled=true by default. In your case it would be the 'fruit'

    I tested in Firefox and Chrome and still not working.

    __2015-07-30 18_36_56-Criador de formulários.jpg



  • 4.  Re: ca_fdEnableFields dont work

    Posted Jul 31, 2015 09:46 AM

    I configured 'fruit' to be disabled by default however I can still select the dropdown as previously noted. What version and patch level of Catalog are you using?



  • 5.  Re: ca_fdEnableFields dont work

    Posted Aug 17, 2015 10:00 AM