3 Replies Latest reply on Oct 1, 2008 11:51 PM by rmcdonough

    Problem adding an image to h:commandButton

    shasho

      Hello,


      I am trying to add an image to to h:commandButton, here is the code


      <h:commandButton id="login_but" type="button"   action="#{loginNew.login}"  reRender="loginWindow" alt="Enter" image="/resources/images/login_but.jpg"/ label="login" title="login" value="login">
      



      The problem is that when the IE is first opened the image doesn’t dispkat, the reasone – the rendering added jsessionid


      src="/resources/images/login_but.jpg;jsessionid=2DB43FB03C9CC61B124A37E84356E743"
      



      From that point everything is working fine, refresh or continuing to work show the image


      Using SEAM 2.0.2SP1 and Richfaces 3.2.1GA on jboss 4.2.2 GA


      Thanks

        • 1. Re: Problem adding an image to h:commandButton
          diegocoronel

          try it using CSS, i did it in my button and it works fine.



          <h:commandButton 
              styleClass="bt_fundo_idoctor_2" 
              onmouseover="className='bt_fundo_idoctor_f2_2'"
              onmouseout="className='bt_fundo_idoctor_2'
          >
          
           </h:commandButton>



          and my images are defined in css

          • 2. Re: Problem adding an image to h:commandButton
            shasho

            Many thanks for the quick answer


            One remark, this solution doesnt look as good as the original request because one can still see the 3D of the button, the picture is on the button instead of replacing it


            without any other alternative I will use it


            I wonder what is the bug, the cause of adding the seesionid?  I found similar fixed problem in myfaces, does someone know if this bug was also solved for JavaServer Faces ?

            • 3. Re: Problem adding an image to h:commandButton
              rmcdonough

              I'm facing the same exact issue and I don't think it's a problem with Seam or RichFaces. This post kind of explains the issue:


              http://www.jroller.com/greenhorn/?page=2


              However his solution doesn't really work for me since my is running off the root context. It would appear that this is an issue with the JSF RI, but I can't confirm it. I'll post back here if I find a workable solution.


              Ryan-