I try to show some values from different Primefaces "selectManyCheckbox" in a "inputText" field. The value in the inputText field is shown correctly, but the form doesn't proceed. I get no warnings or errors. For instance:

<p:selectManyCheckbox id="motorSonderBox" value="#{data.datenAnfrage.motorSonder}" style="width:400px">
    <f:selectItems value="#{data.datenAnfrage.motorSonder}" var="motorSonder" itemLabel="#{motorSonder}" itemValue="#{motorSonder}" />
<p:inputText style="width:180px" value="#{data.datenAnfrage.motorSonder}"/>

Can you help me?

asked 23.02.2016 at 09:47

Gabriele's gravatar image

accept rate: 66%

edited 23.02.2016 at 14:33

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦

Now I got it. It is so simple, I use not a <p:inputText but a <h:outputText. Anyway thank's a lot for help.


answered 25.02.2016 at 11:20

Gabriele's gravatar image

accept rate: 66%

Hi Gabriele,

i guess the Problem is following.

1st seltecitems.value Needs to be a list of String or objects . 2nd the value of p:selectmanycheckbox is a diffrent Attribute of the dataclass

if the select items value is a list of obect you Need to define the Attribute of the object in itemvalue and itemlabel e.g. motorSonde.id

then it should work.

you could have a look at the Designer log in log Directory of designer dir, maybe there are more Errors logged.

best reards Roland


answered 23.02.2016 at 11:12

roland's gravatar image

accept rate: 41%

Hi Roland, Thanks for your answer, but it still doesn't work. My selectItems is a List of Strings and in my first form I use a different selectItems value "motorSonderList". By the way you can use the same list like in the value of p:selectManyCheckbox than only selected values are shown in further forms.

My inputText should concatenate the selected string from motorSonder and other values from other inputText fields. Something like that: p:inputText style="width:180px" value="#{data.datenAnfrage.motorSonder} #{data.datenAnfrage.drehzahl}" ></p:inputtext>

The following error is in the logfile: Cannot convert [M48S] of type class java.lang.String to interface java.util.List

Do you have any ideas how I can solve this problem?

(23.02.2016 at 15:08) Gabriele Gabriele's gravatar image

did you try to invoke the toString() method explicitly?

<p:inputtext style="width:180px" value="#{data.datenAnfrage.motorSonder.toString()}"/>

(24.02.2016 at 09:54) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image

I can't put the Method toString() on this value because then an error comes up "Data Class member 'datenAnfrge.motorSonder.toString()' does not exist". Now I don't get this message postet above in the logfile but this one: Illegal Syntax for Set Operation

(24.02.2016 at 13:44) Gabriele Gabriele's gravatar image
Your answer
toggle preview

Follow this question

By Email:

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



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



Asked: 23.02.2016 at 09:47

Seen: 882 times

Last updated: 26.02.2016 at 08:42