Hello,
I'm new to this forum.
I'm looking for a solution for custom content in an autocomplete selection.
The user searches for something like: "123"
and gets suggestions with some additional information in brackets:
1234 (some infos)
1238 (some other infos)
1239 (some additional infos)
If the user chooses "1234 (some infos)" then in the input field is only written "1234". Because "1234" ist the key.
I found a solution by using custom content with one column.
But using custom content with columns changes the look of the suggestions dropdown.
Is there a better solution?
AutoComplete custom content without columns
-
- Posts: 69
- Joined: 02 Jun 2013, 18:37
Are you using the itemLabel attribute?
PF 5.0
PF Ext 0.7.1
OmniFaces 1.7
Tomcat 7.0.37
JSF 2.1.24
PF Ext 0.7.1
OmniFaces 1.7
Tomcat 7.0.37
JSF 2.1.24
thanks for your input.
Yes, I use itemLabel. But when I use itemLabel without a custom content column is it in the end the same in the input-box and in the suggestions-list.
At the moment I use one custom content column:
But I don't want any table.
What I need is close to the itemtip functionality. But I don't want an extra itemtip pop-up. I want the information in the suggestions-list.
Yes, I use itemLabel. But when I use itemLabel without a custom content column is it in the end the same in the input-box and in the suggestions-list.
At the moment I use one custom content column:
Code: Select all
<p:autoComplete ... var="item" itemLabel="#{item.searchText}" itemValue="#{item}" converter="..." emptyMessage="...">
<p:column>
<h:outputText value="#{item.searchText}" /> (<h:outputText value="#{item.additionalText}" />)
</p:column>
</p:autoComplete>
What I need is close to the itemtip functionality. But I don't want an extra itemtip pop-up. I want the information in the suggestions-list.
PF 5.3, JSF 2.1
Yes, restyling the suggestions dropdown is a logic step.
But I decided to override the AutoCompleteRenderer. The advantage of overriding the renderer is, that the autocomplete character highlighting still works.
Would be nice if PF would add a suggestion facet... for layouting the suggestions.
So this thread is solved.
But I decided to override the AutoCompleteRenderer. The advantage of overriding the renderer is, that the autocomplete character highlighting still works.
Would be nice if PF would add a suggestion facet... for layouting the suggestions.
So this thread is solved.
PF 5.3, JSF 2.1
-
- Posts: 69
- Joined: 02 Jun 2013, 18:37
I've run into the same issue. I dicovered that &'s would be rendered as "&". So, after reviewing the source and finding the cause of the issue (something about CDATA in the ResponseWriter, IIRC), I added <p:column /> as a child which killed the bolding.
PF 5.0
PF Ext 0.7.1
OmniFaces 1.7
Tomcat 7.0.37
JSF 2.1.24
PF Ext 0.7.1
OmniFaces 1.7
Tomcat 7.0.37
JSF 2.1.24
-
- Information
-
Who is online
Users browsing this forum: No registered users and 40 guests