Tuesday, December 14, 2010

Auto refresh parent window after closing popup - Dev Articles

Auto refresh parent window after closing popup - Dev Articles
useful codes to refresh parent/main window when a popup closes.

function refreshParent() {   window.opener.location.href = window.opener.location.href;    if (window.opener.progressWindow)     {     window.opener.progressWindow.close()   }   window.close(); }


window. operner. location. reload();

Monday, December 13, 2010

Check visibility of item in jQuery

var isVisible = $('#as_txt_techname').is(':visible');
isVisible will return true if it is visible, false if it is not

PHP SELF

some servers cannot support PHP_SELF, to be safe, use $_SERVER['PHP_SELF'];

Thursday, December 9, 2010

Refreshing another window for the same browser using javascript

window.opener.location.reload()

can also replace opener with window name if previously set with window.name = "main";

Wednesday, December 1, 2010

How to use ArrayList in Java

How to use ArrayList in Java
Useful tips here, but it din mention the big frustration I have today when using ArrayList.
when reassigning the same array to an ArrayList, make sure to reinitialize the Array, or else all items inside the ArrayList will refer to the same array and u will have duplicates of the last Array

Object[] tempObj = new Object[3];
while ((s = br.readLine()) != null) {
if(c == (rowItems)){
c = 0;
tempObj = new Object[3];//REINITIALIZE HERE
}
//if (s != null && s.equals("")==false) {
tempObj[c] = s;
System.out.println("Line" + c + ": " + tempObj[c]);
//}
if (c == (rowItems - 1)) {
userData.add(tempObj);
System.out.println("Expected result: \'" + tempObj[0].toString() + "\', \'" + tempObj[1].toString() + "\', \'" + tempObj[2].toString() + "\'");
}
c++;
}