更好的方法吗? [英] Better way to do this?

查看:69
本文介绍了更好的方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

未绑定表单和两个未绑定文本框:

z_ctrl_txt_HistoryLogVol

z_ctrl_txt_HistoryLogPage


表单未绑定,因为必须验证针对其他数据条目执行的步骤,并且存在签字。技术人员必须输入密码以确认信息已经过审核。


在实验室中有多个日志,因此LogVol,

和当然,其中的页面,LogPage


除非它们都已填满(没有页面的卷或没有卷的页面,否则填充其中一个或其他内容毫无意义...方式,无用)。


所以这就是我用来检查两者是否都填满的东西:

展开 | 选择 | Wrap | 行号

解决方案

所以,你想找到控件中的一个或另一个,但不是两个都是空的吗?


我会说:

展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号


我最初只使用isnull();但是,如果用户在控件中输入一个值,选项卡输出,然后返回控件,最后清除它(删除键)或只输入空格键,然后isnull()没有捕捉到这个事实;但是,这个构造似乎抓住了这个动作。

另外,当我重置表单时,值被重置为空字符串而不是空值。


我很惊讶。特别感到惊讶的是你所拥有的将检查空间()值。也许TextBox控件从字段中获取设置,如果字段允许则允许空字符串。这至少可以解释为什么 empty 控件可能具有ZLS值而不是更常见的Null。


Unbound form and two unbound text boxes:
z_ctrl_txt_HistoryLogVol
z_ctrl_txt_HistoryLogPage

The form is unbound as there must be validation steps performed against the other data entries and there is a "sign-off" PIN that the tech must enter to confirm that the information has been reviewed.

In the lab there are multiple logbooks,hence the LogVol,
and ofcourse, the pages therein, LogPage

It makes no sense to have either one or the other filled unless they are both filled (a volume without a page or a page without a volume... either way , useless).

So this is what I''ve been using to check to see if both are filled:

Expand|Select|Wrap|Line Numbers

解决方案

So, you want to find when either one or the other, but not both, of the controls is Null?

I would say :

Expand|Select|Wrap|Line Numbers


I had originally started with just the isnull(); however, if a user enters a value in the control, tab''s out, and then back into the control finally clears it (delete key) or enters just the spacebar then the isnull() doesn''t catch this fact; however, this construct appears to catch this action.
Also, when I reset the form the value is reset to an empty-string and not a null value.


I''m surprised. Especially surprised that what you have would check for a space (" ") value. Maybe TextBox controls take the settings from the field and allow empty strings if the field does. That might at least explain why an empty control could have a ZLS value rather than the more usual Null.


这篇关于更好的方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆