jsf:ajax标记破坏请求
我在JSF中使用Spring 我有一个视图范围的bean,它包含一个函数,xhtml文件包含一个下拉菜单,该菜单在值更改时更新一些消息给用户,还有一个按钮调用该函数。当我更改下拉列表并单击按钮时,不会调用该函数 移除标签后jsf:ajax标记破坏请求,ajax,spring,jsf,jsf-2,Ajax,Spring,Jsf,Jsf 2,我在JSF中使用Spring 我有一个视图范围的bean,它包含一个函数,xhtml文件包含一个下拉菜单,该菜单在值更改时更新一些消息给用户,还有一个按钮调用该函数。当我更改下拉列表并单击按钮时,不会调用该函数 移除标签后 ,函数被调用,并且工作正常 这是一个和过去一样的问题 xhtml 在将更改为时,任何解释都可能是在将响应发送到客户端后尝试写入响应缓冲区,可能是在这一行之后,context.getExternalContext().redirect(“/page.xhtml”)或者请求在
,函数被调用,并且工作正常
这是一个和过去一样的问题
xhtml
在将
更改为
时,任何解释都可能是在将响应发送到客户端后尝试写入响应缓冲区,可能是在这一行之后,context.getExternalContext().redirect(“/page.xhtml”)代码>或者请求在这一行之前已经被转发/调度。是的,当我更改下拉列表时,似乎是ajax编写了响应
@Scope("view")
@Component("propertyBean")
public class PropertyBean implements Serializable {
...
public String update() {
...
return"/page.xhtml";
}
}
<h:selectOneMenu id="type" required="true"
requiredMessage="#{msgBean.getRequired()}"
styleClass="btn btn-white dropdown-toggle" style="width:100%"
value="#{propertyBean.property.propertyDetails.type}"
converter="#{typeConverter}">
<f:selectItem itemValue="#{null}" itemLabel="choose item"
noSelectionOption="true" />
<f:selectItems value="#{dataBean.availableTypes}"
var="typeObj" itemValue="#{typeObj}"
itemLabel="#{typeObj.type}"/>
<f:ajax event="blur" render="type_message" />
</h:selectOneMenu>
<h:message id="type_message" for="type"
infoClass="help-block" errorClass="help-block error" />
<h:commandButton id="update" value="save"
onclick="if( validate('submitForm')==true){ updateProperty();} else{ return false;}"
action="#{propertyBean.update}"
class="btn btn-green btn-lg arabic"
rendered="#{propertyBean.isNew == false}">
<f:param name="propertyId" value="#{propertyBean.property.id}">
</f:param>
</h:commandButton>