2014年6月29日 星期日

generator-delete control delete-all





Delete all layout.txt

var s1113=document.getElementById('tableName1_111'); /*  currentTable */
var i=s1113.rows.length;
for (i1=0;i1<i;i1++) {
deleteRow('SALES_ORDER_PO_DESC',i1,'A');
}


Config.txt

masterKey=PURCHASE_ORDER
masterKey2=sales_code
deleteAction=withHeader


layout.txt

generator-referential
{referential}
SOURCE_TABLE=POBODY,
SOURCE_CODE=SALES_ORDER_PO_DESC_RECORDID,
SOURCE_NAME=PURCHASE_ORDER,
ERR_MESS=Have P.O.
{/referential}





{object}
0.12,PURCHASE_HEADER.PURCHASE_ORDER,text,10,10,Purchase Order,, {readonly}
{disabled}
{spaceLine}
 {refresh}DOCUMENT=($.trim(_lookup('this.id'))+'-'+$.trim(_lookup('PURCHASE_HEADER.VERSION'))).replace('-0',''); if (DOCUMENT==''){$("#printCaption0").css("disabled", "disabled" );}{/refresh}
{/object}




{object}
0.84,SALES_HEADER.DUE_DATE,date,20,20,Due Date,,
{placeHolder}yyyy-mm-dd{/placeHolder}
{required}
{requiredWhen}withHeaderReccount>0{/requiredWhen}
{/object}





{object}
0.26,SALES_HEADER.RATE,num.5,30%,20,Rate,,
{readonly}
{default}1{/default}
{currency}
{alignRight}
{invisibleWhen} PROCESSING_MODE=='D' | PROCESSING_MODE=='R' {/invisibleWhen}
{/object}












2014年6月26日 星期四

http://www.w3schools.com/cssref/playit.asp?filename=playcss_text-decoration&preval=underline

javascript-dom dom-element

https://developer.mozilla.org/en-US/docs/Web/API/element.classList


  1. Element
  2. Properties
    1. Element.accessKey
    2. Element.clientHeight
    3. Element.clientLeft
    4. Element.clientTop
    5. Element.clientWidth
    6. Element.id
    7. Element.innerHTML
    8. Element.length
    9. Element.onafterscriptexecute
    10. Element.onbeforescriptexecute
    11. Element.oncopy
    12. Element.oncut
    13. Element.onpaste
    14. Element.onwheel
    15. Element.scrollHeight
    16. Element.scrollLeft
    17. Element.scrollTop
    18. Element.scrollWidth
    19. Element.tagName
    20. element.classList
    21. e.g.   newText.classList.add("deleteRow"+thisRow);
    22. element.className
    23. element.name
    24. element.outerHTML
  3. Methods
    1. Element.getAttributeNS()
    2. Element.getAttributeNode()
    3. Element.getAttributeNodeNS()
    4. Element.getBoundingClientRect()()
    5. Element.getClientRects()()
    6. Element.getElementsByClassName()
    7. Element.getElementsByTagName()
    8. Element.getElementsByTagNameNS()
    9. Element.hasAttribute()
    10. Element.hasAttributeNS()
    11. Element.insertAdjacentHTML()
    12. Element.matches()
    13. Element.querySelector()
    14. Element.querySelectorAll()
    15. Element.removeAttribute()
    16. Element.removeAttributeNS()
    17. Element.removeAttributeNode()
    18. Element.requestFullscreen()
    19. Element.requestPointerLock()
    20. Element.scrollIntoView()
    21. Element.setAttribute()
    22. Element.setAttributeNS()
    23. Element.setAttributeNode()
    24. Element.setAttributeNodeNS()
    25. Element.setCapture()
    26. Element.supports()
    27. element.getAttribute()

2014年6月17日 星期二

java-public ,java-static


public

  • public means that the method is visible and can be called from other objects of other types. 
  • Other alternatives are private, protected, package and package-private.  
  • The public keyword is an access specifier, which allows the programmer to control the visibility of class members. 
  • When a class member is preceded by public, then that member may be accessed by code outside the class in which it is declared. 
  • (The opposite of public is private, which prevents a member from being used by code defined outside of its class.)
  • First public means that any other object can access it.
  • Public - means that the class (program) is available for use by any other class.
  • public means you can access the class from anywhere in the class/object or outside of the package or class
  • Considering the typical top-level class. Only public and no modifier access modifiers may be used at the top level so you'll either see public or you won't see any access modifier at all.


static

  • static means constant in which block of statement used only 1 time
  • static means that the method is associated with the class, not a specific instance (object) of that class.
  • This means that you can call a static method without creating an object of the class.
  • It doesn't have any object state, so you can call it without instantiating an object
  • Static - creates a class. Can also be applied to variables and methods,making them class methods/variables instead of just local to a particular instance of the class.
  • static means that the method is associated with the class, not a specific instance (object) of that class. This means that you can call a static method without creating an object of the class. Because of use of a static keyword main() is your first method to be invoked.. static doesn't need to any object to instance... so,main( ) is called by the Java interpreter before any objects are made.
  • `static`` is used because you may not have a need to create an actual object at the top level (but sometimes you will want to so you may not always see/use static. There are other reasons why you wouldn't include static too but this is the typical one at the top level.)


void


  • void means that the method has no return value. If the method returned an int you would write intinstead of void.
  • void is used because usually you're not going to be returning a value from the top level (class). (sometimes you'll want to return a value other than NULL so void may not always be used either especially in the case when you have declared, initialized an object at the top level that you are assigning some value to).



main

  • In this case, main( ) must be declared as public, since it must be called by code outside of its class when the program is started.

  • The keyword static allows main( ) to be called without having to instantiate a particular instance of the class. This is necessary since main( ) is called by the Java interpreter before any objects are made.

  • The keyword void simply tells the compiler that main( ) does not return a value. As you will see, methods may also return values.

2014年6月15日 星期日

jquery-date-datepicker

picker date date pick tick date date tick
double click
http://forum.jquery.com/topic/datepicker-showon-double-click



http://api.jqueryui.com/datepicker/#option-dateFormat
datepicker api

javascript-date html-date


<input type=text class='datepicker'> </input>
 $( ".datepicker" ).datepicker();
 $( ".datepicker" ).datepicker( "option", "dateFormat", 'yy-mm-dd' ); //2016-06-16

2014年6月5日 星期四

java-variable java-global-variable , jsp-global-variable,jsp-variable

inf: http://www.easywayserver.com/blog/global-variable-in-jsp/



Global variable in JSP

Global variable are variable which can access in whole JSP class in any method declared in class.
Global variable in JSP should be defined in declaration part <%! %>. Code inside this declaration can be accessed from any method e.g. jspInit(), jspDestroy(), and jspService().
jsp file
<%@ page language="java" %>
<%!
 String sGlobalVariable="defining variable here and access anywhere in JSP";
 
 public void getStringValue()
 {
 
 }
%>
<html>
<head>
<title>Global variable in JSP</title>
</head>

<body>
<%=sGlobalVariable%>
</body>
</html>
When execute on web browser, it will create jsp to servlet and see the sGlobalVariable is not in service method of JSP, this means you can access this variable in any method in JSP
public final class global_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {


 String sGlobalVariable="defining variable here and access anywhere in JSP";

 public void getStringValue()
 {

 }

  public void _jspInit() {
  }

  public void _jspDestroy() {
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

  }
}

2014年6月3日 星期二

asp-json

<%
'for Excel
sql= " SELECT a.[No_]"&_
 " ,Case When a.[External Tracking No_] = '' Then e.[External Tracking No_] Else a.[External Tracking No_] End as [Track No_]"&_
 " ,a.[Source ID]"&_
 " ,a.[Used on Bill of Lading No_]"&_
 " ,a.[Shipping Agent Code]"&_
 " ,a.[Calculation Weight (LBS)]"&_
 " ,a.[Shipping Charge]"&_
 " ,e.[Shipping Charge] as [Tot Charge (BOL)]"&_
 " ,a.[Calculation Value]"&_
 " ,convert(varchar(20),a.[Posting Date],111) _10"&_
 " ,a.[External Document No_] _11"&_
 " ,c.[Name] as [Agent Name 12]"&_
 " ,a.[Ship-to No_] _13"&_
 " ,Case When b.[No_ 2] =''Then [Old Customer No_ (4_0)] Else b.[No_ 2] End as [Old Customer No 14]"&_
 " ,b.[Name] as [Customer Name 15]"&_
 " ,Case When a.[Shipping Payment Type]=0 Then'Prepaid' When a.[Shipping Payment Type]=1 Then'Third Party' "&_
 " When a.[Shipping Payment Type]=2 Then'Freight Collect' Else Convert(VARCHAR(50), "&_
 " a.[Shipping Payment Type]) End as [Shipping Payment Type 16] ,a.[Ship-to Code] _17 "&_
 " ,a.[Shortcut Dimension 1 code] division_17"&_
 " ,a.[Location Code] _18"&_
 " ,Case When a.[Closed]= 0 Then 'False' Else 'True' End as [Closed 19]"&_
 " ,a.[Ship-to State] _20"&_
 " ,a.[Ship-to Zip Code] _21"&_
 " FROM   (select a.[No_],a.[Source ID],a.[External Tracking No_],"&_
 " a.[Used on Bill of Lading No_],"&_
 " a.[Shipping Agent Code], a.[Ship-to No_],"&_
 " a.[Calculation Weight (LBS)],a.[Shipping Charge],"&_
 " a.[Calculation Value],a.[Posting Date],"&_
 " a.[Shipping Payment Type],a.[Ship-to Code],"&_
 " a.[Closed], a.[Ship-to State],a.[Ship-to Zip Code],"&_
 " b.[External Document No_],"&_
 " b.[Shortcut Dimension 1 code], b.[Location Code]"&_
 " from [FOREMOST GROUPS,INC_$Posted Package] a left join"&_
 " (select y.[No_] as Post_Package_No,"&_
 " x.[No_], x.[External Document No_],"&_
 " x.[Shortcut Dimension 1 code],"&_
 " x.[Location Code]"&_
 "   from [Sales Header] x,"&_
 " [FOREMOST GROUPS,INC_$Posted Package] y"&_
 "   where y.[Source ID] = x.[No_]"&_
 " and y.[Posting Date]"&_
 " between '2013-1-1' and '2013-2-5'"&_
 " and y.[Ship-to No_] like '%'"&_
 "   Union"&_
 "   select y.[No_]as Post_Package_No,"&_
 " x.[No_],x.[External Document No_], x.[Shortcut Dimension 1 code],"&_
 " x.[Location Code]"&_
 "   from [Closed Sales Header] x,"&_
 " [FOREMOST GROUPS,INC_$Posted Package] y"&_
 "   where y.[Source ID] = x.[No_]"&_
 " and y.[Posting Date]"&_
 " between '2013-1-1' and '2013-2-5'"&_
 " and y.[Ship-to No_] like '%'"&_
 "   ) b on (a.[No_]= b.Post_Package_No)) a"&_
 " Left Join [Customer] b on a.[Ship-to No_] = b.[No_]"&_
 " Left Join [Shipping Agent] c"&_
 " on a.[Shipping Agent Code] = c.[Code]"&_
 " Left Join [FOREMOST GROUPS,INC_$Bill of Lading] e"&_
 " on a.[Used on Bill of Lading No_] = e.[No_]"&_
 " WHERE a.[Posting Date] between '2013-1-1' and '2013-2-5'"&_
 " and a.[Ship-to No_] like '%'"&_
 " ORDER By no_"&_
 " "



pcallback=Request.querystring("callback")
response.expires=-1
Set OBJdbConnection = Server.CreateObject("ADODB.Connection")
OBJdbConnection.Open "DSN=hkdvdb1;UID=userID;PWD=userPassword;Database=DataBaseName"
Set SQLStmt = Server.CreateObject("ADODB.Command")
Set RS = Server.CreateObject ("ADODB.Recordset")
SQLStmt.CommandText = sql
SQLStmt.CommandType = 1
Set SQLStmt.ActiveConnection = OBJdbConnection
RS.Open SQLStmt
delimiter2=""
'response.setContentType("text/javascript");
'response.setCharacterEncoding("UTF-8");

'_r = callback + "([\n";
' charset=utf-8
Response.Clear()
Response.ContentType = "text/javascript"
response.write(pcallback)
response.write("([")
rcount=0
Do While Not RS.EOF
If rcount=14 Then Exit do
delimiter=""
response.write(delimiter2&"[")
ccount=0
for each col in rs.fields

if ccount<21 then
response.write(delimiter&"'"&col.value&"'")
delimiter=","
end if

ccount=ccount+1

if 1=0 then
roundup=2
if rr=60000 then
roundup=5
end if

if rr>=4 then
If IsNull(col.value) Then
aValue(rr)=FormatNumber(0,roundup)
else
aValue(rr)=FormatNumber(col.value,roundup)
end if
elseif  col.value="1753/01/01"  OR col.value="1754/01/01"  then
aValue(rr)="-"
else
aValue(rr)=col.value
end if
rr=rr+1
end if
next
delimiter2=","
response.write("]")
'response.write("\n")
rs.movenext
rcount=rcount+1
loop
response.write("])")
'Response.Write(json);
Response.End()

'?([
'['1396235501819','Government Logistics Department','REF','A'],
'['1396235623593','Government Logistics Department','2','D'],
'['1396235673056','Government Logistics Department','ASDFAASDFAFD','D']
']);

'?([
'['1396250882115','PYTN01403001','Government Logistics Department','D'],
'['1396251592777','RETN01403002','Government Logistics Department','D']
']);
'? {['some string 1', 'some data', 'whatever data']}
 '?([]);
 %>