powerbuilder11的webform发布和webservices调用实践

powerbuilder11的webform发布和webservices调用简介

QQ群请加: 6539042(powerbuilder11&SQL)  

A. webform花两个小时写了个例子。感觉除了刷得比较厉害以外,折衷的认为,如果作为一般的查询来讲,是没有任何问题的。现在很多框架又在搞C/S界面的摹仿。这倒好,直接用PB11实现就OK了。但是交互作用不是很方便。本来想上传一个包。但是我居然无法上传东西。所以直接给出源代码吧。感兴趣的,或者不能成功的可按我的代码先Run.

注意: IIS要没问题。.NET要没问题。另外我是用msi的安装包安装的,发现再次更新后,aspx出来的结果还是旧页面,估计是编译的东西没更新到。你可以运行msi包一次(安装)然后在运行一次(卸载),然后再安装就可以了(笨办法但是奏效).

另外:powerbuilder11的体验[转载] 里提到的 PBWebWindowStyle问题确实存在。要添加一下。

//application
forward
global type chengg0769 from application
end type
global transaction sqlca
global dynamicdescriptionarea sqlda
global dynamicstagingarea sqlsa
global error error
global message message
end forward

global type chengg0769 from application
string appname = "chengg0769"
end type
global chengg0769 chengg0769

on chengg0769.create
appname="chengg0769"
message=create message
sqlca=create transaction
sqlda=create dynamicdescriptionarea
sqlsa=create dynamicstagingarea
error=create error
end on

on chengg0769.destroy
destroy(sqlca)
destroy(sqlda)
destroy(sqlsa)
destroy(error)
destroy(message)
end on

event open;open(w_main)
end event

//一个数据框d_emp(来自pubs数据库的职员表)

release 11;
datawindow(units=0 timer_interval=0 color=67108864 processing=1 HTMLDW=no print.printername="" print.documentname="" print.orientation = 0 print.margin.left = 110 print.margin.right = 110 print.margin.top = 96 print.margin.bottom = 96 print.paper.source = 0 print.paper.size = 0 print.canusedefaultprinter=yes print.prompt=no print.buttons=no print.preview.buttons=no print.cliptext=no print.overrideprintjob=no print.collate=yes print.preview.outline=yes hidegrayline=no showbackcoloronxp=no grid.lines=0 )
header(height=80 color="536870912" )
summary(height=0 color="536870912" )
footer(height=0 color="536870912" )
detail(height=88 color="536870912" )
table(column=(type=char(9) update=yes updatewhereclause=yes key=yes name=emp_id dbname="employee.emp_id" )
 column=(type=char(20) update=yes updatewhereclause=yes name=fname dbname="employee.fname" )
 column=(type=char(30) update=yes updatewhereclause=yes name=lname dbname="employee.lname" )
 column=(type=long update=yes updatewhereclause=yes name=job_id dbname="employee.job_id" )
 column=(type=datetime update=yes updatewhereclause=yes name=hire_date dbname="employee.hire_date" )
 retrieve="PBSELECT( VERSION(400) TABLE(NAME=~"employee~" ) COLUMN(NAME=~"employee.emp_id~") COLUMN(NAME=~"employee.fname~") COLUMN(NAME=~"employee.lname~") COLUMN(NAME=~"employee.job_id~") COLUMN(NAME=~"employee.hire_date~")) " update="employee" updatewhere=1 updatekeyinplace=no )
text(band=header alignment="2" text="Emp Id" border="6" color="33554432" x="155" y="8" height="64" width="407" html.valueishtml="0"  name=emp_id_t visible="1"  font.face="Tahoma" font.height="-9" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=header alignment="2" text="Fname" border="6" color="33554432" x="571" y="8" height="64" width="453" html.valueishtml="0"  name=fname_t visible="1"  font.face="Tahoma" font.height="-9" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=header alignment="2" text="Lname" border="6" color="33554432" x="1033" y="8" height="64" width="448" html.valueishtml="0"  name=lname_t visible="1"  font.face="Tahoma" font.height="-9" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=header alignment="2" text="Job Id" border="6" color="33554432" x="1490" y="8" height="64" width="251" html.valueishtml="0"  name=job_id_t visible="1"  font.face="Tahoma" font.height="-9" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=header alignment="2" text="Hire Date" border="6" color="33554432" x="1751" y="8" height="64" width="530" html.valueishtml="0"  name=hire_date_t visible="1"  font.face="Tahoma" font.height="-9" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=header alignment="2" text="chen" border="0" color="33554432" x="5" y="16" height="56" width="137" html.valueishtml="0"  name=t_1 visible="1"  font.face="Tahoma" font.height="-9" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="134217744" )
compute(band=detail alignment="2" expression="getrow()"border="6" color="33554432" x="9" y="12" height="68" width="137" format="[GENERAL]" html.valueishtml="0"  name=compute_1 visible="1"  font.face="Tahoma" font.height="-9" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" )
column(band=detail id=1 alignment="2" tabsequence=10 border="0" color="33554432" x="155" y="8" height="68" width="407" format="[general]" html.valueishtml="0" protect="0~t1"  name=emp_id visible="1" edit.limit=9 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Tahoma" font.height="-9" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="0" background.color="536870912~tif (mod(getrow(),2)=0,RGB(128,128,0),RGB(0,128,128))" )
column(band=detail id=2 alignment="0" tabsequence=20 border="0" color="33554432" x="571" y="8" height="68" width="453" format="[general]" html.valueishtml="0" protect="0~t1"  name=fname visible="1" edit.limit=20 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Tahoma" font.height="-9" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="0" background.color="536870912~tif (mod(getrow(),2)=0,RGB(128,128,0),RGB(0,128,128))" )
column(band=detail id=3 alignment="0" tabsequence=30 border="0" color="33554432" x="1033" y="8" height="68" width="448" format="[general]" html.valueishtml="0" protect="0~t1"  name=lname visible="1" edit.limit=30 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Tahoma" font.height="-9" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="0" background.color="536870912~tif (mod(getrow(),2)=0,RGB(128,128,0),RGB(0,128,128))" )
column(band=detail id=4 alignment="2" tabsequence=40 border="0" color="33554432" x="1490" y="8" height="68" width="251" format="0" html.valueishtml="0" protect="0~t1"  name=job_id visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Tahoma" font.height="-9" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="0" background.color="536870912~tif (mod(getrow(),2)=0,RGB(128,128,0),RGB(0,128,128))" )
column(band=detail id=5 alignment="2" tabsequence=50 border="0" color="33554432" x="1751" y="8" height="68" width="530" format="yyyy-mm-dd" html.valueishtml="0" protect="0~t1"  name=hire_date visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes  font.face="Tahoma" font.height="-9" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="0" background.color="536870912~tif (mod(getrow(),2)=0,RGB(128,128,0),RGB(0,128,128))" )
htmltable(border="1" )
htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" encodeselflinkargs="1" netscapelayers="0" pagingmethod=0 generatedddwframes="1" )
xhtmlgen() cssgen(sessionspecific="0" )
xmlgen(inline="0" )
xsltgen()
jsgen()
export.xml(headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0 )
import.xml()
export.pdf(method=0 distill.custompostscript="0" xslfop.print="0" )
export.xhtml()

//菜单m_main

forward
global type m_main from menu
end type
type m_file from menu within m_main
end type
type m_edit from menu within m_main
end type
type m_sayhello from menu within m_edit
end type
type m_retrievepubs from menu within m_edit
end type
type m_edit from menu within m_main
m_sayhello m_sayhello
m_retrievepubs m_retrievepubs
end type
type m_win from menu within m_main
end type
type m_help from menu within m_main
end type
global type m_main from menu
m_file m_file
m_edit m_edit
m_win m_win
m_help m_help
end type
end forward

global type m_main from menu
m_file m_file
m_edit m_edit
m_win m_win
m_help m_help
end type
global m_main m_main

on m_main.create
m_main=this
call super::create
this.text = "m_main"
this.menustyle = contemporarymenu!
this.menutextcolor = 134217735
this.menubackcolor = 134217731
this.menuhighlightcolor = 134217741
this.textsize = 8
this.weight = 400
this.facename = "Tahoma"
this.titlebackcolor = 134217730
this.bitmapbackcolor = 12632256
this.menubitmaps = true
this.titlegradient = true
this.toolbarstyle = contemporarytoolbar!
this.toolbartextcolor = 134217746
this.toolbarbackcolor = 12632256
this.toolbarhighlightcolor = 134217741
this.toolbargradient = true
this.bitmapgradient = true
this.m_file=create m_file
this.m_edit=create m_edit
this.m_win=create m_win
this.m_help=create m_help
this.Item[UpperBound(this.Item)+1]=this.m_file
this.Item[UpperBound(this.Item)+1]=this.m_edit
this.Item[UpperBound(this.Item)+1]=this.m_win
this.Item[UpperBound(this.Item)+1]=this.m_help
end on

on m_main.destroy
call super::destroy
destroy(this.m_file)
destroy(this.m_edit)
destroy(this.m_win)
destroy(this.m_help)
end on

type m_file from menu within m_main
end type

on m_file.create
call super::create
this.text = "file"
this.menustyle = contemporarymenu!
this.menutextcolor = 134217735
this.menubackcolor = 134217731
this.menuhighlightcolor = 134217741
this.textsize = 8
this.weight = 400
this.facename = "Tahoma"
this.titlebackcolor = 134217730
this.bitmapbackcolor = 12632256
this.menubitmaps = true
this.titlegradient = true
this.toolbarstyle = contemporarytoolbar!
this.toolbartextcolor = 134217746
this.toolbarbackcolor = 12632256
this.toolbarhighlightcolor = 134217741
this.toolbargradient = true
this.bitmapgradient = true
end on

on m_file.destroy
call super::destroy
end on

type m_edit from menu within m_main
m_sayhello m_sayhello
m_retrievepubs m_retrievepubs
end type

on m_edit.create
call super::create
this.text = "edit"
this.menustyle = contemporarymenu!
this.menutextcolor = 134217735
this.menubackcolor = 134217731
this.menuhighlightcolor = 134217741
this.textsize = 8
this.weight = 400
this.facename = "Tahoma"
this.titlebackcolor = 134217730
this.bitmapbackcolor = 12632256
this.menubitmaps = true
this.titlegradient = true
this.toolbarstyle = contemporarytoolbar!
this.toolbartextcolor = 134217746
this.toolbarbackcolor = 12632256
this.toolbarhighlightcolor = 134217741
this.toolbargradient = true
this.bitmapgradient = true
this.m_sayhello=create m_sayhello
this.m_retrievepubs=create m_retrievepubs
this.Item[UpperBound(this.Item)+1]=this.m_sayhello
this.Item[UpperBound(this.Item)+1]=this.m_retrievepubs
end on

on m_edit.destroy
call super::destroy
destroy(this.m_sayhello)
destroy(this.m_retrievepubs)
end on

type m_sayhello from menu within m_edit
end type

on m_sayhello.create
call super::create
this.text = "say hello"
this.toolbaritemname = "userobject1!"
this.toolbaritemtext = "say hello"
this.menuimage = "InsertReturn!"
this.menustyle = contemporarymenu!
this.menutextcolor = 134217735
this.menubackcolor = 134217731
this.menuhighlightcolor = 134217741
this.textsize = 8
this.weight = 400
this.facename = "Tahoma"
this.titlebackcolor = 134217730
this.bitmapbackcolor = 12632256
this.menubitmaps = true
this.titlegradient = true
this.toolbarstyle = contemporarytoolbar!
this.toolbartextcolor = 134217746
this.toolbarbackcolor = 12632256
this.toolbarhighlightcolor = 134217741
this.toolbargradient = true
this.bitmapgradient = true
end on

on m_sayhello.destroy
call super::destroy
end on

event clicked;parentwindow.postevent("query1")
end event

type m_retrievepubs from menu within m_edit
end type

on m_retrievepubs.create
call super::create
this.text = "retrieve pubs"
this.toolbaritemname = "prior!"
this.toolbaritemtext = "retrieve pubs"
this.toolbaritemspace = 2
this.menuimage = "Redo!"
this.menustyle = contemporarymenu!
this.menutextcolor = 134217735
this.menubackcolor = 134217731
this.menuhighlightcolor = 134217741
this.textsize = 8
this.weight = 400
this.facename = "Tahoma"
this.titlebackcolor = 134217730
this.bitmapbackcolor = 12632256
this.menubitmaps = true
this.titlegradient = true
this.toolbarstyle = contemporarytoolbar!
this.toolbartextcolor = 134217746
this.toolbarbackcolor = 12632256
this.toolbarhighlightcolor = 134217741
this.toolbargradient = true
this.bitmapgradient = true
end on

on m_retrievepubs.destroy
call super::destroy
end on

event clicked;parentwindow.postevent("query2")
end event

type m_win from menu within m_main
end type

on m_win.create
call super::create
this.text = "win"
this.menustyle = contemporarymenu!
this.menutextcolor = 134217735
this.menubackcolor = 134217731
this.menuhighlightcolor = 134217741
this.textsize = 8
this.weight = 400
this.facename = "Tahoma"
this.titlebackcolor = 134217730
this.bitmapbackcolor = 12632256
this.menubitmaps = true
this.titlegradient = true
this.toolbarstyle = contemporarytoolbar!
this.toolbartextcolor = 134217746
this.toolbarbackcolor = 12632256
this.toolbarhighlightcolor = 134217741
this.toolbargradient = true
this.bitmapgradient = true
end on

on m_win.destroy
call super::destroy
end on

type m_help from menu within m_main
end type

on m_help.create
call super::create
this.text = "help"
this.menustyle = contemporarymenu!
this.menutextcolor = 134217735
this.menubackcolor = 134217731
this.menuhighlightcolor = 134217741
this.textsize = 8
this.weight = 400
this.facename = "Tahoma"
this.titlebackcolor = 134217730
this.bitmapbackcolor = 12632256
this.menubitmaps = true
this.titlegradient = true
this.toolbarstyle = contemporarytoolbar!
this.toolbartextcolor = 134217746
this.toolbarbackcolor = 12632256
this.toolbarhighlightcolor = 134217741
this.toolbargradient = true
this.bitmapgradient = true
end on

on m_help.destroy
call super::destroy
end on

//自定义对象:uo_sayhello

forward
global type uo_sayhello from nonvisualobject
end type
end forward

global type uo_sayhello from nonvisualobject
end type
global uo_sayhello uo_sayhello

type variables
string is_myname
string is_sayhello = "你好,这里是pb11 webform测试程序!"
end variables
forward prototypes
public function string of_say_hello (readonly string ls_name)
end prototypes

public function string of_say_hello (readonly string ls_name);//
if ls_name = "" then
 return is_sayhello
else
 return ls_name + is_sayhello
end if
end function

on uo_sayhello.create
call super::create
TriggerEvent( this, "constructor" )
end on

on uo_sayhello.destroy
TriggerEvent( this, "destructor" )
call super::destroy
end on

//主程序:w_main

forward
global type w_main from window
end type
type cb_3 from commandbutton within w_main
end type
type cb_2 from commandbutton within w_main
end type
type cb_1 from commandbutton within w_main
end type
type cb_ok2 from commandbutton within w_main
end type
type st_2 from statictext within w_main
end type
type dw_1 from datawindow within w_main
end type
type st_1 from statictext within w_main
end type
type sle_1 from singlelineedit within w_main
end type
type cb_ok1 from commandbutton within w_main
end type
end forward

global type w_main from window
integer width = 2889
integer height = 1752
boolean titlebar = true
string title = "PB11-TEST     http://blog.csdn.net/chengg0769"
string menuname = "m_main"
boolean controlmenu = true
boolean minbox = true
boolean maxbox = true
boolean resizable = true
long backcolor = 67108864
string icon = "Report5!"
boolean center = true
event query1 ( )
event query2 ( )
cb_3 cb_3
cb_2 cb_2
cb_1 cb_1
cb_ok2 cb_ok2
st_2 st_2
dw_1 dw_1
st_1 st_1
sle_1 sle_1
cb_ok1 cb_ok1
end type
global w_main w_main

event query1();string name

name = sle_1.text

uo_sayhello uo_myuo

uo_myuo = create uo_sayhello

sle_1.text = uo_myuo.of_say_hello(name)

destroy uo_myuo
end event

event query2();dw_1.retrieve()
end event

on w_main.create
if this.MenuName = "m_main" then this.MenuID = create m_main
this.cb_3=create cb_3
this.cb_2=create cb_2
this.cb_1=create cb_1
this.cb_ok2=create cb_ok2
this.st_2=create st_2
this.dw_1=create dw_1
this.st_1=create st_1
this.sle_1=create sle_1
this.cb_ok1=create cb_ok1
this.Control[]={this.cb_3,&
this.cb_2,&
this.cb_1,&
this.cb_ok2,&
this.st_2,&
this.dw_1,&
this.st_1,&
this.sle_1,&
this.cb_ok1}
end on

on w_main.destroy
if IsValid(MenuID) then destroy(MenuID)
destroy(this.cb_3)
destroy(this.cb_2)
destroy(this.cb_1)
destroy(this.cb_ok2)
destroy(this.st_2)
destroy(this.dw_1)
destroy(this.st_1)
destroy(this.sle_1)
destroy(this.cb_ok1)
end on

event open;// Profile SNCconn
SQLCA.DBMS = "SNC SQL Native Client(OLE DB)"
SQLCA.LogPass = "123"
SQLCA.ServerName = "."
SQLCA.LogId = "sa"
SQLCA.AutoCommit = False
SQLCA.DBParm = "Database='pubs',StaticBind=0,BindSPInput=1"

connect;

if sqlca.sqlcode <>0 then
 this.title = "数据库链接错误: " + string(sqlca.sqlcode) + sqlca.sqlerrtext
 sleep(10)
 halt
end if

dw_1.settransobject(sqlca)

 

end event

event close;disconnect;
end event

type cb_3 from commandbutton within w_main
integer x = 1765
integer y = 140
integer width = 434
integer height = 108
integer taborder = 30
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
string text = "new win"
end type

event clicked;open(w_child)
end event

type cb_2 from commandbutton within w_main
integer x = 2267
integer y = 132
integer width = 448
integer height = 108
integer taborder = 10
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
string text = "messagebox"
end type

event clicked;messagebox("PB11-WebForm","祝各位朋友圣诞节快乐!")
end event

type cb_1 from commandbutton within w_main
integer x = 2277
integer y = 356
integer width = 443
integer height = 108
integer taborder = 20
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
string text = "clear"
end type

event clicked;dw_1.reset()
end event

type cb_ok2 from commandbutton within w_main
integer x = 1765
integer y = 356
integer width = 439
integer height = 108
integer taborder = 10
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
string text = "retrieve"
end type

event clicked;parent.postevent("query2")
end event

type st_2 from statictext within w_main
integer x = 32
integer y = 408
integer width = 562
integer height = 84
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "retrieve from pubs"
boolean focusrectangle = false
end type

type dw_1 from datawindow within w_main
integer x = 46
integer y = 528
integer width = 2734
integer height = 984
integer taborder = 20
string title = "none"
string dataobject = "d_emp"
boolean livescroll = true
borderstyle borderstyle = stylelowered!
end type

type st_1 from statictext within w_main
integer x = 32
integer y = 28
integer width = 1861
integer height = 80
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "input your name,echo ~"YOUR NAME~" and tell you  pb11 test!"
boolean focusrectangle = false
end type

type sle_1 from singlelineedit within w_main
integer x = 27
integer y = 148
integer width = 1582
integer height = 100
integer taborder = 10
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
borderstyle borderstyle = stylelowered!
end type

type cb_ok1 from commandbutton within w_main
integer x = 32
integer y = 280
integer width = 320
integer height = 108
integer taborder = 10
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
string text = "say"
end type

event clicked;parent.postevent("query1")
end event

//另外一个窗口w_child

forward
global type w_child from window
end type
type tab_1 from tab within w_child
end type
type tabpage_1 from userobject within tab_1
end type
type st_1 from statictext within tabpage_1
end type
type tabpage_1 from userobject within tab_1
st_1 st_1
end type
type tabpage_2 from userobject within tab_1
end type
type st_2 from statictext within tabpage_2
end type
type tabpage_2 from userobject within tab_1
st_2 st_2
end type
type tabpage_3 from userobject within tab_1
end type
type tabpage_3 from userobject within tab_1
end type
type tabpage_4 from userobject within tab_1
end type
type tabpage_4 from userobject within tab_1
end type
type tabpage_5 from userobject within tab_1
end type
type tabpage_5 from userobject within tab_1
end type
type tab_1 from tab within w_child
tabpage_1 tabpage_1
tabpage_2 tabpage_2
tabpage_3 tabpage_3
tabpage_4 tabpage_4
tabpage_5 tabpage_5
end type
type dp_1 from datepicker within w_child
end type
end forward

global type w_child from window
integer width = 2327
integer height = 1444
boolean titlebar = true
string title = "PB11-test chengg0769"
boolean controlmenu = true
boolean minbox = true
boolean maxbox = true
boolean resizable = true
long backcolor = 67108864
string icon = "AppIcon!"
boolean center = true
tab_1 tab_1
dp_1 dp_1
end type
global w_child w_child

on w_child.create
this.tab_1=create tab_1
this.dp_1=create dp_1
this.Control[]={this.tab_1,&
this.dp_1}
end on

on w_child.destroy
destroy(this.tab_1)
destroy(this.dp_1)
end on

type tab_1 from tab within w_child
integer x = 59
integer y = 204
integer width = 2153
integer height = 1056
integer taborder = 20
integer textsize = -22
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long backcolor = 67108864
boolean raggedright = true
boolean focusonbuttondown = true
integer selectedtab = 1
tabpage_1 tabpage_1
tabpage_2 tabpage_2
tabpage_3 tabpage_3
tabpage_4 tabpage_4
tabpage_5 tabpage_5
end type

on tab_1.create
this.tabpage_1=create tabpage_1
this.tabpage_2=create tabpage_2
this.tabpage_3=create tabpage_3
this.tabpage_4=create tabpage_4
this.tabpage_5=create tabpage_5
this.Control[]={this.tabpage_1,&
this.tabpage_2,&
this.tabpage_3,&
this.tabpage_4,&
this.tabpage_5}
end on

on tab_1.destroy
destroy(this.tabpage_1)
destroy(this.tabpage_2)
destroy(this.tabpage_3)
destroy(this.tabpage_4)
destroy(this.tabpage_5)
end on

type tabpage_1 from userobject within tab_1
integer x = 18
integer y = 188
integer width = 2117
integer height = 852
long backcolor = 67108864
string text = "圣"
long tabtextcolor = 33554432
long picturemaskcolor = 536870912
st_1 st_1
end type

on tabpage_1.create
this.st_1=create st_1
this.Control[]={this.st_1}
end on

on tabpage_1.destroy
destroy(this.st_1)
end on

type st_1 from statictext within tabpage_1
integer x = 41
integer y = 176
integer width = 955
integer height = 572
integer textsize = -72
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "中国"
boolean focusrectangle = false
end type

type tabpage_2 from userobject within tab_1
integer x = 18
integer y = 188
integer width = 2117
integer height = 852
long backcolor = 67108864
string text = "诞"
long tabtextcolor = 33554432
long picturemaskcolor = 536870912
st_2 st_2
end type

on tabpage_2.create
this.st_2=create st_2
this.Control[]={this.st_2}
end on

on tabpage_2.destroy
destroy(this.st_2)
end on

type st_2 from statictext within tabpage_2
integer x = 87
integer y = 144
integer width = 1262
integer height = 564
integer textsize = -72
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "北京"
boolean focusrectangle = false
end type

type tabpage_3 from userobject within tab_1
integer x = 18
integer y = 188
integer width = 2117
integer height = 852
long backcolor = 67108864
string text = "节"
long tabtextcolor = 33554432
long picturemaskcolor = 536870912
end type

type tabpage_4 from userobject within tab_1
integer x = 18
integer y = 188
integer width = 2117
integer height = 852
long backcolor = 67108864
string text = "快"
long tabtextcolor = 33554432
long picturemaskcolor = 536870912
end type

type tabpage_5 from userobject within tab_1
integer x = 18
integer y = 188
integer width = 2117
integer height = 852
long backcolor = 67108864
string text = "乐"
long tabtextcolor = 33554432
long picturemaskcolor = 536870912
end type

type dp_1 from datepicker within w_child
integer x = 73
integer y = 56
integer width = 686
integer height = 100
integer taborder = 10
boolean border = true
borderstyle borderstyle = stylelowered!
date maxdate = Date("2999-12-31")
date mindate = Date("1800-01-01")
datetime value = DateTime(Date("2007-12-21"), Time("21:31:49.000000"))
integer textsize = -12
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
integer calendarfontweight = 400
boolean todaysection = true
boolean todaycircle = true
end type

你可以建立一个相应对象然后粘贴代码进去。运行后图片如下。但是菜单还有问题。toolbar位置不对。也不能执行点击命令,而菜单可以执行命令,但不显示图标。

powerbuilder11的webform发布和webservices调用实践_第1张图片

powerbuilder11的webform发布和webservices调用实践_第2张图片

=======================================//=============================================

B. 至于web services调用等。有链接: http://www.mpinfo.com.tw/pdffile/9611PB_Tips.pdf 讲得很明白。我照着他的例子,作出了结果。是我见过的少有的教材。大家可以看看。这个网站还有其他pb的例程。
我给出具体的链接:  http://www.mpinfo.com.tw/Marketing/Article_List.asp?Article_Class=2

作为一个低人工成本,高开发效率的工具,国内的相关介绍却非常少,少得连问题都找不到答案。

powerbuilder11的webform发布和webservices调用实践_第3张图片

 powerbuilder11的webform发布和webservices调用实践_第4张图片

所以对于复杂的交互运用。还是觉得webservices方式合适。

w_main2代码如下:

//w_main2

//button clicked

soapconnection s_conn
uo_sayhellosoap mysoap

s_conn = create soapconnection

long ll_result

ll_result = s_conn.setsoaplogfile("./sayhellosoap.log")
ll_result = s_conn.createinstance(mysoap, "uo_sayhellosoap")

string ls_syntax,ls_data,ls_errcode
string ls_sayhello
boolean lb_retrieve_ok

ls_data =mysoap.of_get_ds_data(ls_syntax)
ls_sayhello = mysoap.of_say_hello("")

sle_1.text = ls_sayhello
dw_1.create(ls_syntax,ls_errcode)

if len(ls_errcode)>0 then
 messagebox("错误","创建数据框语法错误" +ls_errcode)
end if

dw_1.importstring(ls_data)

destroy mysoap
destroy s_conn

你可能感兴趣的:(String,Integer,webform,border,PowerBuilder,alignment)