RichFaces 3.0.1 tree problem in Firefox???
ylazzari Jun 22, 2007 3:02 PMHi,
I'm experiencing a weird behaviour with the tree component in Firefox and I was wondering if someone else had the same problem. Assume the following tree definition:
<rich:tree switchType="client" value="#{patient}" var="treeNode" nodeFace="#{treeNode.class.simpleName}" preserveModel="none"> <f:facet name="icon"> <h:panelGroup> <h:selectBooleanCheckbox value="#{treeNode.selectedFlag}"/> <h:graphicImage url="/images/script.png"/> </h:panelGroup> </f:facet> <f:facet name="iconLeaf"> <h:panelGroup> <h:selectBooleanCheckbox value="#{treeNode.selectedFlag}"/> <h:graphicImage url="/images/pill.png"/> </h:panelGroup> </f:facet> <rich:treeNode type="Prescription" nodeClass="tree-node-prescription"> <h:outputText value="#{treeNode.formattedCreationTimestamp} (#{treeNode.no})"/> </rich:treeNode> <rich:treeNode type="PrescribedDrug"> <h:panelGroup> <h:panelGrid> <h:panelGroup> <h:outputText value="#{treeNode.drug.name}" styleClass="drug-name"/> <h:outputText value=" [Sample]" rendered="#{treeNode.sampleFlag}"/> </h:panelGroup> <h:panelGroup> <ol class="drug-detail"> <li><h:outputText value="#{treeNode.drug.form} - #{treeNode.drug.strength}"/></li> <li><h:outputText value="#{treeNode.fullPosology}"/></li> <li> #<h:outputText value="#{treeNode.posology.quantity}"> <f:convertNumber minFractionDigits="2" maxFractionDigits="2"/> </h:outputText> <h:outputText value=" x#{treeNode.posology.duration} #{treeNode.posology.durationUnit.description}"/> <h:outputText value="s" rendered="#{treeNode.posology.duration > 1}"/> <h:outputText value=", No refill" rendered="#{treeNode.posology.refills == 0}"/> <h:outputText value=", 1 refill" rendered="#{treeNode.posology.refills == 1}"/> <h:outputText value=", #{treeNode.posology.refills} refills" rendered="#{treeNode.posology.refills > 1}"/> </li> <s:fragment rendered="#{not empty treeNode.indication1}"> <li> <h:outputText value="#{treeNode.indication1.description}"/> <h:outputText value=", #{treeNode.indication2.description}" rendered="#{treeNode.indication2 != null}"/> </li> </s:fragment> <s:fragment rendered="#{not empty treeNode.note}"> <li> <h:outputText value="Note: #{treeNode.note}"/> </li> </s:fragment> </ol> </h:panelGroup> </h:panelGrid> </h:panelGroup> </rich:treeNode> </rich:tree>
Basically, what we have here is a tree in which I placed a checkbox in front each node to allow the user to select elements from the tree. I want to be able to do something with the elements that are selected when the form is submitted. Very basic. Weird thing is, the checkbox is unclickable! I tried replacing it with an input of type text, and it is impossible to place the cursor inside the textbox by clicking in it (although it works if you navigate with the tab key). This only seems to be the case in Firefox. With Internet Explorer, it seems to work fine.
What's also weird is that I've compiled and deployed the tree example that comes with the RichFaces 3.0.1 source bundle and it seems to work fine in Firefox (the tree demo contains input textboxes inside the tree and they are clickable).
Did anyone ever experienced this problem or sees something wrong with the snippet that I provided?
Also, in the HTML that is generated by the tree component, I've noticed the following table row definition:
<tr id="j_id71:prescribingForm:j_id196:19:j_id201:mainRow" onclick=" return false;">
Notice the "return false" in the "onclick" event. Could that be it?
Thanks.