I am trying to create clickable blocks of elements using p:selectOneRadio with layout="custom" to select one of given options. So each radio would be represented by a block of elements, all clickable (including space between components inside block).
The result in future should look like this:
Because I would like the entire block to be clickable, I use p:ouptutLabel as a container for clickable content with for attribute properly set.
I started with showcase example for p:selectOneRadio with layout="custom" and altered it a bit:
Code: Select all
<p:outputPanel id="customPanel" style="margin-bottom:10px">
<p:selectOneRadio id="customRadio" value="#{radioView.color}" layout="custom">
<f:selectItem itemLabel="Red" itemValue="Red" />
<f:selectItem itemLabel="Green" itemValue="Green" />
<f:selectItem itemLabel="Blue" itemValue="Blue" />
</p:selectOneRadio>
<p:outputLabel for="opt1">
<p:radioButton id="opt1" for="customRadio" itemIndex="0" />
<h:outputLabel value="Red" />
<p:spinner />
</p:outputLabel>
<p:outputLabel for="opt2">
<p:radioButton id="opt2" for="customRadio" itemIndex="1" />
<h:outputLabel value="Green" />
<p:inputText />
</p:outputLabel>
<p:outputLabel for="opt3">
<p:radioButton id="opt3" for="customRadio" itemIndex="2" />
<h:outputLabel value="Blue" />
<p:inputText />
</p:outputLabel>
</p:outputPanel>
Code: Select all
jquery.js?ln=primefaces&v=6.1.6:3 Uncaught SyntaxError: Invalid regular expression: /(^|\.)selectOneRadio(\.|$)/: Stack overflow
at RegExp.test (<anonymous>)
at HTMLDivElement.dispatch (jquery.js?ln=primefaces&v=6.1.6:3)
at HTMLDivElement.r.handle (jquery.js?ln=primefaces&v=6.1.6:3)
at Object.trigger (jquery.js?ln=primefaces&v=6.1.6:4)
at HTMLDivElement.<anonymous> (jquery.js?ln=primefaces&v=6.1.6:4)
at Function.each (jquery.js?ln=primefaces&v=6.1.6:2)
at n.fn.init.each (jquery.js?ln=primefaces&v=6.1.6:2)
at n.fn.init.trigger (jquery.js?ln=primefaces&v=6.1.6:4)
at HTMLLabelElement.<anonymous> (components.js?ln=primefaces&v=6.1.6:17)
at HTMLLabelElement.dispatch (jquery.js?ln=primefaces&v=6.1.6:3)
Am I doing something wrong or is there any bug in Primefaces javascript?
Thanks in advance for your time!
Martin