1

In an editable Primefaces datatable with editmode=cell, I have a selectonemenu with a key as itemValue and value as itemLabel. But when I select it and change the value, it displays the key (itemValue), not the label (itemLabel). is this the actual behaviour of the component, because if so, my requirement is that itemLabel is shown always.

Please help !!

Thank you !

FakeSheikh
  • 121
  • 1
  • 8
  • `

    ` renders an HTML `` construct/tag which always passes the associated key (`itemValue` in JSF/Primefaces terminology), when it is submitted. Essentially, JSF (and PrimeFaces) is merely an HTML/CSS/JS generator. Thus, it is more related to HTML than JSF/PrimeFaces. If you need to retrieve the label/text (`itemLabel`), then let the key (`itemValue`) and the value (`itemValue`) be the same.

    – Tiny Apr 05 '15 at 10:45
  • Yes, but I have to store the key in the db , which is the key for its corresponding value in all future stransactions – FakeSheikh Apr 05 '15 at 11:33
  • 1
    I still cannot interpret the question correctly. It appears that you have bound a `java.util.Map` to a `

    ` in which keys are inferred as item labels and values are inferred as item values. You may need to interchange the order of keys and values in that `Map`, if keys are stored in place of values and vice verse.

    – Tiny Apr 05 '15 at 11:48
  • No. The functionality works perfectly outside a datatable. But when in an editable datatable, when I select the value, they key is finally put in the cell instead of the label. – FakeSheikh Apr 05 '15 at 11:59
  • I found the issue here. Is there no solution as of now ? https://code.google.com/p/primefaces/issues/detail?id=4971 http://stackoverflow.com/questions/13722661/primefaces-3-5-omnifaces-1-3-selectitemsindexconverter-issue-with-selectonemen – FakeSheikh Apr 07 '15 at 06:32
  • The status is, "CantReplicate" i.e the issue cannot be reproduced (it has been closed). Therefore, not sure about any solution/workaround. – Tiny Apr 07 '15 at 09:09

0 Answers0