用户选择器到字段值 [英] User Picker to field values

查看:50
本文介绍了用户选择器到字段值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很抱歉,如果这对本网站来说太基本了,但是应用程序制造商的帮助将我定向到了这里.我正在创建一个数据输入屏幕,其中包含用户的基本信息-姓名,电子邮件,电话等.我正在使用用户选择器从我们的目录中选择个人.如何将所选用户的所有所需目录"字段值传递到我的插入记录屏幕.我正在检查用户选择器上的valueisRecord框,但无法弄清楚如何将所选用户的信息分配给表单的value字段.感谢您的帮助.

Sorry if this is too basic for this site, but app maker help directed me here. I am creating a data entry screen that includes basic info for a user - name, email, phone, etc. I am using the user picker to select the individual from our Directory. How do I pass all of the needed Directory field values of the selected user to my insert record screen. I am checking the valueisRecord box on the user picker, but can't figure out how to assign the selected user's info to the form's value fields. Thanks for the help.

推荐答案

好的,您的最后一条评论是有道理的.但请避免重复,我鼓励您通过包括所有可能需要的信息来正确地提出您的问题.现在,继续解决您的问题...

Ok, your last comment makes sense. But please, to avoid going back and forth, I encourage you to formultae your question properly by including all the information that could be required. Now, moving on to your problem...

出现该错误的原因是因为您将 UserPicker 小部件值绑定到了数据源电子邮件字段.请记住, UserPicker 值是一个对象,而不是字符串.

The reason you are getting that error is because you are binding the UserPicker widget value to the datasource email field. Remember, the UserPicker value is an object, not a string.

要解决您的问题,请从 UserPicker 中删除值的绑定.然后对于 UserPicker onValueChange 更改事件,请添加以下内容:

To fix your problem, remove the binding of the value from the UserPicker. Then for the onValueChange change event of the UserPicker please add the following:

var fullName = newValue.FullName;
var email = newValue.PrimaryEmail;

widget.datasource.item.Name = fullName
widget.datasource.item.email = email;

那样,您无需将对象关联到电子邮件字段,而是将纯字符串替换为

That way, you don't assing an object to the email field but instead a plain string.

这篇关于用户选择器到字段值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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