Foxtable(狐表)用户栏目专家坐堂 → [求助] 不能创建网页,报错


  共有2142人关注过本帖树形打印复制链接

主题:[求助] 不能创建网页,报错

帅哥哟,离线,有人找我吗?
cool314156
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:374 积分:3277 威望:0 精华:0 注册:2018/1/12 10:54:00
[求助] 不能创建网页,报错  发帖心情 Post By:2020/4/29 17:28:00 [只看该作者]

Dim e As RequestEventArgs = args(0)


Dim wb As WeUI
Select Case e.Path
    Case "huan.htm"
        'PopMessage(1)
        Dim hwh As String
If e.PostValues.ContainsKey("货位号") Then
        hwh =  e.Postvalues("货位号")
'PopMessage(hwh )
msgbox(  hwh  )
    End If    
            'PopMessage(hwh )
            msgbox(  hwh  )
            Dim dr As DataRow = DataTables("库存").Find("货位号='" & hwh & "'")
            
        
        If dr IsNot Nothing Then
            PopMessage("找到行" )
            'wb.AddForm("","form1","huan.htm")
            
            With wb.AddInputGroup("form1","ipg2","货位调整")
                With    .AddInput("通用名","通用名","Text")  '前一个"姓名"是ID,后一个"姓名"是标题
                    .Value = dr("通用名")
                    .Readonly = True
                End With
                With    .AddInput("规格","规格","Text")
                    .Value = dr("规格")
                    .Readonly = True
                    
                End With
                With     .AddInput("批号","批号","Text")
                    .Value = dr("批号")
                    .Readonly = True
                End With
                With  .AddInput("货位号","货位号","Text")
                    .Value = dr("货位号")
                    .Readonly = True
                End With
                '.AddInput("通用名","通用名","Text")
                .AddInput("数量","数量","number")
                
                '.AddInput("单位","","Text")
                .AddInput("移入货位","移入货位","Text")
                
                '.AddInput("日期","日期","date")
            End With
        Else
            msgbox(101)
            'End If
            With wb.AddButtonGroup("form1","btg1",True)
                .Add("btn1", "确定", "submit")
            End With
            e.WriteString(wb.Build)
        End If
        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
        nms = New String() {"商品编号","规格","批号","货位号","数量","移入货位"}  '重新定义了nms数组,增加了两列.
        Dim kr As DataRow = DataTables("转移货位").AddNew()
        For Each nm As String In nms
            If e.PostValues.ContainsKey(nm) Then
                kr(nm) = e.PostValues(nm)
                kr("选择")=True
            End If
        Next
        e.WriteString(wb.Build)
End Select
上面的代码 执行之后就出现报错
.NET Framework 版本:4.0.30319.1
Foxtable 版本:2020.4.10.8
错误所在事件:自定义函数Khuan
详细错误信息:
Exception has been thrown by the target of an invocation.
Object reference not set to an instance of an object.
求版主帮忙改下
[此贴子已经被作者于2020/4/29 17:28:40编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106298 积分:540619 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/4/29 17:43:00 [只看该作者]

        Else
            msgbox(101)
            'End If
            With wb.AddButtonGroup("form1","btg1",True)
                .Add("btn1", "确定", "submit")
            End With
            e.WriteString(wb.Build)
        End If

什么这段代码移到最后一句End Select之前。

还有问题自己调试看是那一句代码有问题:http://www.foxtable.com/webhelp/scr/1485.htm

 回到顶部