有没有办法检查java Date对象是否是星期一?我看到你可以用一个Calendar物体,但约会?如果改变星期一的索引,我也会使用美国东部的日期和时间
我正在尝试将JSF <h:commandButtons>动态添加到我的网页,到目前为止我已经显示了它们,但我无法使用参数设置操作,就像我可以在静态页面中一样:
action="#{bean.function(parameter)}".(这当然是使用EL-2.2)
环顾四周我发现我必须创建一个MethodExpression,但这对我来说是模糊的,我无法找到关于此的更多信息.如果有人能透过雾灯照亮并解释如何做到这一点,我们将不胜感激.
编辑:所以现在我有这个
public void displayNode( String childName ){
//lots of messy code instantiating JSF components
if( activeEmployee.getParent() != null ){
HtmlCommandButton parent = new HtmlCommandButton();
HtmlOutputText parentLabel = new HtmlOutputText();
parentLabel.setId("label" + count++); //I really hate having to use count
parentLabel.setValue( "Parent: " );
parent.setId("Parent" + count++);
String parentName = activeEmployee.getParent().getName();
parent.setValue( parentName );
MethodExpression expression = createMethodExpression("#{tree.displayNode('" + parentName + "')}",
null, String.class);
parent.setActionExpression( expression );
newDiv.getChildren().add( parentLabel );
newDiv.getChildren().add( parent ); …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用JSF设置一个数据表,该数据表具有行总计的框,它将对行中任何框的行总数onChange求和.该行看起来像:
<tr id="input_row_1">
<td id="mondayInput1">
<h:inputText id="monday1" size="4" value="#{timesheet.monday1}" required="false" />
<!-- <input name="monday1" class="smallInput" type="number" size="2" maxlength="4" min="0"/> -->
</td>
<td id="tuesdayInput1">
<h:inputText id="tuesday1" size="4" value="#{timesheet.tuesday1}" required="false" />
<!--<input name="tuesday1" class="smallInput" type="number" size="2" maxlength="4" min="0"/> -->
</td>
<td id="wednesdayInput1">
<h:inputText id="wednesday1" size="4" value="#{timesheet.wednesday1}" required="false" />
<!--<input name="wednesday1" class="smallInput" type="number" size="2" maxlength="4" min="0"/> -->
</td>
<td id="thursdayInput1">
<h:inputText id="thursday1" size="4" value="#{timesheet.thursday1}" required="false" />
<!--<input name="thursday1" class="smallInput" type="number" size="2" maxlength="4" min="0"/> -->
</td>
<td id="fridayInput1">
<h:inputText id="friday1" size="4" value="#{timesheet.friday1}" required="false" /> …Run Code Online (Sandbox Code Playgroud)