I want to implement mailto:
link in jsf on selected option in selectOneMenu(dropdown list)
how can i implement this ?
I want to implement mailto:
link in jsf on selected option in selectOneMenu(dropdown list)
how can i implement this ?
So you want to end up with something like
<select>
<option><a href="mailto:[email protected]">link</a></option>
</select>
?
That's already not possible in HTML, so JSF can't do much for you here. Your best bet is to mimic a dropdown with <div><ul><li>
and a good shot of JavaScript and CSS.
Alternatively, if you can live with non-styleable dropdown options (you can for example not color or underline them, so that they look like links), you can also just add a little shot of JS to achieve your needs.
<h:selectOneMenu onchange="var link = this.options[this.selectedIndex].value; if (link) window.location = link;">
<f:selectItem itemLabel="Please select" itemValue="null" />
<f:selectItems value="#{bean.mailLinks}" />
</h:selectOneMenu>
Assuming that the item values are already strings with the mailto:[email protected]
values.