jsf in action 笔记:在组件中使用EL语言(Using the EL with components)--2008.04.11
来源:互联网 发布:硬盘在mac机不能复制 编辑:程序博客网 时间:2024/05/19 13:09
2008.04.11 摘自 JSF in action 2.4.3 Using the EL with components Page/117
JSF的EL表达式可以将组件与Backing Bean或者Model Object联系起来,可以将组件中的展现与对象中的属性的值动态关联,也可以将某个按钮与Backing Bean对象中的某个方法关联起来,包可以将整个组件与对象中的某个属性关联.就像这样
<h:inputTextArea value="#{registrationForm.comments}"/>
将HtmlInputTextArea中的value值与registrationForm对象中的comments属性动态关联起来.如果属性的类型是一个集合(List,Array,Map等),可以这样<h:graphicImage value="#{user.icons[5]}">
<h:inputText value="#{registrationForm.comments}" binding="#{registrationForm.nameInput}"/>
如果采用binding的属性,那么类的属性的类型与组件的类型要是一样的(是HtmlInputText或是HtmlInputText的子类),当需要在类中控制组件的属性的时候才使用绑定(binding).
<h:inputTextarea value="#{registrationForm.comments}"
binding="#{registrationForm.commentsInput}"
valueChangeListener="#{registrationForm.commentsChanged}"
validator="#{registrationForm.checkSpelling}"
styleClass="#{initParam[commentStyle]}"
rows="10"
cols="80"
title="#{appBundle.commentsTitle}"/>
binding="#{registrationForm.commentsInput}"
valueChangeListener="#{registrationForm.commentsChanged}"
validator="#{registrationForm.checkSpelling}"
styleClass="#{initParam[commentStyle]}"
rows="10"
cols="80"
title="#{appBundle.commentsTitle}"/>
- jsf in action 笔记:在组件中使用EL语言(Using the EL with components)--2008.04.11
- JSF el中使用enum
- JSF笔记 – JSF中的EL表达式语言支持
- jsf in action 笔记:在页面的海洋中导航(3.4 Navigating the sea of pages)--2008.04.16
- JSF 的el表达式语言
- jsf in action 笔记:页面语言(Expression Language)--2008.04.09
- 在JSP2.0中使用EL表达式语言
- 在JSP2.0中使用EL表达式语言
- 在JSP2.0中使用EL表达式语言
- 在JSP2.0中使用EL表达式语言
- jsf in action 笔记:标准组件(一)--组件列表--2008.04.16
- 表达式语言(EL)在jsp中的使用
- jsf in action 笔记:web.xml配置(Configuration)--2008.04.11
- JSF in action笔记--术语(jsf pie)--2008.04.07
- Spring--在Bean定义中使用EL
- EL表达式在js文件中使用
- 在org中使用table.el
- 关于在FreeMarker中使用EL表达式
- php5.1x的时区问题!
- JPEG 学习笔记
- ::细细品味ASP.NET (五)::
- 建议CSDN用5个9的标准要求服务质量
- Verilog与C++的类比
- jsf in action 笔记:在组件中使用EL语言(Using the EL with components)--2008.04.11
- ::细细品味ASP.NET (四)::
- ::细细品味ASP.NET (二)::
- 《C# Primer 中文版》探讨
- ::细细品味ASP.NET (三)::
- 软件工程师好了歌
- 关于在FPGA上实现AES算法的笔记
- ::细细品味ASP.NET ::
- 利用Bresenham算法控制多部步进电机匀速转动