I've got a dropdown menu, which gets the persons from our LDAP server. What I basically did was copying the SelectOneMenuDemo from the Demo files.

However, it's displaying all persons correctly in the dropdown, but it won't set the selected person to my data.manager.

This is the code from the demo:

<p:selectonemenu value="#{data.selectedPerson}" converter="ivy.ListItem">
<f:selectitem itemlabel="Select One" itemvalue=""/>
<f:selectitems value="#{data.persons}" var="it" itemvalue="#{it}" itemlabel="#{it.name}"></f:selectitems> <f:selectitems value="#{data.morePersons}" var="it" itemvalue="#{it}" itemlabel="#{it.name}"></f:selectitems> <f:selectitem itemvalue="#{data.onePerson}" itemlabel="#{data.onePerson.name}"></f:selectitem> </p:selectonemenu>

And this is what I wrote:

<p:selectonemenu id="manager" value="{data.manager}" converter="ivy.ListItem" style="width: 200px;"> <f:selectitems value="#{data.managers}" var="it" itemvalue="#{it}" itemlabel="#{it.cn}"></f:selectitems> </p:selectonemenu>

Is there something I've forgotten? This looks exactly the same to me. Do I have to do something when I submit? I've got a multiview HTML dialog.

asked 13.03.2014 at 10:29

ahatius's gravatar image

ahatius
(suspended)
accept rate: 0%

edited 13.03.2014 at 10:38

Hi. Do you have any errors in the Runtime Log? Is the person not set if you look at the history of the element? If you copy the SelectOneMenu sample to your multiview Dialog is it also not set correctly?

(13.03.2014 at 13:27) Peter Stöckli ♦ Peter%20St%C3%B6ckli's gravatar image

@Peter Stöckli No, unfortunately it doesn't even show up in the history. I tried the snippet of the demo in my view, won't work either. Might this be a problem with switching views?

(13.03.2014 at 13:54) ahatius ahatius's gravatar image

Hi did you try to Change the value to example itemvalue="#{it.logon}" ? we had also Problems writing object into a value.

(27.03.2014 at 20:18) roland roland's gravatar image

@roland But that would only save one attribute of the object instead of the whole object. What bugs my mind is the fact that it works in the demo, so it can't be impossible. I suspect somethings wrong with the multiview, but I have no idea what it might be.

(27.03.2014 at 20:37) ahatius ahatius's gravatar image

The Hash in value is not set: wrong: ... value="{data.manager}" ... correct: ... value="#{data.manager}" ...

link

answered 30.04.2014 at 17:17

StoRicMan's gravatar image

StoRicMan
(suspended)
accept rate: 100%

edited 30.04.2014 at 17:19

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×79

Asked: 13.03.2014 at 10:29

Seen: 8,547 times

Last updated: 30.04.2014 at 17:19