Announcement

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

    Dynamic Edge Image

    Hi,

    I need to be able dynamically change edge image for layouts and dynamic forms.

    I tried to change "edgeImage" property on the fly (with redraw()), but it does not work. I guess it uses this property only once on initialization?
    Pease correct me if I am wrong, maybe there is a way to change it on the fly?

    I found that EdgedCanvas has this functionality, but I could not find a good example of using it. I tried to create it the following way:

    Code:
    isc.EdgedCanvas.create( {
        ID: "dynEdge",
        edgeSize: 4,
        children: [
            isc.DynamicForm.create({
            width: 300,
            fields: [
                {title:"Item", type:"text"} 
            ]
            })
        ]
    });
    
    isc.Button.create({
       top: 150,
       title: "Change Edge Image",
      click: function() {
         dynEdge.setEdgeImage("edges/custom/frame_10.png");
      }
    });
    But the problem is the EdgedCanvas does not resize the edge according to its child.
    Please, can you give me an example how to do it? Is there a property or I should handle child resizing manually?
    (I cannot use fixed size, it should be auto-resized).

    #2
    If the image is the same size, it would be really easy to create a setter. At the moment you could call it yourself but it happens to go through an obfuscated variable (canvasShowingEdges.$10.setEdgeImage(newSrc)).

    Comment


      #3
      "canvasShowingEdges" means the layout or dynamic form with edges, right?

      Am I doing something wrong? In my sample $10 is null.


      Code:
      isc.DynamicForm.create({
          ID: "dynEdgeForm",
          showEdges: true,
          edgeSize: 4,
          width: 300,
          fields: [
              {title:"Item", type:"text"} 
          ]
      });;
      
      isc.Button.create({
         top: 150,
         title: "Change Image",
        click: function() {
           if (dynEdgeForm.$10 == null)
             window.alert("dynEdgeForm.$10 is null ");
           else
             dynEdgeForm.$10.setEdgeImage("edges/custom/frame_10.png");
        }
      });

      Comment


        #4
        SmartClient Version: SC_SNAPSHOT-2010-12-15/PowerEdition Development Only (built 2010-12-15)

        Comment


          #5
          Sorry, should be $l0. Lowercase "l" followed by zero.

          Comment


            #6
            Works! Thank you!

            Comment

            Working...
            X