有没有办法让页面的会话保持活动而不需要将状态发送到客户端?我不能够设置STATE_SAVING_METHOD到client,我宁愿不使用a4j:keepalive.
我已经尝试使用提交给Bean的简单隐藏iframe,但它使主页无效.
我正在使用JSF 1.2和myfaces.
这是为了在不需要用户登录的页面上绕过ViewExpiredException.大多数现有站点都要求用户登录.
我正在尝试使用sql server 2012在表中插入值,但是我有这个错误:
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Fabricante".
The conflict occurred in database
"practica", table "dbo.Fabricantes", column 'Codigo'.
Run Code Online (Sandbox Code Playgroud)
我只有两张桌子.
这是我用来创建表的代码
create table Fabricantes(
Codigo int identity primary key,
Nombre nvarchar (100) not null)
create table Articulos(
Codigo int identity primary key,
Nombre nvarchar (100) not null,
Precio int,
Fabricante int,
constraint FK_Fabricante foreign key
(Codigo) references Fabricantes (Codigo))
Run Code Online (Sandbox Code Playgroud) 我在我的项目中使用了primefaces的图表.
我知道是使用jqplot的primefaces图表.
在jqplot的网站上存在自定义jqplot图表的示例.
如何使用示例代码自定义primefaces图表?
自定义jqplot图表的示例代码如下:
$(document).ready(function () {
$.jqplot._noToImageButton = true;
var plot1 = $.jqplot("chart1", [prevYear, currYear], {
seriesColors: ["rgba(78, 135, 194, 0.7)", "rgb(211, 235, 59)"],
title: 'Monthly TurnKey Revenue',
highlighter: {
show: true,
sizeAdjust: 1,
tooltipOffset: 9
},
grid: {
background: 'rgba(57,57,57,0.0)',
drawBorder: false,
shadow: false,
gridLineColor: '#666666',
gridLineWidth: 2
},
legend: {
show: true,
placement: 'outside'
},
seriesDefaults: {
rendererOptions: {
smooth: true,
animation: {
show: true
}
},
showMarker: false
},
series: [
{
fill: true,
label: …Run Code Online (Sandbox Code Playgroud) 我有一个 ajax commandButton,当我点击它时,它会更新我使用的表单并在 onclick 方法上调用一个 js 函数。
问题:一个字段起初是不可见的,我使用style="display:none"forinvisibilty。当我单击按钮时,它会更新表单数据并显示:none 仍然存在。在 onclick 命令上,我使用 js 函数style="display:none将style="display:block".
这是我的 js 函数:
setTimeout(function() {
PF('field').jq.css('display', 'block');
}, delay);
Run Code Online (Sandbox Code Playgroud)
我使用延迟来等待更新完成其工作。
这是我的命令按钮:
<p:commandButton ajax="true" update="form" onclick="jsFunc();"</p:commandButton>
Run Code Online (Sandbox Code Playgroud)
但是我想确定 ajax update 什么时候完成它的工作,然后我想调用 js 函数。
做这个的最好方式是什么 ?
提前致谢。
我对primefaces有疑问.我有一个文本框,我需要在该文本框中的字符限制以及输出文本给出当前的字符状态.
目前,我的计数器看起来像这样:

而不是一个字符数下来,我宁愿一个计数了.更像是"使用32/50字符"的东西.
以下是我为此做的一些代码:
<p:inputTextarea id="recommendedToolsOther" rows="4"
style="vertical-align: top; width: 98% !important;" styleClass="preformatted"
autoResize="false" value="#{rfeBean.rfe.otherRecommendedTools}"
disabled="#{!rfeBean.recommendedToolsChecked[ReferralTemplateConstants.RECOMMENDED_TOOLS_HAND_OTHER]}"
counter="displayRecTools" maxlength="50"
counterTemplate="{0} characters remaining">
<p:ajax event="change" update="recommendedToolsOther"/>
</p:inputTextarea>
<br/>
<h:outputText id="displayRecTools" />
Run Code Online (Sandbox Code Playgroud)
我知道如何做到这一点.表示剩余字符数的变量由R表示.使用的字符数由U表示.
我需要这样做:U =(C-50)*( - 1)
我只是不确定如何在primefaces上做代数代数.
我已将以下内容包含p-calendar在我的项目中showTime="true":
<p-calendar formControlName="pre_check_in" [defaultDate]="defaultDate" [minDate]="dateTime" showTime="true" hourFormat="24" showButtonBar="true" required>
Run Code Online (Sandbox Code Playgroud)
然后在我的 TS 文件中,我用来将从setValue数据库获取的数据分配给受尊重的 formControlls:
private passService(qsUserId) {
this._appService.getEditVisitData(qsUserId).subscribe((data) => {
console.log(data);
this.editCheckinData = data;
this.editCheckinForm.controls[ 'id' ].setValue(this.editCheckinData[ 'id' ]);
this.editCheckinForm.controls[ 'f_name' ].setValue(this.editCheckinData[ 'f_name' ]);
this.editCheckinForm.controls[ 'l_name' ].setValue(this.editCheckinData[ 'l_name' ]);
this.editCheckinForm.controls[ 'purpose' ].setValue(this.editCheckinData[ 'purpose' ]);
this.editCheckinForm.controls[ 'department' ].setValue(this.editCheckinData[ 'department' ]);
this.editCheckinForm.controls[ 'pre_check_in' ].setValue(this.editCheckinData[ 'pre_check_in' ]);
// this.date1 = this.editCheckinData[ 'pre_check_in' ];
});
}
Run Code Online (Sandbox Code Playgroud)
其他字段显示所需的数据,但p-calendar仍为空。p-calendar是否可以显示默认日期的数据。获取并在表单中显示的数据采用以下格式:
check_in:null
checkin_status:false
created_at:"2018-04-12T04:56:43.000Z"
creator_email:"atul.vurung@gmail.com"
creator_id:"atul.vurung@gmail.com"
creator_mobileno:0
department:"D0001"
entry_source:"admin" …Run Code Online (Sandbox Code Playgroud) 我form在我的应用程序中使用 Primafaces 的以下代码:
...other inputs...
<label for="workshopTags">Tags</label>
<p-chips
[(ngModel)]="values"
name="workshopTags"
id="workshopTags"
></p-chips>
Run Code Online (Sandbox Code Playgroud)
我能够正确显示 Chip 元素,但我想将其宽度设置为 100%,高度设置为 100px,但似乎没有任何方法可以改变这些。这个解决方案对我不起作用。我尝试按照文档的建议设置 styleClass 或内联样式,但它们也不起作用。如果我内联写:
style="width: 100%"
Run Code Online (Sandbox Code Playgroud)
抛出以下错误:
错误:找不到不同的支撑对象“宽度:100%;”
我怎样才能让它发挥作用?
PrimeFacesp:selectBooleanCheckbox可以p:selectBooleanButton链接到boolean控制器中的原始数据类型变量。
我想要一个可以链接到参考数据类型的控制器Boolean。它必须能够显示null、true和false值。
可以p:triStateCheckbox链接到String变量,但不能链接到Boolean值。
是否有任何 JSF / PrimeFaces UI 组件可以表示BooleanJava 控制器中的引用数据类型?
我有 2 个数据表:
<p:dataTable id="tbl1" var="prop1" value="#{bean.prop1}" rendered="#{bean.listP1.size() != 0}">
// ...
</p:dataTable>
Run Code Online (Sandbox Code Playgroud)
和
<p:dataTable id="tbl2" var="prop2" value="#{bean.prop2}" rendered="#{bean.listP2.size() != 0}">
// ...
</p:dataTable>
Run Code Online (Sandbox Code Playgroud)
在 XHTML 页面上,经过一些操作,我得到了正确的结果,具体取决于listP1和listP2.
我的问题是点击导出按钮后
<h:commandLink>
<p:graphicImage value="/resources/icons/download.png" style="width : 35px; height:35px"/>
<pe:exporter type="pdf" target="tbl1, tbl2" fileName="SurveyResults"/>
</h:commandLink>
Run Code Online (Sandbox Code Playgroud)
我得到了错误的结果:我得到了两张桌子而不是一张桌子,因为其中一张是 size = 0
你对解决这个问题有什么想法吗?
jsf ×5
primefaces ×5
angular ×2
javascript ×2
angular5 ×1
charts ×1
css ×1
jqplot ×1
jquery ×1
primeng ×1
sql ×1
sql-server ×1