Foxtable(狐表)用户栏目专家坐堂 → 编辑功能


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

主题:编辑功能

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


加好友 发短信
等级:六尾狐 帖子:1495 积分:12175 威望:0 精华:0 注册:2013/3/19 16:41:00
编辑功能  发帖心情 Post By:2020/3/14 15:43:00 [显示全部帖子]

请老师给看看,我下面的代码是要对数据进行编辑,但进入页面后:

1、输入不了,输入框无反应。

2、点击确定按钮后无反应。

 

Dim e As RequestEventArgs = args(0)
Dim wb As New weui
Dim PageNumber As Integer = e.GetValues("page")
Dim PrimaryKey As Integer = e.GetValues("key")
Dim PageURL = "jdlkList.htm?page=" & PageNumber
If e.PostValues.Count = 0 Then '生成编辑页面
    Dim dr As DataRow = DataTables("学生数").SQLFind("[_Identify]=" & PrimaryKey)
    If dr IsNot Nothing Then
        wb.AddForm("","form1","edit.htm?key=" & PrimaryKey &  "&page=" & PageNumber)
        With wb.AddInputGroup("form1","ipg1","编辑学生信息")
           
            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
           
           
            With .AddInput("年报人数","年报人数","number")
                .Value = dr("年报人数")
                .Min = "25"
                .Max = "60"
                .Value = dr("年报人数")
                .Readonly= True
            End With
            With .AddInput("在校人数","在校人数","number")
                .Min = "25"
                .Max = "60"
                .Value = dr("在校人数")
                .Readonly= True
            End With
            With .AddInput("民族_汉族","汉族人数","number")
                .Min = "1"
                .Max = "50"
                .Value = dr("民族_汉族")
                .Readonly= True
               
            End With
            With .AddInput("民族_少数民族","少数民族","number")
                .Min = "1"
                .Max = "50"
                .Value = dr("民族_少数民族")
                .Readonly= True
               
            End With
            With .AddInput("性别_男","男生人数","number")
                .Min = "1"
                .Max = "50"
                .Value = dr("性别_男")
                .Readonly= True
            End With
           
            With .AddInput("性别_女","女生人数","number")
                .Min = "1"
                .Max = "50"
                .Value = dr("性别_女")
                .Readonly= True
            End With
            With .AddInput("住宿生_男","住宿男生数","number")
                .Min = "1"
                .Max = "50"
                .Value = dr("住宿生_男")
                .Readonly= True
            End With
            With .AddInput("住宿生_女","住宿女生数","number")
                .Min = "1"
                .Max = "50"
                .Value = dr("住宿生_女")
                .Readonly= True
            End With
           
        End With
       
       
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1", "确定", "submit")
        End With
    Else
        With wb.AddMsgPage("","msgpage","编辑失败", "此信息可能已经被删除!") '提示
            .icon= "Warn"
            .AddButton("btn1","返回",PageURL) '生成返回原来页面的按钮
        End With
    End If
Else '保存编辑结果
    Dim dr As DataRow = DataTables("学生数").SQLFind("[_Identify]=" & PrimaryKey)
    If dr IsNot Nothing Then
        Dim nms() As String = {"学生数","年级","班级","班主任","年报人数","在校人数","民族_汉族","民族_少数民族","性别_男","性别_女","住宿生_男","住宿生_女"}
        For Each nm As String In nms
            dr(nm) = e.PostValues(nm)
        Next
        dr.Save()
        '显示完成提示,2妙手自动返回原来的页面
        wb.AppendHtml("<meta http-equiv='refresh' c>",True)
        wb.AddToast("","t1", "编辑完成",0).Visible = True
    Else
        With wb.AddMsgPage("","msgpage","保存失败", "此信息可能已经被删除!") '提示.
            .icon= "Warn"
            .AddButton("btn1","返回",PageURL) '生成返回原来页面的按钮
        End With
    End If
End If
e.WriteString(wb.Build) '生成网页


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


加好友 发短信
等级:六尾狐 帖子:1495 积分:12175 威望:0 精华:0 注册:2013/3/19 16:41:00
  发帖心情 Post By:2020/3/14 16:33:00 [显示全部帖子]

实际已经进入了edit函数,并打开页面,也找到了要编辑的记录。只是点击确定按钮后就不动了。查看修改的信息没有写入数据表中。

[此贴子已经被作者于2020/3/14 16:40:04编辑过]

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


加好友 发短信
等级:六尾狐 帖子:1495 积分:12175 威望:0 精华:0 注册:2013/3/19 16:41:00
  发帖心情 Post By:2020/3/14 17:02:00 [显示全部帖子]

以下是引用有点蓝在2020/3/14 16:56:00的发言:
点击确定按钮后,后台跟踪能不能进入函数

Dim PageNumber As Integer = e.GetValues("page")
Dim PrimaryKey As Integer = e.GetValues("key")
msgbox(PrimaryKey )
请问老师,怎么进行后台跟踪呢?我是编译后放到服务器上运行,拿手机连接试的,不知如何进行后台跟踪,请老师指点,谢谢,

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


加好友 发短信
等级:六尾狐 帖子:1495 积分:12175 威望:0 精华:0 注册:2013/3/19 16:41:00
  发帖心情 Post By:2020/3/14 18:53:00 [显示全部帖子]

以下是引用有点蓝在2020/3/14 17:15:00的发言:
到服务器看msgbox(PrimaryKey )提示框能不能弹出

老师好,可以弹出提示框,显示的是数字。下一步怎么办呢?


 回到顶部