if($_POST['partial_event']=='complete'){
$render=explode(" ", $_POST['partial_render']);
$resposta='
<span id="alerta" class="ui-growl-pl" data-widget="widget_alerta" data-summary="data-summary" data-severity="all,error" data-redisplay="true"></span>
<script id="alerta_s" type="text/javascript">
DinarteCoelho.cw("Growl", "widget_alerta", {
id: "alerta",
sticky: false,
life: 6000,
escape: true,
keepAlive: false,
msgs: [{
summary: "Processo Completo",
detail: "",
severity: "info",
severityText: "Information"
}]
});
</script>
';
}else{
if($_POST['partial_execute']=='progressBarAjax'){
$exlocal='progressBarAjax_value';
}
if($_POST['partial_execute']=='progressBarAjaxLong'){
$exlocal='progressBarAjaxLong_value';
}
$_SESSION['contador']=$_SESSION['contador']+10;
if ($_SESSION['contador']>101){
$_SESSION['contador']=0;
}
$extension='{"'.$exlocal.'":'.$_SESSION['contador'].'}';
}
function start() {
DC('widget_startBtn')
.disable();
window['progress'] = setInterval(function () {
var widget_pbClient = DC('widget_pbClient')
, oldValue = widget_pbClient.getValue()
, newValue = oldValue + 10;
widget_pbClient.setValue(widget_pbClient.getValue() + 10);
if (newValue === 100) {
clearInterval(window['progress']);
}
}, 1000);
}
function cancel() {
clearInterval(window['progress']);
DC('widget_pbClient')
.setValue(0);
DC('widget_startBtn')
.enable();
}
;
dc.cw("Growl", "widget_alerta", {
id: "alerta"
, sticky: false
, life: 6000
, escape: true
, keepAlive: false
, msgs: []
});
dc.cw("CommandButton", "widget_startBtn", {
id: "startBtn"
});
dc.cw("CommandButton", "widget_cancelBtn", {
id: "cancelBtn"
});
dc.cw("ProgressBar", "widget_pbClient", {
id: "progressBarClient"
, initialValue: 0
, ajax: false
, animationDuration: 500
});
dc.cw("CommandButton", "widget_startBtn2", {
id: "startBtn2"
});
dc.cw("CommandButton", "widget_cancelBtn2", {
id: "cancelBtn2"
});
dc.cw("ProgressBar", "widget_pbAjax", {
id: "progressBarAjax"
, initialValue: 32
, ajax: true
, labelTemplate: "{value}%"
, animationDuration: 500
, global: false
, interval: 3000
, behaviors: {
complete: function (ext, event) {
dc.ab({
s: "progressBarAjax"
, e: "complete"
, f: "formulario"
, p: "progressBarAjax"
, u: "alerta"
, onco: function (xhr, status, args, data) {
DC('widget_startBtn2')
.enable();
}
}, ext);
}
}
});
dc.cw("CommandButton", "widget_startBtn3", {
id: "startBtn3"
});
dc.cw("CommandButton", "widget_cancelBtn3", {
id: "cancelBtn3"
});
dc.cw("ProgressBar", "widget_pbAjaxLong", {
id: "progressBarAjaxLong"
, initialValue: 0
, ajax: true
, labelTemplate: "{value}%"
, animationDuration: 500
, global: false
, interval: 500
, behaviors: {
complete: function (ext, event) {
dc.ab({
s: "progressBarAjaxLong"
, e: "complete"
, f: "formulario"
, p: "progressBarAjaxLong"
, u: "alerta"
, onco: function (xhr, status, args, data) {
DC('widget_startBtn3')
.enable();
}
}, ext);
}
}
});
dc.cw("ProgressBar", "widget_pbIndeterminate", {
id: "progressBarIndeterminate"
, initialValue: 0
, ajax: false
, animationDuration: 500
});