Tuesday, 24 July 2012

Oracle APEX: Disabling radio button on the value entered in Text box


1)      How to disable redio button depending on the value entered in text box….
Ajax Code:
  1. <script>  
  2.   
  3. function enableDisable(){  
  4. var lValue = $v('P170_VALUE');  
  5. var lTest = false;  
  6. if (!isNaN(lValue)){  
  7.     lTest = (lValue > 0 && $v('P170_CATEGORY') == '')?true:false;  
  8. }  
  9.     $x_disableItem('P170_RADIO_GROUP', lTest)  
  10. }  
  11. </script>  
Settings:
Run:


When P170 value field entered with 10000 or any value two redio buttons ie category 1 & category2 are disabled


2)      Tabular Form With Colors,
Code:
  1. function select_highlight(){  
  2. var l_form = $x('wwvFlowForm').f01;  
  3. for (var i=0,l=l_form.length;i<l;i++){  
  4. l_form[i].options[0].style.background = 'red';  
  5. l_form[i].options[1].style.background = 'yellow';  
  6. }  
  7. }  
Settings:
After executic….                                                      Category  LOV,color:

3>Auto update report:
Code:
  1. <script type="text/javascript">  
  2. <!--  
  3.   
  4. function table_object(pId){  
  5.     this.id = pId;  
  6.     this.start_record = 1;      //optional  
  7.     this.num_record = 5;        //optional  
  8.     this.interval = false;  
  9.     this.refresh = function(pTime){  
  10.         if(my_report.interval){clearInterval(my_report.interval)}  
  11.         if(!!pTime){my_report.interval = setInterval(function(){my_report.call_refresh()},pTime * 1000);}  
  12.     }  
  13.     this.call_refresh = function(){$a_report(this.id.substring(1),this.id.start_record,this.num_record);}  
  14. }  
  15.   
  16. //-->  
  17. </script>  
Settings:
Output:





3)      Progress bar
Code: (in region source)
<script type="text/javascript"> 
    <!--       
    function html_Submit_Progress(pThis){ 
    $x_Show('AjaxLoading'); 
    window.setTimeout('$s("AjaxLoading",$x("AjaxLoading").innerHTML)', 100); 
    doSubmit('APPLY_CHANGES'); 
}       
    function submit_HideAll(pThis){ 
    $x_Hide('wwvFlowForm'); 
    doSubmit('APPLY_CHANGES'); 
    } 
    function submit_ButtonRegion(pThis){ 
    $x_Hide('button_region'); 
    doSubmit('APPLY_CHANGES'); 
    }    
    //--> 
    </script> 
(in region footer):
    <style>   #AjaxLoading{padding:5px;font-size:18px;height=25px;width:200px;text-align:center;left:50%;top:50%;position:absolute;border:2px solid #666;background-color:#FFF;} 
    </style> 
          <div id="AjaxLoading" style="display:none;"><br />..Loading..<img src="#APP_IMAGES#pra.gif" id="wait" /></div> 
In button ->edit set:
Action =redirect to URL
Set URL Target=javascript:html_Submit_Progress(this);
More details visit:


No comments:

Post a Comment