Bonjour,
Voici pour vous un nouveau problèmes à ce tirer les cheveux (mais pourquoi ais-je choisi JSF!!!)
Bon, j'ai un tableau et un bean associé, j'ai un bouton Ajouter, qui me permet d'afficher un formulaire dans un ModalPanel . Le bean du Tableau contient un objet User, qui est l'utilisateur affiché dans ce tableau, et je veux envoyer cette objet au Bean gérant le formulaire. J'ai utilisé un setPropertyActionListener pour cela. Jusque là aucun soucis.
Le problème viens du fait que quand je clique sur le bouton, mon Bean gérant le tableau est réinitialisé (donc l'objet User est mit à null) et ensuite le User est envoyé au Bean du formulaire.
Je ne comprend pas, ce n'est pas la première fois que je fais cela, et ça fonctionne bien habituellement!!!
Pourquoi mon Bean est il réinitialisé?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 <h:form id="historyTableForm"> <rich:dataTable id="historyTable" onRowMouseOver="this.style.backgroundColor='#F1F1F1'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'" cellpadding="0" cellspacing="0" width="400" border="0" value="#{historyDataTableBean.history}" var="row"> <rich:column> .... Mon Tableau ... </rich:column> </rich:dataTable> <a4j:commandButton ajaxSingle="true" value="Ajouter" oncomplete="Richfaces.showModalPanel('editHistoryPanel');" reRender="historyRegisterForm"> <f:setPropertyActionListener value="#{historyDataTableBean.user}" target="#{historyFormBean.user}" /> </a4j:commandButton> </h:form>
Partager