É integrado ao comportamento de confirmação para implementar confirmações com facilidade.
$render=explode(" ", $_POST['partial_render']);
if($_POST['source']=='confirmar'){
$msg='Você aceitou!';
}
if($_POST['source']=='excluir'){
$msg='Registro Excluido!';
}
$resposta='
<span id="alerta" class="ui-growl-pl" data-widget="widget_alerta" data-summary="data-summary" data-detail="data-detail" 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: "Confirmado"
, detail: "'.$msg.'"
, severity: "info"
, severityText: "Information"
}]
});
</script>
';
dc.cw("Growl", "widget_alerta", {
id: "alerta"
, sticky: false
, life: 6000
, escape: true
, keepAlive: false
, msgs: []
});
dc.cw("CommandButton", "widget_confirmar", {
id: "confirmar"
, behaviors: {
click: function (ext, event) {}
}
});
dc.cw("CommandButton", "widget_excluir", {
id: "excluir"
, behaviors: {
click: function (ext, event) {}
}
});
dc.cw("CommandButton", "widget_nao", {
id: "nao"
});
dc.cw("CommandButton", "widget_sim", {
id: "sim"
});
dc.cw("ConfirmDialog", "widget_confirmacao", {
id: "confirmacao"
, width: "350"
, showEffect: "fade"
, hideEffect: "fade"
, global: true
, responsive: true
});
dc.cw("TabView", "widget_documentacao", {
id: "documentacao"
, effectDuration: "normal"
, scrollable: false
});
dc.cw("Dialog", "viewExpiredDialog", {
id: "viewExpiredDialog"
, height: "500px"
, onShow: function () {
document.location.href = document.location.href;
}
});