Bonjour,
Je travaille sur une application et j'ai détecté une anomalie.
Alors en premier l'utilisateur réalise une recherche.
On affiche se résultat dans un tableau.
Je voulais permettre à l'utilisateur de choisir les colonnes du tableau à afficher. Du coup j'ai mis en place un bouton Config colonne qui ouvre une popup dans laquelle il sélectionne le colonnes à l'aide de checkbox puis il valide.
En validant il lance un petit code Javascript qui va recharger la page ce qui permet d'avoir le bon affichage.
<a href="#" onclick="javascript:openPopup('/configColumn.jsp?contextConfig=search')" class="action">
Le hic c'est que quand il recharge la page il relance toutes les actions que lancé ultérieurement ce qui me pourrit la session et me fais buguer l'application.
Ce que je voudrai c'est recharger la page sans relancer les anciennes actions.
Merci...
Voici le code complet de la JSP:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
| <layout:bloc image="/images/titre_result.gif" outlineImage="/images/pixel.gif"
rightShadingImage="/images/degrad_d_v1.gif" bottomShadingImage="/images/degrad_b_v1.gif"
cornerImage="/images/coin_degrad_v1.gif" titleStyleClass="fd_titre_bloc"
outlineStyleClass="tr_bloc" styleClass="CENTER" bodyStyleClass="BLOC">
<tr>
<td bgcolor="#FFFFFF" align="left">
<table border="0" cellspacing="2" cellpadding="0">
<tr>
<td class="libel_tableau">Résultat : </td>
<td><img src="images/pixel.gif" width="5" height="1"></td>
<td class="libel_resultat" align="left"><bean:size id="resultNumber" name="items"/>
<bean:write name="resultNumber" ignore="true"/>
<logic:notEmpty name="isMaxNotifications"><bean:message key="prompt.max.article.found"/></logic:notEmpty>
<logic:empty name="isMaxNotifications"><bean:message key="prompt.article.found"/></logic:empty>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" align="center"><img src="images/pixel.gif" width="1" height="4"></td>
</tr>
<logic:equal name="context" value="search">
<tr>
<td bgcolor="#FFFFFF" align="center">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0" class="button_action">
<tr>
<td><img src="images/pixel.gif" width="4" height="18"></td>
<td align="center" valign="middle">
<fnac:linkWithFormSubmit styleClass="action" page="/addToCart.do">Mettre au panier
</fnac:linkWithFormSubmit>
</td>
<td><img src="images/pixel.gif" width="4" height="1"></td>
</tr>
</table>
<td><img src="images/pixel.gif" width="8" height="1"></td>
<logic:present name="headquarterMode" scope="session">
<td>
<table border="0" cellspacing="0" cellpadding="0" class="button_action">
<tr>
<td><img src="images/pixel.gif" width="4" height="18"></td>
<td align="center" valign="middle">
<a href="#" onclick="javascript:openPopup('/initConfigColumn.do?contextConfig=search')" class="action">
Configuration des colonnes
</a></td>
<td><img src="images/pixel.gif" width="4" height="1"></td>
</tr>
</table>
</td>
<td><img src="images/pixel.gif" width="8" height="1"></td>
</logic:present>
</td>
</tr>
</table>
</td>
</tr>
</logic:equal>
<layout:column>
<layout:collection name="items" id="item" indexId="index" styleClass="ARRAY" styleClass2="ALT_ARRAY">
<logic:equal name="context" value="search">
<layout:collectionItem title="prompt.search.checkbox">
<bean:define name="item" property="articleId" toScope="page" id="id"/>
<html:multibox property="selectedId" value="<%=id.toString()%>"/>
</layout:collectionItem>
</logic:equal>
<logic:equal name="configColumnSearch" property="familyCode" value="true" scope="session">
<layout:collectionItem title="prompt.family" property="familyCode" sortable="true">
<bean:define name="item" property="familyName" toScope="page" id="familyName"/>
<div onMouseOver="tooltip.show(this)" onMouseOut="tooltip.hide(this)" title="<%= familyName%>">
<layout:write name="item" property="familyCode"/>
</div>
</layout:collectionItem>
</logic:equal>
<logic:equal name="configColumnSearch" property="subFamilyCode" value="true" scope="session">
<layout:collectionItem title="prompt.subFamily" property="subFamilyCode" sortable="true" >
<bean:define name="item" property="subFamilyName" toScope="page" id="subFamilyName"/>
<div onMouseOver="tooltip.show(this)" onMouseOut="tooltip.hide(this)" title="<%=subFamilyName%>">
<layout:write name="item" property="subFamilyCode"/>
</div>
</layout:collectionItem>
</logic:equal>
<logic:equal name="configColumnSearch" property="id" value="true" scope="session">
<layout:collectionItem title="prompt.sku" property="sku" sortable="true">
<bean:define name="item" property="sku" toScope="page" id="itemSku"/>
<a href="#" onclick="javascript:openArticleDetail(<%=itemSku%>)">
<layout:write name="item" property="sku"/>
</a>
</layout:collectionItem>
</logic:equal>
<logic:equal name="configColumnSearch" property="title" value="true" scope="session">
<layout:collectionItem title="prompt.label" property="title" sortable="true" style="text-align: left;"/>
</logic:equal>
<logic:equal name="configColumnSearch" property="storePrice" value="true" scope="session">
<layout:collectionItem title="prompt.price" property="storePrice" sortable="true"/>
</logic:equal>
<logic:equal name="configColumnSearch" property="packageArticleStr" value="true" scope="session">
<layout:collectionItem title="prompt.package" property="packageArticleStr" sortable="true"/>
</logic:equal>
<logic:equal name="searchFullForm" property="type" value="searchSkuForBundle">
<logic:equal name="configColumnSearch" property="bundleArticleStr" value="true" scope="session">
<layout:collectionItem title="prompt.bundle" property="bundleArticleStr" sortable="true"/>
<layout:collectionItem title="prompt.space">
<layout:link page="/selectArticleForBundle.do" paramId="sku" paramName="item" paramProperty="sku" >
<bean:message key="prompt.select"/>
</layout:link>
</layout:collectionItem>
</logic:equal>
</logic:equal>
<logic:notEqual name="searchFullForm" property="type" value="searchSkuForBundle">
<logic:equal name="configColumnSearch" property="bundleArticleStr" value="true" scope="session">
<logic:notPresent name="headquarterMode" scope="session">
<layout:collectionItem title="prompt.bundle" property="bundleArticleStr" sortable="true"/>
</logic:notPresent>
<logic:present name="headquarterMode" scope="session">
<layout:collectionItem title="prompt.bundle" property="bundleArticleStr" sortable="true">
<layout:link page="/displayBundle.do?reset=true&" paramId="sku" paramName="item" paramProperty="sku">
<layout:write name="item" property="bundleArticleStr"/>
</layout:link>
</layout:collectionItem>
</logic:present>
</logic:equal>
</logic:notEqual>
</layout:collection>
</layout:column>
<logic:equal name="context" value="search">
<tr>
<td bgcolor="#FFFFFF" align="center">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0" class="button_action">
<tr>
<td><img src="images/pixel.gif" width="4" height="18"></td>
<td align="center" valign="middle">
<fnac:linkWithFormSubmit styleClass="action" page="/addToCart.do">Mettre au panier
</fnac:linkWithFormSubmit>
</td>
<td><img src="images/pixel.gif" width="4" height="1"></td>
</tr>
</table>
<td><img src="images/pixel.gif" width="8" height="1"></td>
<logic:present name="headquarterMode" scope="session">
<td>
<table border="0" cellspacing="0" cellpadding="0" class="button_action">
<tr>
<td><img src="images/pixel.gif" width="4" height="18"></td>
<td align="center" valign="middle">
<a href="#" onclick="javascript:openPopup('/configColumn.jsp?contextConfig=search')" class="action">
Configuration des colonnes
</a></td>
<td><img src="images/pixel.gif" width="4" height="1"></td>
</tr>
</table>
</td>
<td><img src="images/pixel.gif" width="8" height="1"></td>
</logic:present>
</td>
</tr>
</table>
</td>
</tr>
</logic:equal>
</layout:bloc> |
Partager