autoComplete label not working

UI Components for JSF
Post Reply
Meat66
Posts: 2
Joined: 04 May 2022, 20:56

04 May 2022, 23:10

I cannot get the label to display for an autoComplete field (label="Something"). Is that supposed to work the same as the JSF forms autocomplete and produce a text label associated with the input field?

My example:

Code: Select all

<p:autoComplete id="groups"
                    label="Groups"
                    value="#{bean.groups}" 
                    completeMethod="#{bean.suggestGroups}"
                    multiple="true" />
I get the same result in 8.0 and 11.0.0.

Has anyone else run into these labels not displaying?

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

05 May 2022, 15:55

I don't know why its in the docs `label` is not used at all in AutoComplete. What are you trying to accomplish?
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Meat66
Posts: 2
Joined: 04 May 2022, 20:56

11 May 2022, 23:38

I was trying to put a label next to the field, just like an <outputLabel for="" /> works. The JSF autocomplete tag has that and since I saw it in the PF API doc I expected it to work the same, but I guess not! Nothing complained about an invalid attribute, either, so I've been really confused as to why it just doesn't show up... I'll just have to use the oubputLabel, then, if it's not supported.

DazzlingBob
Posts: 11
Joined: 07 Mar 2019, 15:20

12 May 2022, 14:45

The label property of <p:autoComplete> is most likely only for displaying in a JSF error message.
Same as <h:inputText> and the message javax.faces.component.UIInput.REQUIRED.

Code: Select all

    <div class="p-field">
        <p:outputLabel>Please enter a value</p:outputLabel>
        <h:inputText value="{bean.value}" label="value" required="true" />
    </div>

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 30 guests