title: Primefaces Picklist Converter
body: <p>I am using Primefaces 4.0 and JSF 2.2. I used a picklist with a converter. The problem is that I don't get the correct <code>arg2</code> in my converter. It always says <code>0</code>. My expectation is that this is the id of the element and I could parse it out of source/target lists. Any Ideas?</p>
  
  <p>My <code>Converter</code> is inspired by <a href="https://stackoverflow.com/questions/3621251/how-to-write-a-custom-converter-when-working-with-primefaces-components-that-co">How to write a custom converter for &lt;p:pickList&gt;</a>.</p>
  
  <p>My Picklist declaration is as follows:</p>
  
  <pre><code>&lt;p:pickList value="#{loadingPlaceGroups.pickList}"
      style="margin:0" var="loadingPlace"
      converter="primeFacesPickListConverter"
      itemValue="#{loadingPlace}"
      itemLabel="#{loadingPlace.name}#{loadingPlace.location.address.street}#{loadingPlace.location.address.houseNr}#{loadingPlace.location.address.zipCode}#{loadingPlace.location.address.city}"
      showSourceFilter="true" showTargetFilter="true"
      filterMatchMode="contains"
      styleClass="picklist500x350source picklist500x350target"&gt;
  
      &lt;f:facet name="sourceCaption"&gt;Alle Ladestellen&lt;/f:facet&gt;
      &lt;f:facet name="targetCaption"&gt;Gewählte Ladestellen&lt;/f:facet&gt;
      &lt;p:column style="border-bottom:1px solid lightgray"&gt;
          &lt;p:panelGrid&gt;
              &lt;p:row&gt;
                  &lt;p:column style="padding-left:0;font-size:12pt"&gt;
                      &lt;h:outputLabel value="#{loadingPlace.name}"
                          style="font-weight:bold" /&gt;
                  &lt;/p:column&gt;
              &lt;/p:row&gt;
              &lt;p:row&gt;
                  &lt;p:column style="padding:0"&gt;
                      &lt;h:outputLabel
                          value="#{loadingPlace.location.address.street} #{loadingPlace.location.address.houseNr}" /&gt;
                  &lt;/p:column&gt;
              &lt;/p:row&gt;
              &lt;p:row&gt;
                  &lt;p:column style="padding:0"&gt;
                      &lt;h:outputLabel
                          value="#{loadingPlace.location.address.zipCode} #{loadingPlace.location.address.city}" /&gt;
                  &lt;/p:column&gt;
              &lt;/p:row&gt;
          &lt;/p:panelGrid&gt;
      &lt;/p:column&gt;
  &lt;/p:pickList&gt;
  </code></pre>