Announcement Announcement Module
Collapse
No announcement yet.
Refresh a binding Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Refresh a binding

    Hi,

    I created my own Binding IconBiding based on the LabelBinding. In my form I add this binding to the formBuilder and all is ok.

    Now, I want to refresh it because the icon has changed. How I can do it?

    Thanks
    Dominique

  • #2
    you have to implement valueModelChanged(Object) of LabelBinding:

    Code:
    protected void valueModelChanged(Object newValue) {
        label.setIcon((Icon)newValue);
    }

    Comment


    • #3
      This done, but how I can call it or trigger it from my AbstractForm class.

      Cheers
      Dominique

      Comment


      • #4
        you do this through formmodel:

        formModel.getValueModel("iconfield").setValue(newI con);

        Comment


        • #5
          Hello,

          Excuse me but I don't see the use case of IconBinding ? (No doubt there is).

          Thank you,

          Christophe.

          Comment


          • #6
            Thanks Mathias it works ;-)

            Christophe: In my case I have to scan a document and when the scanning is finished I would like to show it on the screen, the only way I found up to now (may be there is another way) is to transform the java.awt.image i get into a java.swing.ImageIcon and to display it I use the JLabel.setIcon.

            May be you have another idea?

            Regards
            Dominique

            Comment


            • #7
              Thank you for these precisions.

              Christophe.

              Comment

              Working...
              X