Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    TextBox/TextItem Along with an image inside it

    Hi All,
    I want to add a textbox along with an image inside it. It is just like after entering something inside the text box I need to display an image (X) to delete the entered image. Can some one explain me how to do this functionality.


    Thanks in Advance,
    D.Y.D.A. Viswanath

    #2
    hi viswanath,

    U can add a style
    .imageStyle{
    background-image:url('imagetoshow');
    }

    and set the textboxstyle on onchangedhandler of textitem

    then on delete button click,u can reset to default style or add another style of background none..

    Comment


      #3
      I tried that but the image is getting displayed as background not inside the text box...

      Comment


        #4
        please tell me the method used for changing style ?

        Comment


          #5
          I am using like this

          final TextItem filterItem = new TextItem(GUICONSTANTS.getRBMatchingLabelText());

          filterItem.addChangeHandler(new ChangeHandler(){

          public void onChange(ChangeEvent event) {
          filterItem.setCellStyle("customTextItem");
          }
          });

          But one more thing what I want is, I need to operate on that image like onMouseClick, onRollOver etc....

          Comment


            #6
            its nt cellstyle ,
            i already mentioned
            Originally posted by vinu
            hi viswanath,

            U can add a style
            .imageStyle{
            background-image:url('imagetoshow');
            }

            and set the textboxstyle on onchangedhandler of textitem
            then on delete button click,u can reset to default style or add another style of background none..
            use setTextBoxStyle(stylename);

            Comment


              #7
              That's ok. the image is getting displayed inside the text box but once when I click on that text box then the image is vanishing

              and How can I perform operations on that image.. like clickable.?

              Comment


                #8
                hi

                U may put the style only .

                u have to put the style varieties showing different events

                ie,if u put textStyle
                u have add textStyleFocused, textStyleDisabled etc..to the style sheet which will call automatically on such events

                Comment

                Working...
                X