使用 Vaadin 14 当我尝试执行以下代码时遇到以下错误
UI current = UI.getCurrent();
Thread th = new Thread(() -> {
UI.setCurrent(current);
current.access(() -> {
//calling my service to save the data
current.push();
});
});
th.start();
Run Code Online (Sandbox Code Playgroud)
我遇到上述错误的情况非常罕见,但需要将其删除,如 UI 中所示。
我需要制作只能接受数字的 vaadin 14 文本框。文本框的标准如下
1.The textfield must only accept numbers nothing else as I want to use that textfield as a mobile number field. 2.validate in such a way that if users tries to enter the alphabets nothing must be reflected in the textfield.Only numbers must be allowed to be entered in the textfield. 3.Any warning or errors must not be shown in the UI as we are specially making textfield for the mobile number.
Things I have tried is …
我是 angular 的新手,想动态地更改 angular 材质主题,我知道如何通过制作 scss 文件来制作不同的主题,定义 3 种颜色,包括 mat 属性和功能,但后来我在 angular 中静态添加了该文件引用.json,但如果我有很多自定义的角度材质主题,我想动态地引用 css 文件。
那么有没有简单快速且经过优化的方法来做到这一点?
PS 我已经浏览了许多帖子和文档,但是在动态更改主题时似乎很混乱,例如,如果我切换了,那么如何引用不同的样式而不是默认样式?
任何答案将不胜感激.. !!
我想复制到 vaadin 14 中的剪贴板组件,否则我该如何准备?
我想在 Vaadin 中编写一个按钮来复制特定 Vaadin 小部件(如 TextField)的文本内容,将该文本放置在操作系统的剪贴板上,以便用户稍后可以将该文本粘贴到其他地方,可能是另一个应用程序中
我在 UI 中显示了一些卡片。
<div *ngFor="let item of cards | async">...</div>
Run Code Online (Sandbox Code Playgroud)
显然,卡片将是卡片类型数组的 Observable。
所以我有一个卡片接口可以说它有 3 个属性
ID、名称、描述。
我的用例是。
我想将新卡添加到 observables 数组并且必须反映到数组。
我想从 observable 中删除卡片,并且必须反映到模板中。
我必须能够过滤卡片,让我们说出名字,并且必须反映在模板中。
简而言之,所有的操作都必须在 observable 中完成,因为我在模板中使用了异步管道。