a4j ajax,Jsf RichFaces a4j:支持迁移到a4j:ajax(Jsf RichFaces a4j:support migration to a4j:ajax)...

在将JSF 1.2应用迁移到JSF 2.x时,遇到一个问题:如何在不进行验证的情况下重新渲染表单并保留已输入的数据。原始代码利用`ajaxSingle=false`, `immediate=true`和`reRender=myForm`实现这一功能。在JSF 2.x中,尝试了不同的方法,但都无法达到相同的效果,导致要么整个表单重新验证和渲染,要么丢失已提交的字段值。寻求解决在JSF 2.x中实现相同行为的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I have problem with converting this code from JSF 1.2 application to equivalent in JSF 2.x application

ajaxSingle="false"

immediate="true"

reRender="myForm">

value="this.value"

assignTo="#{bean.type}"

noEscape="true"/>

How this code snippet works.

Depending on selected value in #{bean.type}, my page display different fields. When User change "type" field the whole form is rerendered, but without form validation (ajaxSingle="false", immediate="true", reRender="myForm").

I don't want to validate filds here, I just want to set new value to the #{bean.type} and rerender the page in order to show different fields (depending on #{bean.type}). Thats why i need to manualy set #{bean.type} inside a4j:actionparam.

The nice feature about this code is that submited values in other fileds are preserved after rerendering.

I am trying to do the same thing in JSF 2.x with no success:

This:

will rerender whole form and I will lose submited values form other fields

This:

will submit, validate and rerender whole form (i want just submit without validation like in JSF 1.2)

This:

also does not work (work same as above)

So my question is how can I achive the same behavior in JSF 2.x ?

Thanks

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值