/*
function setAPEXSessionState(p_item, p_value){
var ajaxCall = new htmldb_Get(null,$x('pFlowId').value,null,0); // initialize get
ajaxCall.add(p_item, p_value);
gReturn = ajaxCall.get();
$x(p_item).value = p_value;
ajaxCall = null;
}
*/
function showCalExceptions(p_cal_id, p_dialog, p_calendar){
$.post('wwv_flow.show',
{"p_request" : 'APPLICATION_PROCESS=APEXUTL_AJAX',
"p_flow_id" : $v('pFlowId'), //app id
"p_flow_step_id" : $v('pFlowStepId'), //page id
"p_instance" : $v('pInstance'), //session id
"x01" : "fnd_gui_calendar_exception.show_cal_exceptions",
"x02" : p_cal_id
},
function(data){
$("#"+p_calendar).html(data);
$( "#"+p_dialog ).dialog({
resizable: true,
width:400,
height: 400,
modal: true,
title: "Ausnahmen",
buttons: {
"Schliessen": function() {
$( this ).dialog( "close" );
}
}
});
$(".ui-dialog-buttonset button").addClass("ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only");
}
);
};
function setAPEXSessionState(p_item, p_value){
$.post('wwv_flow.show',
{"p_request" : 'APPLICATION_PROCESS=APEXUTL_AJAX',
"p_flow_id" : $v('pFlowId'), //app id
"p_flow_step_id" : $v('pFlowStepId'), //page id
"p_instance" : $v('pInstance'), //session id
"x01" : "fnd_gui_apex_utilities.set_item_session_state",
"x02" : p_item,
"x03" : p_value
},
function(data){
$x(p_item).value = p_value;
}
);
}
function checkSocialNumber(p_svnr, p_validitem, p_icon, p_imageprefix){
if ($(p_svnr).val() != ""){
$.post('wwv_flow.show',
{"p_request" : 'APPLICATION_PROCESS=APEXUTL_AJAX',
"p_flow_id" : $v('pFlowId'), //app id
"p_flow_step_id" : $v('pFlowStepId'), //page id
"p_instance" : $v('pInstance'), //session id
"x01" : "elda_util.check_social_insurance_number",
"x02" : $(p_svnr).val()
},
function(data){
var json = $.parseJSON(data);
if (json.proc_return == "TRUE"){
$(p_icon).attr("src",p_imageprefix+"haller/img/richtig16.png");
$(p_validitem).val("Y");
}
else{
$(p_icon).attr("src",p_imageprefix+"haller/img/falsch16.png");
$(p_validitem).val("N");
}
if ($(p_svnr).val() == ""){
$(p_validitem).val("Y");
}
}
);
}
else{
$(p_icon).attr("src",p_imageprefix+"haller/img/richtig16.png");
}
}
function blockUI(p_message, p_path){
$.blockUI({
message: '
'+p_message+'
',
overlayCSS: {
backgroundColor: '#000',
opacity: .1
},
css: {
width: '230px',
border: '1px SkyBlue solid',
padding: '25px',
backgroundColor: '#FFF',
'-webkit-border-radius': '5px',
'-moz-border-radius': '5px',
opacity: 1,
color: '#555'
}
});
}
function showMessage(p_typ, p_messages, p_cnt){
scroll(0,0);
$("#messages").html("");
if (p_typ == "E"){
$("#messages").append(''+
'
'+
'
' + p_cnt + ' Fehler aufgetreten'+ '
'+
'
'+
'
');
}
else if(p_typ == "A"){
alert(p_messages);
}
else{
$("#messages").append(''+
'
'+
p_messages+
'
');
}
}
function close_comment(){
$('#vtab>ul>li').removeClass('selected');
$('#vtab>div').hide();
$("#vtab").css("width", "0px");
}
function close_comment2(){
$('#vtab2>ul>li').removeClass('selected');
$('#vtab2>div').hide();
$("#vtab2").css("width", "0px");
}
function close_comment3(){
$('#vtab3>ul>li').removeClass('selected');
$('#vtab3>div').hide();
$("#vtab3").css("width", "0px");
}
function close_comment4(){
$('#vtab4>ul>li').removeClass('selected');
$('#vtab4>div').hide();
$("#vtab4").css("width", "0px");
}
(function( $ ) {
$.widget( "ui.combobox", {
_create: function() {
var self = this,
select = this.element.hide(),
selected = select.children( ":selected" ),
value = selected.val() ? selected.text() : "";
var input = this.input = $( "" )
.insertAfter( select )
.val( value )
.autocomplete({
delay: 0,
minLength: 0,
mustMatch: true,
source: function( request, response ) {
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
response( select.children( "option" ).map(function() {
var text = $( this ).text();
if ( this.value && ( !request.term || matcher.test(text) ) )
return {
label: text.replace(
new RegExp(
"(?![^&;]+;)(?!<[^<>]*)(" +
$.ui.autocomplete.escapeRegex(request.term) +
")(?![^<>]*>)(?![^&;]+;)", "gi"
), "$1" ),
value: text,
option: this
};
}) );
},
select: function( event, ui ) {
ui.item.option.selected = true;
self._trigger( "selected", event, {
item: ui.item.option
});
select.change();
},
change: function( event, ui ) {
if ( !ui.item ) {
var matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "$", "i" ),
valid = false;
select.children( "option" ).each(function() {
if ( $( this ).text().match( matcher ) ) {
this.selected = valid = true;
return false;
}
});
if (valid){
select.change();
}
if ( !valid ) {
select.change();
// remove invalid value, as it didn't match anything
$( this ).val( "" );
select.val( "" );
input.data( "autocomplete" ).term = "";
return false;
}
}
}
});
input.data( "autocomplete" )._renderItem = function( ul, item ) {
return $( "" )
.data( "item.autocomplete", item )
.append( "" + item.label + "" )
.appendTo( ul );
};
this.button = $( "" )
.attr( "tabIndex", -1 )
.attr( "title", "Werte anzeigen" )
.insertAfter( input )
.button({
icons: {
primary: "ui-icon-triangle-1-s"
},
text: false
})
.removeClass( "ui-corner-all" )
.addClass( "ui-corner-right ui-button-icon" )
.click(function() {
// close if already visible
if ( input.autocomplete( "widget" ).is( ":visible" ) ) {
input.autocomplete( "close" );
return;
}
// work around a bug (likely same cause as #5265)
$( this ).blur();
// pass empty string as value to search for, displaying all results
input.autocomplete( "search", "" );
input.focus();
});
},
destroy: function() {
this.input.remove();
this.button.remove();
this.element.show();
$.Widget.prototype.destroy.call( this );
}
});
})( jQuery );