{{indexmenu_n>1}} ===== Customized MSGBOX ===== \\ ==== msgbox Collection==== \\ To improve the msgbox appearance from the system, it has been carried out the posibility to make a collection where we can show customized messages with the system msgbox appearance we desire.\\ \\ The collection which we can call as we want to, is a special collection that thave the cancelable="false" and cancelable-outside="false" atttibutes, that make it behaves as a "modal" window, so that the user will have to select one of the buttons displayed to be able to continue. It appears as "floating" on the current screen.\\ \\ The buttons displayed in this collection must have a button-option="NUM" attribute, where will be indicated the value that they will return if they are pressed. \\ === Call to customized msgbox === \\ To call the collection that shows the message it can be done with vbscript and with javascript, the collection is treated like any other, the only thing is that this collection will return a result with the value of the button the user has pressed. \\ \\ Somewhere in the code a call will be made like the following one:\\ \\ // El tercer parámetro es para que muestre los botones Si/No y el cuarto parámetro si queremos mostrar unicamente OK ó CANCELAR var vResult=showMsgBox("¿Desea guardar los cambios?", "CONFIRMACIÓN!!",1,0); if (vResult==6) { self.executeNode("btn_save"); } showMsgBox("Debe introducir una firma", "ERROR!!",0,1); // Hay que definir la funcion que lanza la colección en edicion (Se le pasa el objeto como parámetro al ui.msgBox) function showMsgBox(strText,strTitle,showBt1,showBt2) { var mColeccionMessageBox = appData.getCollection("MsgBoxColl"); var mNuevoMessageBox = mColeccionMessageBox.createObject(); mNuevoMessageBox.MAP_TITULO = strTitle; mNuevoMessageBox.MAP_MENSAJE = strText; mNuevoMessageBox.MAP_IMG = "incidencias.png"; mNuevoMessageBox.MAP_SHOW1 = showBt1; mNuevoMessageBox.MAP_SHOW2 = showBt2; var nResult = ui.msgBox(mNuevoMessageBox); return nResult; } \\ === Example Coll customized msgbox === \\