how to add tooltip for selectItems tag in JSF [duplicate] - jsf

This question already has answers here:
How to add tooltip to f:selectItems
(2 answers)
Closed 6 years ago.
<h:selectOneMenu id="sType"value="#{sBean.sCriteria.sType}" style="width:200px;" styleClass="black" onchange="sTypeChanged();">
<f:selectItems value="#{sBean.allSTypes}" />
</h:selectOneMenu>
I am using the above code in my xhtml file.
I want to add "tool tip" in my selectOneMenu tag.
How can I do this?

Please look at this question hope ot helps
How to add tooltip to f:selectItems
Try ans use the title attributes best thing will be to bind the title in a map in the backing bean and use it here dynamically

Use the title attribute of selectOneMenu
<h:selectOneMenu id="sType"
title="tooltip_goes_here"
...
http://docs.oracle.com/javaee/5/javaserverfaces/1.2/docs/tlddocs/h/selectOneMenu.html

Related

How I can use a converter in a JSF tag selectOneMenu? [duplicate]

This question already has answers here:
How to populate options of h:selectOneMenu from database?
(5 answers)
Closed 4 years ago.
The following example works in my interface:
<h:outputText value="#{diplome.pays}">
<gn:converter origine="#{config.origManSirhen}"
nomenclature="#{config.codePays}"
propriete="libelleImpression" />
</h:outputText>
However, when I try to use the same converter does not work when the element is a selectOneMenu
<p:selectOneMenu id="pays">
<f:selectItem
itemValue="#{InformationsPersonnellesModele.adressePrincipale.pays}"
itemLabel="#{InformationsPersonnellesModele.adressePrincipale.pays}" />
<gn:converter origine="#{config.origManSirhen}"
nomenclature="#{config.codePays}" propriete="libelleImpression" />
</p:selectOneMenu>
I have tried to use the attribute converter into the selectOneMenu tag, but it does not work as I expect because I need to use as well the parameter nomenclature and propiete.
I found a possible solution:
The item selected by default must be the value of the selectOneMenu tag.
And the list of items and the converter are directly assigned to the value of the selectItems tag.
<p:selectOneMenu id="pays"
value="#{InformationsPersonnellesModele.adressePrincipale.pays}">
<f:selectItems
value="#{gnl:listeTri(config.origManSirhen, config.codePays,'libelleImpression')}" />
</p:selectOneMenu>

How can I reset PrimeFaces tabs [duplicate]

This question already has answers here:
Reset input fields in primefaces
(5 answers)
Clear JSF form input values after submitting
(5 answers)
Closed 6 years ago.
I have A PrimeFaces wizard each tab contains InputText fields or SelectOneMenu menus ... how could I reset all fields and menus in all tabs on submit button ??
I'm using primefaces 5.3
thank you
PrimeFaces has a component for clientside resets
<p:commandButton value="Reset Tag" update="#form" process="#form" style="margin-right:20px;" >
<p:resetInput target="***idFromYourTag***" />
</p:commandButton>
If you need reset the backing bean values, you need to write a method.
See also ResetInput

How can I add JSF code to xhtml in the attribute id? [duplicate]

This question already has answers here:
How to dynamically generate id in dataTable using ui:repeat tag
(4 answers)
How to use EL with <ui:repeat var> in id attribute of a JSF component
(1 answer)
Closed 6 years ago.
I am working with JSF 2.2 and I would like use JSF variables in the id attribute for to send individuals petitions for each list's element.
For example:
<ui:repeat value="#{bean.numbers}" var="number">
<h:inputText id="text#{number}"/>
</ui:repeat>
Thank you

How do I add an image value to h:commandlink? [duplicate]

This question already has an answer here:
How to put image instead of text in h:commandLink value
(1 answer)
Closed 7 years ago.
Can someone please tell me how I would add an image value to this code instead of a text value?
<h:commandLink
action="#{gridHandlerXml.removeLinesFromGroups}"
render="quote-table, totalPanel, revisionTabs" execute="#this"
disabled="#{currentQuote.convertInProgress}"
onclick="#{rich:component('fcprocessing:processingpopup')}.show()"
oncomplete="#{rich:component('fcprocessing:processingpopup')}.hide()" />
Quite straightforward: Just embed an an h:graphicImage in the command link:
<h:commandLink action="#{gridHandlerXml.removeLinesFromGroups}">
<h:graphicImage url="resources/path/to/your/image"/>
</h:commandLink>

Conversion Error setting value '1' for 'null Converter' [duplicate]

This question already has answers here:
How to populate options of h:selectOneMenu from database?
(5 answers)
Closed 7 years ago.
When I click submit button in a jsf page I get the above error.
html:
<h:selectOneMenu id="ddlCountryCode" value="#{jsfFills.countries}">
<f:selectItems value="#{jsfFills.countries}" var="c"
itemLabel="#{c.CName}" itemValue="#{c.CCode}" />
</h:selectOneMenu>
The "value" attribute should point to a variable where you want to store the selected value of the component, not the list of choices.
In the example above, jsfFills.countries is used as both the list of options AND the value of the component, and that could be causing the issue. We'd want to create a variable in a bean somewhere and use that instead.
<h:selectOneMenu id="ddlCountryCode" value="#{jsfFills.selectedCountry}">
<f:selectItems value="#{jsfFills.countries}" var="c"
itemLabel="#{c.CName}" itemValue="#{c.CCode}" />
</h:selectOneMenu>

Resources