Framework JavaScript ACube V2.10.0
 

Classe ElementFormSelectMaster

Object
   |
   +--DefaultElementForm,DefaultHtmlSelect,DefaultLibelle,DefaultXML
         |
         +--ElementFormSelect
               |
               +--ElementFormSelectMaster

class ElementFormSelectMaster
extends ElementFormSelect


La classe «ElementFormSelectMaster» est une variante de l'élément liste déroulante enrichi d'un comportement Maître/Esclave. L'élément «ElementFormSelectMaster» se comporte en Maître vis à vis d'un ou plusieurs Esclaves de type dérivé de «DefaultElementForm». C'est à dire qu'un changement de valeur de l'élément Maître implique une régénération appropriée des éléments Esclaves.
L'élément «ElementFormSelectMaster» hérite de«ElementFormSelect» et peut mui-même contenir d'autres éléments de formulaires (esclaves).





Il s'agit d'un élément multi-values :

<ELEMENT>
    <LIBELLE>Pays (maitre):</LIBELLE>
    <OPTIONS>
        <OPTION>
            <LIBELLE>France</LIBELLE>
           <VALUE>FR</VALUE>
           <SELECTED>FALSE</SELECTED>
            <SLAVE>
               <LIBELLE>Villes francaises (esclave):</LIBELLE>
               <OPTIONS>
                   <OPTION>
                       <LIBELLE>Paris</LIBELLE>
                       <VALUE>1</VALUE>
                       <SELECTED>FALSE</SELECTED>
                   </OPTION>
                   <OPTION>
                      <LIBELLE>Lyon</LIBELLE>
                      <VALUE>2</VALUE>
                       <SELECTED>TRUE</SELECTED>
                    </OPTION>
                   <OPTION>
                       <LIBELLE>Marseille</LIBELLE>
                       <VALUE>3</VALUE>
                       <SELECTED>FALSE</SELECTED>
                   </OPTION>
               </OPTIONS>
            </SLAVE>
        </OPTION>
        <OPTION>
           <LIBELLE>England</LIBELLE>
            <VALUE>2</VALUE>
           <SELECTED>FALSE</SELECTED>
            <SLAVE>
               <LIBELLE>Villes anglaises (esclave):</LIBELLE>
               <OPTIONS>
                   <OPTION>
                      <LIBELLE>London</LIBELLE>
                      <VALUE>1</VALUE>
                      <SELECTED>FALSE</SELECTED>
                   </OPTION>
                   <OPTION>
                      <LIBELLE>Manchester</LIBELLE>
                      <VALUE>2</VALUE>
                      <SELECTED>TRUE</SELECTED>
                   </OPTION>
                   <OPTION>
                       <LIBELLE>Liverpool</LIBELLE>
                       <VALUE>3</VALUE>
                       <SELECTED>FALSE</SELECTED>
                   </OPTION>
               </OPTIONS>
            </SLAVE>
        </OPTION>
    </OPTIONS>
</ELEMENT>


Il est également possible d'utiliser les groupements d'options, réduisant ainsi la redondance des données pour des flux volumineux :
<PAGE>
    <!--  DESCRIPTION DUFORMULAIRE -->
    <FORMULAIRE>
        <ELEMENT>
           <LIBELLE>Zones:</LIBELLE>
           <OPTIONS>
               <OPTIONS_GRP>ZONES</OPTIONS_GRP>
           </OPTIONS>
        </ELEMENT>
    </FORMULAIRE>

    <!-- DESCRIPTION DES GROUPEMENTS DE DONNEES -->
    <DATA>
       <OPTIONS_GRP_DEF>
           <ID>EUR</ID>
          <TYPE_TRI>LIBELLE</TYPE_TRI>
           <VALUE_SELECTED>1</VALUE_SELECTED>
           <OPTIONS>
               <OPTION>
                 <LIBELLE>France</LIBELLE>
                 <VALUE>1</VALUE>
                   <SLAVE>
                     <LIBELLE>Villes :</LIBELLE>
                       <OPTIONS>                   
                             <OPTIONS_GRP>FR_VILLES</OPTIONS_GRP>
                        <OPTIONS>                  
                  </SLAVE>
              </OPTION>
              <OPTION>
                  <LIBELLE>Italie</LIBELLE>
                  <VALUE>2</VALUE>
               </OPTION>
              <OPTION>
                  <LIBELLE>Espagne</LIBELLE>
                 <VALUE>3</VALUE>
               </OPTION>
           </OPTIONS>
        </OPTIONS_GRP_DEF>

       <OPTIONS_GRP_DEF>
          <ID>FR_VILLES</ID>
           <TYPE_TRI>LIBELLE</TYPE_TRI>
          <VALUE_SELECTED>10</VALUE_SELECTED>
           <OPTIONS>
              <OPTION>
                 <LIBELLE>Paris</LIBELLE>
                  <VALUE>10</VALUE>
              </OPTION>
            </OPTIONS>
       </OPTIONS_GRP_DEF>

       <OPTIONS_GRP_DEF>
           <ID>AME</ID>
          <TYPE_TRI>LIBELLE</TYPE_TRI>
          <VALUE_SELECTED>4</VALUE_SELECTED>
            <OPTIONS>
              <OPTION>
                  <LIBELLE>Etats-unisd'amérique</LIBELLE>
                 <VALUE>4</VALUE>
              </OPTION>
              <OPTION>
                 <LIBELLE>Canada</LIBELLE>
                  <VALUE>5</VALUE>
              </OPTION>
               <OPTION>
                 <LIBELLE>Espagne</LIBELLE>
                  <VALUE>6</VALUE>
              </OPTION>
           </OPTIONS>
       </OPTIONS_GRP_DEF>

       <OPTIONS_GRP_DEF>
          <ID>ASIE</ID>
          <TYPE_TRI>LIBELLE</TYPE_TRI>
          <VALUE_SELECTED>8</VALUE_SELECTED>
           <OPTIONS>
              <OPTION>
                 <LIBELLE>Japon</LIBELLE>
                  <VALUE>7</VALUE>
              </OPTION>
               <OPTION>
                 <LIBELLE>Chine</LIBELLE>
                  <VALUE>8</VALUE>
              </OPTION>
              <OPTION>
                  <LIBELLE>Thailande</LIBELLE>
                 <VALUE>9</VALUE>
              </OPTION>
           </OPTIONS>
       </OPTIONS_GRP_DEF>

        <OPTIONS_GRP_DEF>
          <ID>MONDE</ID>
          <TYPE_TRI>LIBELLE</TYPE_TRI>
           <VALUE_SELECTED>11</VALUE_SELECTED>
           <OPTIONS>
              <OPTION>
                  <LIBELLE>Amérique dunord</LIBELLE>
                 <VALUE>11</VALUE>
                   <SLAVE>
                     <LIBELLE>Pays :</LIBELLE>
                        <OPTIONS>                  
                        <OPTIONS_GRP>AME</OPTIONS_GRP>
                        <OPTIONS>                   
                  </SLAVE>
              </OPTION>
              <OPTION>
                 <LIBELLE>Asie</LIBELLE>
                 <VALUE>12</VALUE>
                  <SLAVE>
                      <LIBELLE>Pays :</LIBELLE>
                        <OPTIONS>                  
                        <OPTIONS_GRP>ASIE</OPTIONS_GRP>
                       <OPTIONS>                  
                  </SLAVE>
              </OPTION>
              <OPTION>
                 <LIBELLE>Europe</LIBELLE>
                 <VALUE>13</VALUE>
                   <SLAVE>
                     <LIBELLE>Pays :</LIBELLE>
                        <OPTIONS>                  
                         <OPTIONS_GRP>EUR</OPTIONS_GRP>
                        <OPTIONS>                   
                  </SLAVE>
              </OPTION>
           </OPTIONS>
       </OPTIONS_GRP_DEF>

       <OPTIONS_GRP_DEF>
           <ID>ZONES</ID>
          <TYPE_TRI>LIBELLE</TYPE_TRI>
           <VALUE_SELECTED/>
           <OPTIONS>
              <OPTIONS_GRP>MONDE</OPTIONS_GRP>
           </OPTIONS>
        </OPTIONS_GRP_DEF>
    </DATA>
</PAGE>


Exemple d'utilisation du composant ElementFormSelectMaster avec la gestion des regroupements de données.


RENDU IHM
renduIHM
Cette classe reprend toutes les propriétés privées et publiques héritées.
Cette classe reprend toutes les méthodes privées et publiques héritées.
Elle reprend toutes les méthodes héritées de «ElementFormSelect».
Date: 25/10/2005

Version: 1.1

Definie dans ergonomique/fw_formulaire_element.js

Fichiers JS nécessaires:


Sommaire des Attributs
 Object setValue_Parent
          La méthode publique «setValue(NewValue)» permet de spécifier la valeur de l'élément.
<private>  {Array_DefaultElementForm} tabEsclave
          Attribut «tabEsclave» de ElementFormSelectMaster, définissant le tableau des éléments Esclave.
<private>  {Array_XMLObjectSauvegarde} tabOptionsGrp
          Attribut «tabOptionsGrp» de ElementFormSelectMaster, qui contient les groupements d'options déjà calculés à partir des éléments définis dans xmlOptionsGrpDef.
<private>  {XMLObjectSauvegarde} xmlOptionsGrpDef
          Attribut «xmlOptionsGrpDef» de ElementFormSelectMaster, qui représente le flux XML définissant les éléments utilisés dans xmlData (groupement d'options).
   
Attributs hérités de la classeElementFormSelect
width, elementFormToChange
   
Attributs hérités de la classeDefaultElementForm
readonly, disabled, id, value, statut, reference, onChange, check, onblur, formParent, ongletParent, zoneData, urlAide, altAide, lienAide, urlAssist, altAssist, bulleInfo, posBulleInfo, displayStyle, emptyDisplayStyle, onMouseOut, onMouseOver, onMouseMove, onMouseMoveBoutonAide, divBind, onfocus
   
Attributs hérités de la classeDefaultHtmlSelect
disabled, multiple, size
   
Attributs hérités de la classeDefaultLibelle
libelle, obligatoire, codeObligatoire, divLibelleBind
   
Attributs hérités de la classeDefaultHtml
id, style, title, name, tabindex
 
Sommaire des Constructeurs
ElementFormSelectMaster (<String_Obligatoire> id, <XMLObjectSauvegarde_Facultatif> xmlData, <ObjectOption_Facultatif> tabOption, <int_Facultatif> size, <int_Facultatif> width, <String_Facultatif> libelle, <Boolean_Facultatif> obligatoire, <String_Facultatif> multiple, <Boolean_Facultatif> statut, <int_Facultatif> tabindex)
            Crée une instance de la classe «ElementFormSelectMaster»
Voir Exemple d'instanciation javascript de 2 listes déroulantes avec comportement maître/esclave : Exemples d'appels aux constructeurs.
 
Sommaire des Méthodes
 void addEsclave(<DefaultElementForm_Obligatoire> newEsclave)
           Spécifique à la classe ElementFormSelectMaster - La méthode publique «addEsclave» ajoute un élément Esclave.
 <private>  XMLObjectSauvegarde appliqueOptionsGrpDef(<ObjectNode_Obligatoire> nodeOptions)
           Spécifique à la classe ElementFormSelectMaster - La méthode privée «appliquerOptionsGrpDef» est déclenchée lors de la construction de l'objet s'il existe un flux de définition des éléments (groupement d'options).
 <private>  XMLObjectSauvegarde calculeOptionsGrp(<String_Obligatoire> id, <XMLObjectSauvegarde_Obligatoire> xmlData)
           Spécifique à la classe ElementFormSelectMaster - La méthode privée «calculerOptionsGrp» calcul le rendu d'un élément d'id id, à partir d'éléments (xmlData).
 <private>  void ecrireEsclaveBind()
           Spécifique à la classe ElementFormSelectMaster - La méthode privée «ecrireEsclaveBind» génère les éléments Esclaves.
 Object extend_ElementFormSelect(<String_Obligatoire> id, <XMLObjectSauvegarde_Facultatif> xmlData, <ObjectOption_Facultatif> tabOption, <int_Facultatif> size, <int_Facultatif> width, <String_Facultatif> libelle, <Boolean_Facultatif> obligatoire, <String_Facultatif> multiple, <Boolean_Facultatif> statut, <int_Facultatif> tabindex, <String_Facultatif> displaycss, <String_Facultatif> emptydisplaycss)
           Crée une instance de la classe «ElementFormSelect»
Voir Exemple d'instanciation de la classe ElementFormSelect : Exemples d'appels aux constructeurs.
 <private>  void onChange()
           Spécifique à la classe ElementFormSelectMaster - La méthode privée «onChange» est déclenchée sur l'évènement html "onchange" de la liste déroulante.
 void setValue(newValue)
           This method set the value
 <private>  XMLObjectSauvegarde trierOptionsGrp(<XMLObjectSauvegarde_Obligatoire> nodeOptions, <String_Obligatoire> typeTri, <String_Obligatoire> idSelected)
           Spécifique à la classe ElementFormSelectMaster - La méthode privée «trierOptionsGrp» trie les éléments
 
Méthodes héritées de la classe ElementFormSelect
extend_DefaultHtmlSelect, extend_DefaultElementForm, extend_DefaultLibelle, extend_DefaultXml, setLargeur, getLargeur, setElementFormToChange, getElementFormToChange, setMultiple, getValues, getValueLibelle, getTabOption, setValues, setValue, ecrireOptionHtml, ecrireBoiteHtml
   
Méthodes héritées de la classe DefaultElementForm
newId, formatValue, setFormatValue, setAltAide, geturlAide, seturlAide, setAltAssist, geturlAssist, seturlAssist, getOngletParent, setOngletParent, getZoneData, setZoneData, getDomHtmlElement, getValue, setValue, getTabOption, setTabOption, setBulleInfo, setDisplayStyle, getDisplayStyle, setEmptyDisplayStyle, getEmptyDisplayStyle, getDivBind, setDivBind, ouvrirAide, ouvrirAssistant, ecrireAideHtml, setPositionBulleInfo, ecrireAssistHtml, ecrireBind, ecrireHtml, setStatut, setOnChange, setOnblur, setOnfocus, initReference, addOption, changeOption, removeOption, ecrireCellHtml
   
Méthodes héritées de la classe DefaultHtmlSelect
extend_DefaultHtml
   
Méthodes héritées de la classe DefaultLibelle
getDivLibelleBind, setDivLibelleBind, getLibelle, ecrireLibelleHtml
   
Méthodes héritées de la classe DefaultHtml
newId, setTitle, getTitle, getId, setStyle, getStyle
 

Détail des Attributs

setValue_Parent

Object setValue_Parent

tabEsclave

<private> {Array_DefaultElementForm} tabEsclave

tabOptionsGrp

<private> {Array_XMLObjectSauvegarde} tabOptionsGrp

xmlOptionsGrpDef

<private> {XMLObjectSauvegarde} xmlOptionsGrpDef

Détail des Constructeurs

ElementFormSelectMaster

ElementFormSelectMaster(<String_Obligatoire> id, <XMLObjectSauvegarde_Facultatif> xmlData, <ObjectOption_Facultatif> tabOption, <int_Facultatif> size, <int_Facultatif> width, <String_Facultatif> libelle, <Boolean_Facultatif> obligatoire, <String_Facultatif> multiple, <Boolean_Facultatif> statut, <int_Facultatif> tabindex)

Détail des Méthodes

addEsclave

void addEsclave(<DefaultElementForm_Obligatoire> newEsclave)

appliqueOptionsGrpDef

 <private> XMLObjectSauvegarde appliqueOptionsGrpDef(<ObjectNode_Obligatoire> nodeOptions)

calculeOptionsGrp

 <private> XMLObjectSauvegarde calculeOptionsGrp(<String_Obligatoire> id, <XMLObjectSauvegarde_Obligatoire> xmlData)

ecrireEsclaveBind

 <private> void ecrireEsclaveBind()

extend_ElementFormSelect

Object extend_ElementFormSelect(<String_Obligatoire> id, <XMLObjectSauvegarde_Facultatif> xmlData, <ObjectOption_Facultatif> tabOption, <int_Facultatif> size, <int_Facultatif> width, <String_Facultatif> libelle, <Boolean_Facultatif> obligatoire, <String_Facultatif> multiple, <Boolean_Facultatif> statut, <int_Facultatif> tabindex, <String_Facultatif> displaycss, <String_Facultatif> emptydisplaycss)

onChange

 <private> void onChange()

setValue

void setValue(newValue)

trierOptionsGrp

 <private> XMLObjectSauvegarde trierOptionsGrp(<XMLObjectSauvegarde_Obligatoire> nodeOptions, <String_Obligatoire> typeTri, <String_Obligatoire> idSelected)

Framework JavaScript ACube V2.10.0
 

Version 2.10.0, / Etat : Validé
Cette création est mise à disposition selon le Contrat Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique disponible en ligne http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ ou par courrier postal à Creative Commons, 559 Nathan Abbott Way, Stanford,California 94305, USA.


Documentation generated by JSDoc on Wed Jan 6 17:05:02 2010