jsf - 参数未在 Bean 中更新
问题描述
我面临一个奇怪的问题,我可以在 jsf 页面中以可编辑格式从数据库中获取数据,但是当我单击更新按钮时,新数据没有传递给 bean。基本上我正在尝试编辑已经提交的表单。
以下是我的代码:
jsf:
<h:form id="updateTraining">
<p:panelGrid id="update_training" style="width:800px" >
<p:row>
<p:column width="22%" style="align:left;">
Title
</p:column>
<p:column width="78%" style="align:left;" colspan="3">
<p:inputText id="trainingTitle" value="#{trainingModule.trainingTitle}" />
</p:column>
</p:row>
<p:commandButton action="#{trainingModule.forwardTrainingDetails}" value="FORWARD" update="growl">
<f:param name="employeeId" value="#{login.employeeId}" />
</p:commandButton>
</p:panelGrid>
</h:form>
豆:
@ManagedBean
@SessionScoped
public class TrainingModule {
private String trainingTitle;
//Getters and Setters
public String forwardTrainingDetails() throws Exception
{
System.out.println("Training TITLE:: " +trainingTitle);
}
}
但是当我更改 Training Title 的值时,新值不会在 bean 中更新。我尝试使用 process="@this,trainingTitle" ,但仍然没有运气。非常感谢任何帮助。
谢谢并恭祝安康
解决方案
推荐阅读
- css - 使用 opentypejs 仅显示特定字形
- vue.js - Vuelidate $each:如何验证嵌套集合?
- flutter - 为什么 BlocProvider.value 仅在我将变量转换为它自己的类型时才有效?
- python - 在 python 中使用 wget / urllib / requests 下载图像 HTTP 403 EROR
- android - 如何从数组列表和列表视图中删除 Android Studio 中的任务?
- eloquent - 如何在 laravel eloquent 中找到具有关系的随机用户
- mysql - 在MYSQL中加入两个数据表,避免重复值
- javascript - 从数组属性中获取元素。我得到了正确的答案,为什么它不接受?
- mysql - 使用 RMySQL 将 R 数据传输到 MYSQL
- python - 如何从一个numpy的概率数组中随机抽样?