我正在尝试为JTable创建一个简单的输入验证器.我最终覆盖了方法:editingStopped().问题是该事件不包括有关已更新的单元格的信息.
这是我的"伪代码":
If (user finished editing a cell) {
Check if cell`s value is "1" or "0" or "-" (Karnaugh-Veitch)
If (check = false)
setValue (cell, "");
}
Run Code Online (Sandbox Code Playgroud)
我试过的第一个就是这里:
table.getModel().addTableModelListener(new TableModelListener() {
@Override
public void tableChanged(TableModelEvent e) {
inputVerify (e.getColumn(), e.getFirstRow());
}
});
public void inputVerify (int column, int row) {
boolean verified = true;
String field = table.getValueAt(row, column).toString();
if (field != null && field.length() == 1) {
if ( !(field.charAt(0) == '0' || field.charAt(0) == '1' || field.charAt(0) …Run Code Online (Sandbox Code Playgroud) 我正在搜索和搜索,但我找不到任何解决我问题的方法.我使用DataTable(Primefaces)并想知道如何更改某些字段的语言/输出.
更准确地说,我想更改PaginatorTemplate中的{CurrentPageReport}.现在,它看起来很简单:(0 of 100).我想这样(第0页,共100页,500结果).
我尝试了很多,但没有任何作用.我做的最后一次是:
function change_text () {
$(".ui-paginator-current").each (function() {
$(this).html("Simple test");
});
}
$(".ui-icon").each(
function(index) {
$( this ).bind ("click",function(){ change_text (); });
}
);
Run Code Online (Sandbox Code Playgroud)
(ui-icon是表格中每个按钮的一部分.)
但这并不是真正有效的,因为你可以看到:-)这个解决方案是中途工作.当我按下按钮(下一页,上一页)时,.ui-paginator-current字段中的文本将更改回默认模板.我知道..原因是因为这个字段也在重新加载.
我也尝试更改Primefaces Code但我找不到正确的代码区域.
我正在使用JSF 2.0.3和PrimeFaces 2.2.1.我怎样才能解决我的问题?我可以从bean加载paginatorTemplate吗?如果我可以将文本从"0 of 100"更改为"0 aus 100"(德语),那将对我有所帮助.
希望你们能帮助我,就像我每次遇到问题一样.
Ioannis K.
datatable ×1
dynamic ×1
input ×1
javascript ×1
jsf ×1
jtable ×1
primefaces ×1
swing ×1
verification ×1
verify ×1