2014年11月4日 星期二

programs log / dialy 20150117 notes

$('input[type="text"]:not(.approveAllow)').keypress(function(e){e.preventDefault();});

//$.ajax({url: "heartbeat"})

d
http://stackoverflow.com/questions/7495985/byte-limit-exceed-problem-when-reloading-a-jsp-page


SELECT COUNT(DISTINCT RECORDID) FROM GRN_HEADER_VIEW0;


{tdInLineStyle}vertical-align:top;magin-top:15px;{/tdInLineStyle}


The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit


el=document.createElement('<'+tag+(type?' type='+type:'')+' name='+nme+' >');


$('.PURCHASE_HEADER_SIGNED_PO_viewUpload').width($('.PURCHASE_HEADER_SIGNED_PO_viewUpload').parent().parent().width()-
$('.PURCHASE_HEADER_SIGNED_PO_UploadButton').width()-20);


dNotes.txt

{onchange}
var c=_lookup('DNOTE_LINE.MAINTAIN_MTHS'+thisRowNo);
var s0730=_lookup('DNOTE_LINE.ACTIVE_DATE'+thisRowNo);
if (s0730){
var d=parseDate(s0730);
var e=d.setMonth(d.getMonth() + c*1);
var f=new Date(e);
s0723=dtos(f,'yyyy-mm-dd');
_refreshv2('DNOTE_LINE.EXPIRE_DATE'+thisRowNo,s0723);
}
s0730=null;
c=null;
{/onchange}

date calculate 



SELECT SO_REFERENCE.*,SALES_ORDER_HEAD.SALES_ORDER FROM SO_REFERENCE
LEFT JOIN SALES_ORDER_HEAD ON SALES_ORDER_HEAD.RECORDID=SO_REFERENCE.SOH_RECORDID
;
document.getElementById('deleteCaption0').title:s1113c;


20141113

purchase.txt
{object}
0.12,PURCHASE_HEADER.PURCHASE_ORDER,text,10,10,Purchase Order,, {readonly}
{disabled}
{spaceLine}
{/object}

Document Number is gen 




function SumTotal(gridTableName,value1,value2,targetValue,grandTotal,curRate,tableName)

var s1111b=lookupTable('SQD_FILE','SOPOQTY.SALES_ORDER',s1103x,'SQD_FILE<>"" and supplier='+s1111);


20141107

salesOrder.txt

{object}
0.67,SALES_ORDER_HEAD.MULTI_ADDRESS,check,0,0,Address:Multi ,,
{spaceLine}
{onchange}
$('.DeliveryTo').css('display',(this.checked?'none':'inline'));
{/onchange}
{endOfLoad}
$('.DeliveryTo').css('display',(document.getElementById('this.id').checked?'none':'inline'));
{/endOfLoad}
{/object}


short Cut if 

20141110
input.jsp

r=r+"var s1111=data[0]["+cInputCount+"].replace(/,/g,''); "; //20141111
r=r+"s1111=s1111*1;s1111=s1111.formatMoney(2, '.', ',');"; //20141111
r=r+"_refreshv2('"+vVariable[a][28]+"',s1111); "; //20141111




20141105

Input.jsp

$('td input,td select').each(function()
{
var n78,s,v;
n78=$(this).attr('rowNum'); //grid.fieldname
s=$(this).attr('fieldName'); //grid.fieldname
v=$(this).val();
if (!v) v='';
<%=gridValids%> //grid.validation
}

table.scan

LoginCheck.jsp

String connectionURL = "jdbc:mysql://localhost/dataBaseName?useUnicode=true&characterEncoding=UTF8";
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection(connectionURL, "user", "password");
Statement st=con.createStatement();
String sql="";
sql="UPDATE USER SET LOGIN_DATE=CURDATE(),
LOGIN_TIME=CURTIME(),LOGIN_IP='"
+request.getRemoteAddr() +"'"
+" WHERE USER.login_id='"+ loginId +"'"
+"and USER.company_Name='"+companyName+"'";
st.executeUpdate(sql);

update login_ip 

createDatabase.jsp

connectionURL = "jdbc:mysql://localhost/erp"+"?useUnicode=true&characterEncoding=UTF8";
Connection connection=DriverManager.getConnection(connectionURL, "userName",                        "userPassword");
Statement st = connection.createStatement();
String sql = "insert IGnore into " + table + " ( " + mfields+ ") value (" + mvalues + " ) ;";
out.println(sql);
st.executeUpdate(sql)


input.jsp

<input id='testName' type='checkbox' value='Yes' name='testName'>
<input id='testNameHidden'  type='hidden' value='No' name='testName'>
Before submitting the form , disabled the hidden field based on the checked condition
if(document.getElementById("testName").checked){
  document.getElementById('testNameHidden').disabled = true;
}
Submit check box

20141104


menu3.jsp

 $('a[class="oe_menu_leaf"]').click(function(){
if(timeOut){clearTimeout(timeOut); timeOut=0;}
$(".oe_menu_leaf").css('color','');
$(".oe_menu_leaf").css('background-color','');
$(this).css('color','black');
$(this).css('background-color','#FDA352');
});

jquery this handling

tableRead.java

s3=s3.replaceAll("\r", "<z>").replaceAll("\n", "<z>"); // multi Line
if(output.equals("csv")) {s3=s3.replaceAll("\"", "\"\"");}  // doubleQuote
if(output.equals("csv") & s3.indexOf("<z>")>=0) {s3="\""+s3.replaceAll("<z>", "\n")+"\"";}  //multi Line
else if(output.equals("csv") & s3.indexOf(",")>=0) {s3="\""+s3+"\"";}  // comma handling

java to csv handling

input.jsp

var t1='<%=reportDate%>';
t1 = t1.split(" ")[0];

find the first part of the String


tableWrite.java
String callback = request.getParameter("callback");
String _r = callback+"([['success','"+sqlString+"']])" ;
out.print(_r);
out.flush();

call back write at the font of the string. 


userRoleScreen.html
<input type="button" id="submitResetPw" name="submitResetPw" style="width:21%;" 
onclick="
var s=$('#userRoleUserID option:selected').text();  // return display value 
var s01=_lookup('confirmResetPw');
var s02=_lookup('newResetPw');
s= 'tableWrite?db=erp&table=USER&fields=password&values=%22'+s01+'%22
&key=LOGIN_ID&value=%22'+s+'%22&callback=?';
$.getJSON(s,function(){alert('Password success change.');});
$( '#resetPasswordDiv' ).dialog( 'close' );
"
value="Submit" />


use %22 as " 

remark : 
s='tableRead?table=USER&fields=RECORDID,LOGIN_ID&where=where db:`<%=bean.getDatabase()%>` and status:1 &format=S,S&callback=?&db=erp'

沒有留言:

張貼留言