when using JSF, some scenarios are difficult to deal with.
e.g. 1. multi rows raido buttons in dataTable
2. multi columns radio buttons in dataTable
The radio buttons don't fall in the one radio group, so they don't behave as one radio group
Solution: create customize component
step1, inherit and implement component class
add one overrideName field, so we can override the radio names generated by radio button. In this way, multi-row or column radios are considered in one radio group
step2, inherit and implement render class
override Decode(apply request phase, retrive the value from request obj and apply to component)
override Encode(render response phase)
step3, customize tag lib
http://www.javaworld.com/javaworld/jw-02-2007/jw-02-jsf.html?page=2
e.g. 1. multi rows raido buttons in dataTable
2. multi columns radio buttons in dataTable
The radio buttons don't fall in the one radio group, so they don't behave as one radio group
Solution: create customize component
step1, inherit and implement component class
add one overrideName field, so we can override the radio names generated by radio button. In this way, multi-row or column radios are considered in one radio group
step2, inherit and implement render class
override Decode(apply request phase, retrive the value from request obj and apply to component)
override Encode(render response phase)
step3, customize tag lib
http://www.javaworld.com/javaworld/jw-02-2007/jw-02-jsf.html?page=2
本文介绍了解决JSF中使用复选按钮在表格中出现的多行或多列问题的方法。通过创建自定义组件,使得这些复选按钮能够被视为同一组,并详细介绍了实现步骤。
4664

被折叠的 条评论
为什么被折叠?



