也许这是一个愚蠢的问题,但在Primefaces中,<p:dialog>有一个属性,appendTo在手册中描述为:
将对话框追加到给定搜索表达式定义的元素.
我无法意识到它有用吗?
我们有一个基于Sinopia的私人npm存储库
我应该定义什么package.json,一些软件包将从Synopia而不是从全局npm存储库安装?
如果我从命令行安装它,我可以运行: npm install <package_name> --registry <http://<server:port>
PS试图谷歌并查看官方NPM文档,但没有发现任何东西.
我想异步验证用户输入。例如,检查电子邮件是否已存在,并在用户键入时执行验证。为了减少 API 调用,我想使用 lodash 或自定义去抖函数来去抖 API 调用,并在用户停止输入时执行验证。
到目前为止,这就是我的表格。问题是它没有按预期工作。看来被谴责的函数返回了上一次调用的值,我不明白问题出在哪里。
您可以在这里看到一个实例: https: //codesandbox.io/s/still-wave-qwww6
import { isEmailExists } from "./api";
const debouncedApi = _.debounce(isEmailExists, 300, {
trailing: true
});
export default function App() {
const validationSchema = yup.object({
email: yup
.string()
.required()
.email()
.test("unique_email", "Email must be unique", async (email, values) => {
const response = await debouncedApi(email);
console.log(response);
return response;
})
});
const formik = useFormik({
initialValues: {
email: ""
},
validateOnMount: true,
validationSchema: validationSchema,
onSubmit: async (values, actions) => {}
}); …Run Code Online (Sandbox Code Playgroud) 根据这个问题:使用额外的inputText上传多个文件 我可以通过这种方式使用widgetVar覆盖PrimeFaces元素的JavaScript函数:
PF('fileUpload').jq.fileupload({
add: function(e, data) {
...
}
});
Run Code Online (Sandbox Code Playgroud)
现在,我尝试覆盖DataTable中的函数,无法理解我如何引用它?而且,PF(')从chrome调试器控制台返回undefined,所以我无法调试它.我怀疑这是范围的问题,但不知道如何解决它.
我的facelet页面中有以下代码:
<hc:rangeChooser1 id="range_chooser"
from="#{testBean.from}"
to="#{testBean.to}"
listener="#{testBean.update}"
text="#{testBean.text}">
<f:ajax event="rangeSelected"
execute="@this"
listener="#{testBean.update}"
render=":form:growl range_chooser"/>
</hc:rangeChooser1>
Run Code Online (Sandbox Code Playgroud)
这是我的复合组件:
<ui:component xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:cc="http://java.sun.com/jsf/composite"
xmlns:p="http://primefaces.org/ui">
<cc:interface componentType="rangeChooser">
<!-- Define component attributes here -->
<cc:clientBehavior name="rangeSelected" event="change" targets="hiddenValue"/>
<cc:attribute name="from" type="java.util.Calendar"/>
<cc:attribute name="to" type="java.util.Calendar"/>
<cc:attribute name="text" type="java.lang.String"/>
</cc:interface>
<cc:implementation>
<div id="#{cc.clientId}">
...
<p:inputText id="hiddenValue" value="#{cc.attrs.text}"/>
...
</div>
</cc:implementation>
</ui:component>
Run Code Online (Sandbox Code Playgroud)
我如何通过属性from,to并text从复合组件支持豆?我的意思是将这些值注入后备组件,而不是通过
<p:inputText id="hiddenValue" value="#{cc.attrs.text}"/>
Run Code Online (Sandbox Code Playgroud)
更新:有更正确的定义是什么,我需要:能够变异这是我从传递对象backing bean到composite component内部backing component的composite component.因此,当我执行process …
我正在Eclipse中开发一个Web项目并使用一个凉亭.我使用的一些库有演示文件和它自己的依赖项,它们与项目结构有关,这与我项目的结构不同.Eclipse抱怨并给了我很多错误:
如何禁用这些文件夹中包含的资源的验证?我已经在这些文件夹中禁用了JavaScript验证,如下所述:如何从我的eclipse项目中删除javascript验证?
谢谢.
我知道我不能直接在Primefaces中做到这一点,我知道我必须在转换器中做到这一点但不知道在哪个阶段以及如何?我应该检查什么?也许这样做我需要楔入JSF的生命周期?例如,在p:自动完成后,在" 应用请求值阶段 " 中将列表添加到列表中,如果我以正确的方式理解JSF生命周期,我应检查是否存在重复项并在" 更新模型值阶段 " 之前将其删除?有可能吗?先感谢您.
在准备考试时,ANSI CI遇到了以下问题 -
以下声明是否有效?
如果没有,请进行必要的更改以使其有效.
原始陈述是:test(i++,i++);它无效,因为根据K&R p202,行为未定义
参数的评估顺序未指定
但我可以将其更改为以下声明吗?test(i+=2, i+=3)?
我在K&R或任何其他来源中没有看到这样的记录的问题.但XCode编译它并在没有任何警告的情况下运行.
我正在使用ocLazyLoad库来实现项目中所有依赖项的延迟加载.我知道默认情况下文件并行加载并按顺序加载我应该使用serie:true https://github.com/ocombe/ocLazyLoad/issues/47
从这个线程我明白我可以串行加载模块:
是的,文件是并行加载的,如果你想同时使用多个模块并且它们需要彼此,你需要在不同的对象参数中定义它们:
$ocLazyLoad.load([{
name: 'TestModule',
files: ['testModule.js', 'testModuleCtrl.js', 'testModuleService.js']
},{
name: 'AnotherModule',
files: ['anotherModule.js']
}]);
Run Code Online (Sandbox Code Playgroud)
现在我尝试在我的应用程序中加载FullCalendar所需的所有依赖项,这是我的ocLazyLoad配置文件:
$ocLazyLoadProvider.config({
debug: true,
modules: [{
name: 'ngCkeditor',
files: [
'resources/bower_components/ng-ckeditor/libs/ckeditor/ckeditor.js',
'resources/bower_components/ng-ckeditor/ng-ckeditor.min.js',
'resources/bower_components/ng-ckeditor/ng-ckeditor.css'
],
serie: true
},{
name: 'ui.calendar',
files: [
'resources/bower_components/fullcalendar/dist/fullcalendar.min.js',
'resources/bower_components/fullcalendar/dist/lang/he.js',
'resources/bower_components/fullcalendar/dist/gcal.js',
'resources/bower_components/angular-ui-calendar/src/calendar.js',
'resources/bower_components/fullcalendar/dist/fullcalendar.min.css'
],
serie: true
},{
name: 'ngFileUpload',
files: [
'resources/bower_components/ng-file-upload/ng-file-upload.min.js'
]
},{
name: 'momentjs',
files: [
'resources/bower_components/moment/min/moment.min.js'
]
}]
});
Run Code Online (Sandbox Code Playgroud)
这是我的路由器的一部分:
.state('schedule',{
url: '/schedule',
controller: 'ScheduleController',
templateUrl: 'schedule.html',
resolve: {
loginRequired: loginRequired,
loadMyCtrl: …Run Code Online (Sandbox Code Playgroud) 在使用继承缩小/丑化ES6代码时,Webpack删除了类名:
班级儿童:
const ParentClass = require('parent');
class Child extends ParentClass{
constructor(){
super();
}
}
module.exports = Child;
Run Code Online (Sandbox Code Playgroud)
index.js调用Child类:
const Child = require('./classes_so/child');
let child = new Child();
console.log(child.constructor.name);
Run Code Online (Sandbox Code Playgroud)
模块父内部node_modules:
class Parent {
constructor() {
if (this.constructor.name === 'Parent'){
throw new TypeError("Parent class is abstract - cant be instance");
}
}
}
module.exports = Parent;
Run Code Online (Sandbox Code Playgroud)
整个输出我会后的问题结束,在这里我要发布唯一相关的线,我认为会导致错误的行为(由原来的输出线33-37):
n.exports = class extends r {
constructor() {
super();
}
}; …Run Code Online (Sandbox Code Playgroud) jsf-2 ×3
primefaces ×3
javascript ×2
jsf ×2
node.js ×2
angularjs ×1
bower ×1
c ×1
c89 ×1
eclipse ×1
filepath ×1
formik ×1
lazy-loading ×1
npm ×1
oclazyload ×1
package.json ×1
reactjs ×1
uglifyjs ×1
uglifyjs2 ×1
webpack ×1
yup ×1