RichFaces 4.1: rich:pickList (in M2)
kwutzke Oct 22, 2011 4:51 AMHello,
I've just used the RichFaces 4 rich:pickList component the first time.
Here's the code:
{code}<rich:pickList value="#{companyManager.instances}"
columnVar="dontknowwhatitisfor"
sourceCaption="Available Companies"
targetCaption="Selected Companies">
<f:selectItems value="#{companyManager.instances}"
var="company"
itemValue="#{company.id}"
itemLabel="#{company.name}" />
<!--f:converter converterId="EntityBeanConverter" /-->
<!--rich:column>#{dontknow.id}</rich:column>
<rich:column>#{dontknow.name}</rich:column-->
</rich:pickList>{code}
Note, I copied the code from an older thread here, so maybe I'm using the component incorrectly.
I have a few questions:
1. Why are the generated HTML classes called 'rf-pick-source-caption', 'rf-pick-target-caption', 'rf-pick-btn' etc.? RF 4 started to reduce the amount of HTML by abbreviating CSS classes, right? So the abbreviation for pickList should rather be 'plst', 'source' should be 'src', 'caption' should be 'cptn', etcetc. After all, 'btn' got abbreviated, too... Keep up the consistency?
2. The action buttons are all the same size, but when making the browser window smaller the middle buttons are rendered muuuch to narrow (wrong resize behavior). My current workaround is to set CSS like
{code}.rf-pick-btn
{
min-width: 110px;
}{code}
but it's probably not intended that way. Bug?
3. What is rich:pickList value="#{...}" for? I thought this would be the default target elements (already selected), but it doesn't add the items to the list on the right. Do the list elements have to exclude each other?
4. What's columnVar for? (Why was columnVar named columnVar anyway? AFAI understand each item rather represents a row, like in a dataTable, or am I mistaken? JSF has other component IIRC rowKey etc... or call it targetVar as it belongs to the target items? This would be kind of neutral... but not that important really.)
5. In classic skin, the color of the captions defaults to white. On a gray background this disappears. Has the right color default been correctly chosen here? (I can't compare it to RF 3 as the demo doesn't show the captions.)
Another functionality I could need would be the automatic selection of certain items, that is they are always at the right side and can't be removed, even by the remove all button. Maybe pass a list of fixedValues/selectedValues to rich:pickList? I doubt this will be available short-term, but I'll give it a try nontheless. :-)
#3 and #4 would be the important questions...
Comments appreciated.
Thanks
Karsten