实在没办法了,请老师帮我做个例子吧,以下是我目前写的代码:
HttpRequest事件代码:
Case "Xdcg_jbxx.htm"
Functions.Execute("下单常规基本信息录入",e)
“下单常规基本信息录入”函数代码:
Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI
If e.PostValues.Count = 0 Then
wb.AddForm("","form1","Xdcg_jbxx.htm")
With wb.AddInputGroup("form1","ipg1","")
With .AddSelect("公司","公司","|" & _dt销售合同.SQLGetComboListString("公司","[合同类型] = '常规' And [执行状态] = '执行中' And [供货完结] = 0 And [业务员] = '" & _UserName & "'"))
.Attribute = """
End With
With .AddSelect("工程名称","工程名称","")
.Attribute = """
End With
.AddSelect("浇注部位","浇注部位","")
.AddInput("业务员电话","业务员电话","text").Value = "123456789"
End With
With wb.AddButtonGroup("form1","btg1",False)
.Add("btn1", "下一步", "submit")
.Add("btn2", "返回", "", "default.htm")
End With
e.WriteString(wb.Build) '生成网页
Else
Dim nms() As String = {"公司","工程名称"} '不能为空的列名数组
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) = False Then '生成错误提示页
With wb.AddMsgPage("","msgpage","增加失败", nm & "列不能为空!")
.icon = "Warn" '改变图标
.AddButton("btn1","返回").Attribute = ""
End With
e.WriteString(wb.Build)
Return "" '必须返回
End If
Next
e.WriteString(wb.Build)
End If
目前代码级联一切正常,现在遇到二个问题:
1、如果我删除 .AddInput("业务员电话","业务员电话","text").Value = "123456789" 这行代码并且打开网页后不选择公司名,点”下一步“后不会出现”公司列不能为空“的报错,必须选择公司名后再直接点”下一步“才会出现”工程名称列不能为空“的报错,反之加上这行代码后公司名不选择就会报错,实现的代码的本意,实在搞不懂怎么回事
2、关于提交后的数据处理,帮助文件看了好几天了,还是没搞懂,还是请老师直接帮我做个例子
假定有个网页,名字是"test.htm",在这个网页上有个
Case "test.htm"
Dim wb As New WeUI
With wb.AddArticle("","ar1")
.AddTitle("h1","公司")
.AddTitle("h1","工程名称")
End With
e.WriteString(wb.Build) '生成网页
我现在希望"Xdcg_jbxx.htm"的网页上选择公司及工程名称后点”下一步“,然后跳到这个"test.htm"上,并且将之前选择的公司及工程名直接赋值给AddArticle使用,换句话说,我如何把"Xdcg_jbxx.htm"所提交的数据找个地方存下,然后在别的地方使用,这样在后续的网页中就能将这个变量作为条件判断使用,如SQLFind
请老师务必帮我做个例子,纠结好几天了,万分感谢!