JSF生命周期,具有即时= true [英] JSF Lifecycle with immediate=true

查看:71
本文介绍了JSF生命周期,具有即时= true的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我阅读文章 监听和调试JSF生命周期阶段时 @BalusC写道,我在理解本文时遇到了一些麻烦.

When I read article Listen and debug JSF lifecycle phases wrtten by @BalusC, I have some trouble understanding the article.

添加即时="=" true到UIInput和UICommand ,它说:

While Add immediate="true" to UIInput and UICommand, It says:

请注意所有带有立即数的组件:由于跳过了更新模型值阶段,因此未设置值绑定,并且值绑定的获取器将返回null.但是这些值仍然可用...

Note for all components with immediate: as the Update model values phase is skipped, the value bindings aren't been set and the value binding getters will return null. But the values are still available...

不带立即数的其他组件的注意事项:同一表单内没有立即数="true"的任何其他UIInput组件; set将不会被转换,验证或更新,但是在执行action()方法之前,将在后台执行inputComponent.setSubmittedValue(submittedValue).您可以检索...

Note for other components without immediate: any other UIInput components inside the same form which don't have immediate="true" set will not be converted, validated nor updated, but behind the scenes the inputComponent.setSubmittedValue(submittedValue) will be executed before the action() method will be executed. You can retrieve...

这是否意味着无论是否使用immediate Update model values phase 都会始终被跳过,因为h:commandButton中的immediate="true"是?如果是这样,则后备bean中的值不会更改,对吧?

Is that means no matter with or without immediate, the Update model values phase will always skipped because the immediate="true" in the h:commandButton? If so, the value in backing bean will not change, right?

但是,在最后一段中在文章中,它总结了何时使用Instant = true" 并提到:

However, in the last paragraph of the article, it summarized "when to use immediate=true" and mentioned:

  • 如果同时在UIInput和UICommand组件中进行了设置,则对于任何未设置此属性的UIInput组件,将跳过应用请求值阶段,直到具有更新模型值阶段为止.使用此选项可跳过除某些字段(带立即数)以外的整个表格的处理.例如. 忘记密码";登录表单中的按钮",其中包含必填和立即用户名字段以及必填但非立即密码字段.

我很困惑,因为我认为 Process validations Phase Update model values Phase 会被跳过,无论您是否在immediate中设置了immdediate=true h:commandButton格式相同.

I am confused because I thought Process validations Phase and Update model values Phase are skipped no matter there are/aren't immediate once you set immdediate=true in h:commandButton in the same form.

我必须误解了一些内容,请帮助我进行澄清. 预先感谢!

I must misunderstood something, please help me clarify it. Thanks in advance!

推荐答案

该部分确实需要澄清.

摘要中的意思是作业,即使在应用请求中发生了这些作业,通常也会在上述阶段(即,应用请求值,处理验证和更新模型值)执行价值观阶段.

What is meant in the summary, is the job which is normally executed in the mentioned phases (i.e. applying request values, processing validations and updating model values), even though they happen in the apply request values phase.

我已经相应地更新了文章.

I have updated the article accordingly.

这篇关于JSF生命周期,具有即时= true的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆