我正在尝试在对话框中设置panelgrid.除了colspan之外,一切似乎都在起作用.我已经查看了这篇帖子PrimeFaces panelGrid但它的年份和一半的旧版本.从primefaces手册和展示中,colspan应该被datatable和panelGrid接受.
<h:form id="idFormAddDialog">
<p:panelGrid id="idPanelAddUsers" columns="2">
<h:outputLabel for="dAddOutUser" value="Username:"></h:outputLabel>
<h:inputText id="dAddOutUser" value="#{userController.username}"></h:inputText>
<h:outputLabel for="dSelRole" value="Role:"></h:outputLabel>
<h:selectOneMenu id="dSelRole" value="#{userController.role}">
<f:selectItem itemLabel="Admin" itemValue="1"></f:selectItem>
<f:selectItem itemLabel="Researcher" itemValue="2"></f:selectItem>
<f:selectItem itemLabel="User" itemValue="3"></f:selectItem>
</h:selectOneMenu>
<h:outputLabel for="dAddINPassword1" value="Password: "></h:outputLabel>
<p:password id="dAddINPassword1" value="#{userController.password}" feedback="true"></p:password>
<p:row>
<p:column colspan="2">
<p:separator></p:separator>
<!-- <p:separator></p:separator>-->
</p:column>
</p:row>
<p:commandButton value="OK" actionListener="#{userController.addUser()}" ></p:commandButton>
<p:button value="Cancel"></p:button>
</p:panelGrid>
</h:form>
Run Code Online (Sandbox Code Playgroud)
但我无法找到我做错的事.
我已经搜索了线程,但到目前为止我还没找到我正在寻找的东西.我创建了一个自定义警报对话框,我可以用它做任何事情.它自定义对话框由3个TextViews和3个EditText组成,但每当我需要获取EditText时,我得到一个null组件.
从我的xml文件
<TextView android:layout_alignParentTop="true"
android:id="@+id/txtAccName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Name"
android:textSize="23dp"
>
</TextView>
<EditText android:id="@+id/txtEditName"
android:layout_below="@+id/txtAccName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=""
android:maxLength="20"
>
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用以下内容获取EditText字段:
EditText txtAccName = (EditText) findViewById(R.id.txtEditName);
Log.d("#############################", "txtAccName="+txtAccName.getText().toString());
Run Code Online (Sandbox Code Playgroud)
但是当这样做时,第一行运行良好,第二行导致崩溃,控件为空.这是我用来创建我需要的自定义AlertDialog的Overwrite方法.
@Override
protected Dialog onCreateDialog(int id) {
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View layout = inflater.inflate(R.layout.accountdialog, (ViewGroup) findViewById(R.id.accDialog));
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setNegativeButton(android.R.string.cancel,new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
}
});
builder.setPositiveButton(android.R.string.ok,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
EditText txtAccName = (EditText) findViewById(R.id.txtEditName);
//EditText …Run Code Online (Sandbox Code Playgroud) 我面临一个奇怪的问题.我搜索包括堆栈溢出和JPA和自定义查询我应该指定参数.所以我有一个查询字符串,因为我有超过14个字段,但我面临日期问题.我总是得到IllegalStateException
INFO: query STRING = SELECT t FROM Tickets t WHERE t.startdate > :startDate AND t.enddate < :endDate ORDER BY t.status DESC
WARNING: #{ticketController.search}: java.lang.IllegalStateException: Query argument startDate not found in the list of parameters provided during query execution.
Run Code Online (Sandbox Code Playgroud)
至于我的查询:
Query q = em.createQuery(query).setParameter("startDate", startDate, TemporalType.TIMESTAMP).setParameter("endDate", endDate, TemporalType.DATE);
Run Code Online (Sandbox Code Playgroud)
虽然我得到的参数没有找到,但我在setParameter中有它,并且在INFO行中看到的查询中也设置了它.
有任何想法吗?
提前致谢
编辑:
INFO: query STRING = SELECT t FROM Tickets t WHERE t.startdate > ?1 AND t.enddate < ?2 ORDER BY t.status DESC
WARNING: #{ticketController.search}: java.lang.IllegalStateException: Query argument 1 not …Run Code Online (Sandbox Code Playgroud) 我一直在搜索,但到目前为止,我仅发现了如何基于csv文件将日期插入表中。
我有以下情况:
目录名称= ticketID
在此目录中,我有几个文件,例如:
Description.txtSummary.txt -包含票头,并且已成功导入。Progress_#.txt-这是每张票过期的时候。我得到一个新文件。Solution.txt导入Issue.txt其实很容易,因为它实际上是CSV。
现在我的问题是描述和进度文件。
我需要使用此文件中的数据更新现有行。线上的东西
update table_ticket set table_ticket.description = Description.txt where ticket_number = directoryname
Run Code Online (Sandbox Code Playgroud)
我使用的是PostgreSQL,该COPY命令对新数据有效,由于',; /特殊字符,它仍然会失败。
我想使用bash脚本执行此操作,但似乎不可能:
for i in `find . -type d`
do
update table_ticket
set table_ticket.description = $i/Description.txt
where ticket_number = $i
done
Run Code Online (Sandbox Code Playgroud)
当然,上面的代码将考虑到数据库的连接。
任何人都有关于如何使用Shell脚本实现此目标的想法。还是最好只用Java制作一些东西并读取和更新记录,尽管我想避免这种方法。
谢谢亚历克斯