4 Replies Latest reply on Sep 8, 2008 9:42 AM by Marine Wacheux

    Problem with 2 htmlCommandLink and target

    Marine Wacheux Newbie


      I have a problem with two (or more) htmlCommandLink in one form :
      - button A has a "target" property to open the result in a new window
      - button B has no "target" property

      Config : MyFaces 1.1.5 + RichFaces 3.1.6 + Firefox

      If I first click on button A, result open correctly in a new Firefox tab. But when I then click on button B (from first tab), result also open in a new tab, which should not happen.

      I didn't found any JIRA issue about this. Did I make a mistake in components usage, or should I open a new issue ?

      Thanks for help.

      <h:form id="fImpr">
       <t:graphicImage value="#{ress.Img_Imprimer}"/>
       <rich:toolTip value="#{msgG.Imprimer}"/>
       <a4j:htmlCommandLink id="btnDiffusion" styleClass="BTN_LINK"
       <t:graphicImage value="#{ress.Img_Documents_DiffusionDocs}"/>
       <rich:toolTip value="#{msgO.CompteRenduOperatoire_DiffusionCRO}"/>
       <a4j:htmlCommandLink id="btnCloture" styleClass="BTN_LINK"
       <t:graphicImage value="#{ress.Img_Documents_Cloture}"/>
       <rich:toolTip value="#{msgO.CompteRenduOperatoire_Cloture}"/>

        • 1. Re: Problem with 2 htmlCommandLink and target
          Marine Wacheux Newbie

          I forgot to tell : if I separate htmlCommandLink components in 2 forms, then it works correctly.

          • 2. Re: Problem with 2 htmlCommandLink and target
            Ilya Shaikovsky Master

            please also add bean code.

            • 3. Re: Problem with 2 htmlCommandLink and target
              Marine Wacheux Newbie

              Thanks for your reply. Here is the bean code.

              For "#{sessionUtilisateurBean.targetAffichageDoc}" :

               public final static String TARGET_AFFICHAGE_DOC = "GCM_IMPR_DOC";
               public String getTargetAffichageDoc() {
               return TARGET_AFFICHAGE_DOC;

              For "#{compteRenduOperatoireController.imprimer}" :
              public String imprimer() {
               Rdv rdv = rdvService.lireRdvById(f().getRdv().getId());
               Fichier f = null;
               try {
               f = docService.imprimerCourrierOuDocValide(rdv.getCompteRenduOperatoire().getId());
               FacesUtil.ecrireFichierReponseHttp(f.getContenu(), f.getType(),
               f.getNom(), false);
               } catch (DocumentException e) {
               addMessage(new MessageUtilisateur(e.getClefMessageUtilisateur(),
               GraviteMessage.ERROR, e.getParametresMessageUtilisateur()),
               return GcmKey.ECRAN_ACTUEL.getKey(); // Return an empty String.

              For "#{compteRenduOperatoireController.accesEcranDiffusion}" :
              public String accesEcranDiffusion() {
               Map<WebKeys,Serializable> objetsATransmettre = f().getObjetsATransmettre();
               DiffusionDocsPatientController ctl =
               return ctl.initialiserFormPourDocument(
               f().getRdv().getCompteRenduOperatoire().getId(), NOM_BEAN_CTRL,

              For "#{compteRenduOperatoireController.terminer}" :
              public String terminer() {
               boolean ok = true;
               ModeleReponseServiceUI reponse;
               try {
               reponse = gestionDocService.modifierStatutDoc(
               } catch (ReponseServiceUIException e) {
               reponse = e.getReponse();
               ok = false;
               addMessage(reponse.getMessagesUtilisateurs(), WebKeys.BUNDLE_SERVICES.getKey());
               if (ok)
               return ecranSuivant();
               return GcmKey.ECRAN_ACTUEL.getKey();

              Thanks in advance for your help.

              • 4. Re: Problem with 2 htmlCommandLink and target
                Marine Wacheux Newbie

                I also have the same problem with 2 panelMenuItems in the same form.

                I created JIRA entry : https://jira.jboss.org/jira/browse/RF-4420