IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

XMLRAD Discussion :

ListFooter : Contraignant...


Sujet :

XMLRAD

  1. #1
    Membre expérimenté

    Profil pro
    Inscrit en
    Mars 2002
    Messages
    520
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2002
    Messages : 520
    Points : 1 446
    Points
    1 446
    Par défaut ListFooter : Contraignant...
    Bonjour,

    J'avais un problème de navigation avec le Pager de listes et en scrutant les sources xsl du framework, je me suis rendu compte d'une contrainte assez pénalisante.
    Le pager actuel d'XMLRAD utilise un champ caché de formulaire (xxx_STARTINGROW) pour indiquer au framework à partir de quel enregistrement il doit "fetcher" le SGBD.
    Le problème est que le nom du dit formulaire est imposé : Il s'agit de 'MainForm'. Ca m'arrange pas du tout car j'utilise un autre nom de formulaire (sachant qu'il y a plusieurs formulaires dans ma page : Insertxxx, Updatexxx, Deletexxx etc et que je ne souhaite pas changer le nom de ces formulaires).
    Alors j'ai cherché dans les sources un paramètre de <xsl:template name="xslc:NavigationPad"> dans lequel j'aurais pu indiquer le nom du formulaire prenant en charge le Paging.
    Peine perdue puisque 'MainForm' est imposé en dur par le framework :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <xsl:attribute name="onclick"><![CDATA[SetField('MainForm', ']]><xsl:value-of select="@RecordName"/><![CDATA[_StartingRow', ']]><xsl:value-of select="$DoubleStepBack"/><![CDATA['); ]]><xsl:value-of select="$OnClick"/><![CDATA[return false;]]></xsl:attribute>
    Je vais modifier les sources de xslc.xsl mais si Delos pouvait prendre en compte un nouveau paramètre qui résoudrait la question, ça serait plus confortable.

    Sylvain

  2. #2
    Membre expérimenté

    Profil pro
    Inscrit en
    Mars 2002
    Messages
    520
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2002
    Messages : 520
    Points : 1 446
    Points
    1 446
    Par défaut
    Je propose un add-on à xslc.xsl pour résoudre le problème, afin de pouvoir appeler le Pager ainsi :

    <xsl:call-template name="xslc:ListFooter">
    <xsl:with-param name="colspan">9</xsl:with-param>
    <xsl:with-param name="Form">FormInsertPARTICIPATION</xsl:with-param>
    <xsl:with-param name="OnClick">document.FormInsertPARTICIPATION.submit();</xsl:with-param>
    </xsl:call-template>

    Le correctif (en gras) :

    <xsl:template name="xslc:NavigationPad">
    <xsl:param name="Form"/>
    <xsl:param name="CommonURL">
    <xsl:value-of select="/document/XMLC_Params/XMLC_ScriptName"/>/<xsl:value-of select="/document/XMLC_Params/XMLC_Action"/>?<xsl:if test="/document/XMLC_Params/XMLC_NavigationParams!=''">
    <xsl:value-of select="/document/XMLC_Params/XMLC_NavigationParams"/>&amp;</xsl:if>
    <xsl:value-of select="@RecordName"/>_StartingRow=</xsl:param>
    <xsl:param name="URLParams"/>
    <xsl:param name="OnClick"/>
    <xsl:param name="DisplayPreviousArrows">1</xsl:param>
    <xsl:param name="DisplayNextArrows">1</xsl:param>
    <xsl:param name="StartingRow" select="@StartingRow"/>
    <xsl:param name="EOF" select="@EOF"/>
    <table border="0" cellpadding="0" cellspacing="0">
    <tr>
    <xsl:if test="$DisplayPreviousArrows = '1' and $StartingRow != '0'">
    <xsl:variable name="DoubleStepBack">
    <xsl:choose>
    <xsl:when test="(@StartingRow)-(2*@MaxRows)+2>0">
    <xsl:value-of select="(@StartingRow)-(2*@MaxRows)+2"/>
    </xsl:when>
    <xsl:otherwise>0</xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    <xsl:variable name="StepBack">
    <xsl:choose>
    <xsl:when test="(@StartingRow)-(@MaxRows)+1>0">
    <xsl:value-of select="(@StartingRow)-(@MaxRows)+1"/>
    </xsl:when>
    <xsl:otherwise>0</xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    <td style="border: 0px; padding-right: 5px;">
    <a>
    <xsl:choose>
    <xsl:when test="$OnClick != ''">
    <xsl:attribute name="href">.</xsl:attribute>
    <xsl:attribute name="onclick"><![CDATA[SetField(']]><xsl:value-of select="$Form"/><![CDATA[', ']]><xsl:value-of select="@RecordName"/><![CDATA[_StartingRow', ']]><xsl:value-of select="$DoubleStepBack"/><![CDATA['); ]]><xsl:value-of select="$OnClick"/><![CDATA[return false;]]></xsl:attribute>
    </xsl:when>
    <xsl:otherwise>
    <xsl:attribute name="href"><xsl:value-of select="$CommonURL"/><xsl:value-of select="$DoubleStepBack"/><xsl:value-of select="$URLParams"/></xsl:attribute>
    </xsl:otherwise>
    </xsl:choose>
    <img alt="{/document/Locales/DoublePrevious}" border="0" src="{$XMLC_PictosPath}ico_stepdouble_left.gif"/>
    </a>
    </td>
    <td style="border: 0px; padding-right: 5px;">
    <a>
    <xsl:choose>
    <xsl:when test="$OnClick != ''">
    <xsl:attribute name="href">.</xsl:attribute>
    <xsl:attribute name="onclick"><![CDATA[SetField(']]><xsl:value-of select="$Form"/><![CDATA[', ']]><xsl:value-of select="@RecordName"/><![CDATA[_StartingRow', ']]><xsl:value-of select="$StepBack"/><![CDATA['); ]]><xsl:value-of select="$OnClick"/><![CDATA[return false;]]></xsl:attribute>
    </xsl:when>
    <xsl:otherwise>
    <xsl:attribute name="href"><xsl:value-of select="$CommonURL"/><xsl:value-of select="$StepBack"/><xsl:value-of select="$URLParams"/></xsl:attribute>
    </xsl:otherwise>
    </xsl:choose>
    <img alt="{/document/Locales/Previous}" border="0" src="{$XMLC_PictosPath}ico_step_left.gif"/>
    </a>
    </td>
    </xsl:if>
    <xsl:if test="$DisplayNextArrows = '1' and $EOF != '1'">
    <xsl:variable name="DoubleStepForward">
    <xsl:value-of select="(@LastRow)+(@MaxRows)-1"/>
    </xsl:variable>
    <td style="border: 0px; padding-right: 5px;">
    <a>
    <xsl:choose>
    <xsl:when test="$OnClick != ''">
    <xsl:attribute name="href">.</xsl:attribute>
    <xsl:attribute name="onclick"><![CDATA[SetField(']]><xsl:value-of select="$Form"/><![CDATA[', ']]><xsl:value-of select="@RecordName"/><![CDATA[_StartingRow', ']]><xsl:value-of select="@LastRow"/><![CDATA['); ]]><xsl:value-of select="$OnClick"/><![CDATA[return false;]]></xsl:attribute>
    </xsl:when>
    <xsl:otherwise>
    <xsl:attribute name="href"><xsl:value-of select="$CommonURL"/><xsl:value-of select="@LastRow"/><xsl:value-of select="$URLParams"/></xsl:attribute>
    </xsl:otherwise>
    </xsl:choose>
    <img alt="{/document/Locales/More}" border="0" src="{$XMLC_PictosPath}ico_step_right.gif"/>
    </a>
    </td>
    <td style="border: 0px; padding-right: 5px;">
    <a>
    <xsl:choose>
    <xsl:when test="$OnClick != ''">
    <xsl:attribute name="href">.</xsl:attribute>
    <xsl:attribute name="onclick"><![CDATA[SetField(']]><xsl:value-of select="$Form"/><![CDATA[', ']]><xsl:value-of select="@RecordName"/><![CDATA[_StartingRow', ']]><xsl:value-of select="$DoubleStepForward"/><![CDATA['); ]]><xsl:value-of select="$OnClick"/><![CDATA[return false;]]></xsl:attribute>
    </xsl:when>
    <xsl:otherwise>
    <xsl:attribute name="href"><xsl:value-of select="$CommonURL"/><xsl:value-of select="$DoubleStepForward"/><xsl:value-of select="$URLParams"/></xsl:attribute>
    </xsl:otherwise>
    </xsl:choose>
    <img alt="{/document/Locales/DoubleMore}" border="0" src="{$XMLC_PictosPath}ico_stepdouble_right.gif"/>
    </a>
    </td>
    </xsl:if>
    </tr>
    </table>
    </xsl:template>
    <xsl:template name="xslc:IndexNavigation">
    <xsl:param name="Form"/>
    <xsl:param name="CommonURL">
    <xsl:value-of select="/document/XMLC_Params/XMLC_ScriptName"/>/<xsl:value-of select="/document/XMLC_Params/XMLC_Action"/>?<xsl:if test="/document/XMLC_Params/XMLC_NavigationParams!=''">
    <xsl:value-of select="/document/XMLC_Params/XMLC_NavigationParams"/>&amp;</xsl:if>
    <xsl:value-of select="@RecordName"/>_StartingRow=</xsl:param>
    <xsl:param name="URLParams"/>
    <xsl:param name="OnClick"/>
    <table border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td class="clOverBackground" style="border: 0px; padding-right: 5px;">
    <xsl:call-template name="xslc:IndexNavigationNo">
    <xsl:with-param name="Form" select="$Form"/>
    <xsl:with-param name="CommonURL" select="$CommonURL"/>
    <xsl:with-param name="URLParams" select="$URLParams"/>
    <xsl:with-param name="OnClick" select="$OnClick"/>
    <xsl:with-param name="IndexNo">1</xsl:with-param>
    </xsl:call-template>
    <xsl:call-template name="xslc:IndexNavigationNo">
    <xsl:with-param name="Form" select="$Form"/>
    <xsl:with-param name="CommonURL" select="$CommonURL"/>
    <xsl:with-param name="URLParams" select="$URLParams"/>
    <xsl:with-param name="OnClick" select="$OnClick"/>
    <xsl:with-param name="IndexNo">2</xsl:with-param>
    </xsl:call-template>
    <xsl:call-template name="xslc:IndexNavigationNo">
    <xsl:with-param name="Form" select="$Form"/>
    <xsl:with-param name="CommonURL" select="$CommonURL"/>
    <xsl:with-param name="URLParams" select="$URLParams"/>
    <xsl:with-param name="OnClick" select="$OnClick"/>
    <xsl:with-param name="IndexNo">3</xsl:with-param>
    </xsl:call-template>
    <xsl:call-template name="xslc:IndexNavigationNo">
    <xsl:with-param name="Form" select="$Form"/>
    <xsl:with-param name="CommonURL" select="$CommonURL"/>
    <xsl:with-param name="URLParams" select="$URLParams"/>
    <xsl:with-param name="OnClick" select="$OnClick"/>
    <xsl:with-param name="IndexNo">4</xsl:with-param>
    </xsl:call-template>
    <xsl:call-template name="xslc:IndexNavigationNo">
    <xsl:with-param name="Form" select="$Form"/>
    <xsl:with-param name="CommonURL" select="$CommonURL"/>
    <xsl:with-param name="URLParams" select="$URLParams"/>
    <xsl:with-param name="OnClick" select="$OnClick"/>
    <xsl:with-param name="IndexNo">5</xsl:with-param>
    </xsl:call-template>
    <xsl:call-template name="xslc:IndexNavigationNo">
    <xsl:with-param name="Form" select="$Form"/>
    <xsl:with-param name="CommonURL" select="$CommonURL"/>
    <xsl:with-param name="URLParams" select="$URLParams"/>
    <xsl:with-param name="OnClick" select="$OnClick"/>
    <xsl:with-param name="IndexNo">6</xsl:with-param>
    </xsl:call-template>
    <xsl:call-template name="xslc:IndexNavigationNo">
    <xsl:with-param name="Form" select="$Form"/>
    <xsl:with-param name="CommonURL" select="$CommonURL"/>
    <xsl:with-param name="URLParams" select="$URLParams"/>
    <xsl:with-param name="OnClick" select="$OnClick"/>
    <xsl:with-param name="IndexNo">7</xsl:with-param>
    </xsl:call-template>
    <xsl:call-template name="xslc:IndexNavigationNo">
    <xsl:with-param name="Form" select="$Form"/>
    <xsl:with-param name="CommonURL" select="$CommonURL"/>
    <xsl:with-param name="URLParams" select="$URLParams"/>
    <xsl:with-param name="OnClick" select="$OnClick"/>
    <xsl:with-param name="IndexNo">8</xsl:with-param>
    </xsl:call-template>
    <xsl:call-template name="xslc:IndexNavigationNo">
    <xsl:with-param name="Form" select="$Form"/>
    <xsl:with-param name="CommonURL" select="$CommonURL"/>
    <xsl:with-param name="URLParams" select="$URLParams"/>
    <xsl:with-param name="OnClick" select="$OnClick"/>
    <xsl:with-param name="IndexNo">9</xsl:with-param>
    </xsl:call-template>
    <xsl:call-template name="xslc:IndexNavigationNo">
    <xsl:with-param name="Form" select="$Form"/>
    <xsl:with-param name="CommonURL" select="$CommonURL"/>
    <xsl:with-param name="URLParams" select="$URLParams"/>
    <xsl:with-param name="OnClick" select="$OnClick"/>
    <xsl:with-param name="IndexNo">10</xsl:with-param>
    </xsl:call-template>
    </td>
    </tr>
    </table>
    </xsl:template>
    <xsl:template name="xslc:IndexNavigationNo">
    <xsl:param name="Form"/>
    <xsl:param name="CommonURL"/>
    <xsl:param name="URLParams"/>
    <xsl:param name="OnClick"/>
    <xsl:param name="IndexNo"/>
    <xsl:variable name="StartingRow_1" select="@MaxRows * $IndexNo - @MaxRows - (1*($IndexNo - 1))"/>
    <xsl:variable name="StartingRow">
    <xsl:choose>
    <xsl:when test="$StartingRow_1 &lt; 0">0</xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$StartingRow_1"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    <xsl:choose>
    <xsl:when test="@StartingRow = $StartingRow">
    <b>
    <xsl:value-of select="$IndexNo"/>
    </b>
    </xsl:when>
    <xsl:otherwise>
    <a>
    <xsl:choose>
    <xsl:when test="$OnClick != ''">
    <xsl:attribute name="href">.</xsl:attribute>
    <xsl:attribute name="onclick"><![CDATA[SetField(']]><xsl:value-of select="$Form"/><![CDATA[', ']]><xsl:value-of select="@RecordName"/><![CDATA[_StartingRow', ']]><xsl:value-of select="$StartingRow"/><![CDATA['); ]]><xsl:value-of select="$OnClick"/><![CDATA[return false;]]></xsl:attribute>
    </xsl:when>
    <xsl:otherwise>
    <xsl:attribute name="href"><xsl:value-of select="$CommonURL"/><xsl:value-of select="$StartingRow"/><xsl:value-of select="$URLParams"/></xsl:attribute>
    </xsl:otherwise>
    </xsl:choose>
    <xsl:value-of select="$IndexNo"/>
    </a>
    </xsl:otherwise>
    </xsl:choose>&#160;</xsl:template>

  3. #3
    RDM
    RDM est déconnecté
    Membre émérite

    Profil pro
    Inscrit en
    Mars 2002
    Messages
    1 424
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2002
    Messages : 1 424
    Points : 2 927
    Points
    2 927
    Par défaut
    interessant. mais j'en profiterais pour mettre le paramètre facultatif en mettant la valeur par défaut MainForm

  4. #4
    Membre expérimenté

    Profil pro
    Inscrit en
    Mars 2002
    Messages
    520
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2002
    Messages : 520
    Points : 1 446
    Points
    1 446
    Par défaut
    Citation Envoyé par RDM
    interessant. mais j'en profiterais pour mettre le paramètre facultatif en mettant la valeur par défaut MainForm
    ah oui, + 1

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    <xsl:template name="xslc:NavigationPad"> 
      <xsl:param name="Form"/>MainForm</xsl:param>
      ...

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2003
    Messages
    284
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2003
    Messages : 284
    Points : 349
    Points
    349
    Par défaut
    Pas de problème pour l'ajout du paramètre dans xslc:NavigationPad, d'après l'équipe de dev. Ca sera donc dispo dans la future release.

    Si ca t'embete pas, ils feront un copier/coller de ton code

  6. #6
    Membre expérimenté

    Profil pro
    Inscrit en
    Mars 2002
    Messages
    520
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2002
    Messages : 520
    Points : 1 446
    Points
    1 446
    Par défaut
    Citation Envoyé par Nicolas.Cogi
    Pas de problème pour l'ajout du paramètre dans xslc:NavigationPad, d'après l'équipe de dev. Ca sera donc dispo dans la future release.

    Si ca t'embete pas, ils feront un copier/coller de ton code
    Au contraire, tu m'en vois ravi ;-)
    Bien content car j'aurais pas besoin de mettre à jour les futures releases de la lib xsl.

    Thanks !

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Afficher un message contraignant lors de la saisie d'un texte
    Par mandiant_du_savoir dans le forum Macros et VBA Excel
    Réponses: 2
    Dernier message: 27/07/2013, 11h21
  2. [SQL/Access] Comment rendre un paramètre moins contraignant ?
    Par soforever dans le forum Requêtes et SQL.
    Réponses: 2
    Dernier message: 26/04/2007, 17h09

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo