UiPath Documentation
apps
2022.10
false
Apps User Guide for Automation Suite
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

容器验证

背景信息

You can use a container's isValid property to check the input validation for all controls inside the container.

这更容易,因为在构建应用程序时不再需要单独提及每个控件。

在此示例中,我们将在单个容器中构建一个包含五个控件的简单表单:

  • Two textboxes: one called Name, and a second one called Email (input type Email).
  • 一个名为Date ofbirth 的日期选取器。
  • 一个名为“区域”的下拉列表。
  • 一个名为“提交”的按钮。

步骤

  1. 打开您现有的应用程序或启动一个新应用程序。
  2. 将容器添加到您的应用程序。
  3. Add a Textbox control inside the container.
    • 将其重命名为“名称” ,并在“标签”属性中添加“ Name ”。
    • Add =true in the Required property.
  4. 在容器中添加一个Datepicker控件。
    • 将其重命名为“出生日期”,并在“标签”属性中添加Date of birth
  5. Add a second Textbox control inside the container.
    • Select Email as Input type.
    • 将其重命名为“电子邮件”,并在“标签”属性中添加Name
    • Add =true in the Required property.
    • Add @company.com in the Allow domain property.
  6. 在容器内添加一个下拉控件。
    • 将其重命名为“区域”,并在“区域”属性中添加Name
    • Add the following in the List source property: =["rural", "urban"].
    • Add =true in the Required property.
  7. Add a Button control outside the container.
    • 将其重命名为“提交”

    • Add the following in the Disabled property: !Container.isValid.

程序结果

完成上述所有步骤后,您可以预览应用程序。

预览应用程序时,“提交” 按钮处于禁用状态。 仅当填写了“名称”、“电子邮件”(包括正确的@company.com域)和“区域”字段时,才会启用该按钮。

  • 背景信息
  • 步骤
  • 程序结果

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新