incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Graeme Steyn" <g.st...@cqu.edu.au>
Subject SelectOneRadio Query: Can dynamic help text be displayed for each select option when the user hovers over the description?
Date Wed, 10 Jan 2007 06:18:24 GMT
Good Afternoon,
 
Please can I ask for some assistance with the following query:
 
I would like to be able to use a tr:selectOneRadio component for
selecting from a list of options.  I would also like to be able to
display assistance for individual options in a definitions box within
the page when the user hovers over the item description.  I am trying to
provide the user with help information without them making a selection.
For example:
 
Option group 1:
* Option 1
* Option 2
* Option 3
Option group 2:
* Option 4
* Option 5
 
-----------------------------------
Definitions:
 
Only display the definition for the option that the user is currently
hovering over.
 
____________________
 
 
But I do not think this can be done with the standard component.  Is
there another component that can be used or a work-around that would
work.  For example, the current xhtml has the following javascript:
 
function DisplayDefn(defn) {
  obj=document.getElementById(defn);
  obj.style.display="block";
}
 
function HideDefn(defn) {
  obj=document.getElementById(defn);
  obj.style.display="none";
 
The CSS definition used is:
 
.defn {
 display: none
}
 
And the following code snippet:
 
:
:
 
            <tr:selectOneRadio
              id="questions"
              layout="pageDirection"
              label="#{bundle.startApplicationType}"
              required="true"
              value="#{visit.admissionAppType}"
              onmouseover="DisplayDefn('ugrdHon');"
              onmouseout="HideDefn('ugrdHon');"
              shortDesc="Short Description">
              <f:facet name="help">
                <tr:outputText value="Help Text" />
              </f:facet>
              <tr:selectItem value="#{selectItems.eligibleQuestions}" />
              <tr:selectItem value="#{selectItems.ineligibleQuestions}"
/>
            </tr:selectOneRadio>

:
:
 
   <div id="ugrdHon" class="defn">
            <h3>Honours</h3>
  
            <p>Honours is a program of study for high achieving
            students who have completed an undergraduate degree with a
GPA
            usually of 5.0 or above, to develop advanced knowledge in
            specialist areas and research skill.</p>
          </div>
 
          <div id="grdEntry" class="defn">
            <h3>Graduate Entry</h3>
  
            <p>Graduate Entry Program is a program of study where the
            prerequisite for entry is the previous completion of an
            undergraduate degree.</p>
          </div>

:
:
 
The idea being that the mouseover and mouseout events will show and hide
the corresponding definition - which obviously does not work in this
case as the same definition is displayed for all cases.  Is there a way
of being able to associate the mouseover and mouseout events with the
individual selectItems using dynamic parameters for the javascript?
 
The other part of the problem is the ability to display the option
groups, which can be done using the standard <h:selectOneRadio> tag (not
sure if it can be done with Trinidad) 
 
            <h:selectOneRadio
              id="questions"
              layout="pageDirection"
              label="#{bundle.startApplicationType}"
              required="true"
              value="#{visit.admissionAppType}"
              onmouseover="DisplayDefn('pgrdCrse');"
              onmouseout="HideDefn('pgrdCrse');">
              <f:selectItem value="#{selectItems.eligibleQuestions}" />
              <f:selectItem value="#{selectItems.ineligibleQuestions}"
/>
            </h:selectOneRadio>

 
 
and the bean definitions below:
 
<managed-bean>
  <description>SelectItemGroup of eligible online application question
values for 
            injection into a SelectItems.</description>
  <managed-bean-name>eligibleQuestions</managed-bean-name>
 
<managed-bean-class>javax.faces.model.SelectItemGroup</managed-bean-clas
s>
  <managed-bean-scope>none</managed-bean-scope>
  <managed-property>
   <property-name>value</property-name>
   <property-class>java.lang.String</property-class>
   <value>GRP1</value>
  </managed-property>
  <managed-property>
   <property-name>label</property-name>
   <property-class>java.lang.String</property-class>
   <value>I wish to study a program at a campus in Australia or via
Flexible
              Learning and:</value>
  </managed-property>
  <managed-property>
   <property-name>selectItems</property-name>
   <list-entries>
    <value-class>javax.faces.model.SelectItem</value-class>
    <value>#{eligibleToApplyOnlineQ1}</value>
    <value>#{eligibleToApplyOnlineQ2}</value>
    <value>#{eligibleToApplyOnlineQ3}</value>
    <value>#{eligibleToApplyOnlineQ4}</value>
   </list-entries>
  </managed-property>
 </managed-bean>
 <managed-bean>
  <description>SelectItemGroup of ineligible online application question
values for 
            injection into a SelectItems.</description>
  <managed-bean-name>ineligibleQuestions</managed-bean-name>
 
<managed-bean-class>javax.faces.model.SelectItemGroup</managed-bean-clas
s>
  <managed-bean-scope>none</managed-bean-scope>
  <managed-property>
   <property-name>value</property-name>
   <property-class>java.lang.String</property-class>
   <value>GRP2</value>
  </managed-property>
  <managed-property>
   <property-name>label</property-name>
   <property-class>java.lang.String</property-class>
   <value>I wish to study a program at a location not in Australia 
            or I am making an application of the type listed
below:</value>
  </managed-property>
  <managed-property>
   <property-name>selectItems</property-name>
   <list-entries>
    <value-class>javax.faces.model.SelectItem</value-class>
    <value>#{ineligibleToApplyOnlineQ1}</value>
    <value>#{ineligibleToApplyOnlineQ2}</value>
    <value>#{ineligibleToApplyOnlineQ3}</value>
    <value>#{ineligibleToApplyOnlineQ4}</value>
    <value>#{ineligibleToApplyOnlineQ5}</value>
    <value>#{ineligibleToApplyOnlineQ6}</value>
    <value>#{ineligibleToApplyOnlineQ7}</value>
   </list-entries>
  </managed-property>
 </managed-bean>
 
 
Thank you.
 
Regards,
 
Graeme.
 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message