6 Replies Latest reply: Dec 18, 2012 4:55 PM by Kronos72it RSS

    enabling combo box via adf client javascript

    Kronos72it
      Hi , I need to use a bit of javascript to manage some cascade enabling/disabling components.
      In detail I have a radio group buttons with 2 radio : accept and reject (these componetns are the pilot) and also have a combo list (this is the guided component) that must be enabled or disabled based on selection of radio buttons .
      Then I am using the following javascript called by a clientListener (valueChange) on button's group :

      here , acceptRadio is the radio group and reasonCombo is the combo list :

      <af:resource type="javascript">
      function rejectionEnabling(event){
      var source = event.getSource();
      var reasonCombo=AdfPage.PAGE.findComponent('reasonCombo');
      var v = source.getProperty('value');
      if (source.getProperty('id') == 'acceptRadio'){

      if (source.getProperty('value')==1){
      reasonCombo.setProperty('disabled',false);
      reasonCombo.setProperty('disabled',1);
      reasonCombo.setProperty('disabled',"false");
      reasonCombo.setEditable('true');
      reasonCombo.setEditable(true);
      reasonCombo.setEditable();
      } else
      reasonCombo.setProperty(true,'disabled');
      }
      if (source.getProperty('id') == 'reasonCombo'){
      var reasonText=AdfPage.PAGE.findComponent('reasonText');
      if (source.getProperty('value') =='OTHER')
      reasonText.setProperty('disabled',false);
      else
      reasonText.setProperty('disabled',true);
      }
      event.cancel();
      }


      As you can see I used many calls on reasonCombo ( I am not sure if I have to use setEditable or setProperty) but any on these calls working ...I dont understand why