Announcement

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

    HLayout.getInnerHTML returns "nbsp;"

    SmartClient Version: v10.0p_2015-01-20/Pro Deployment (built 2015-01-20)

    Hi I trying to create some html to serve as the argument for EventHandler.setDragTracker(String html)

    If I create a Label I can get it's html via label.getInnerHTML(), but if I put the Label inside a HLayout then hLayout.getInnerHTML() returns "nbsp;".
    Am I misunderstanding the intended functionallity of getInnerHTML or shouldn't it return the html for the layout including all it's members?

    TestCase:
    Code:
    Label label = new Label("THIS IS A LABEL!");
    
    SC.logWarn("LabelHTML: " + label.getInnerHTML()); // <-- Prints the correct HTML
    
    HLayout hLayout = new HLayout();
    hLayout.addMember(label);
    
    SC.logWarn("HLayout HTML: " + hLayout.getInnerHTML()); // <-- Prints &nbsp;

    #2
    No, getInnerHTML() is not designed to recursively return the HTML of all members. getInnerHTML() returns the HTML for the current component excluding children, and is designed as an override point to allow you to generate custom HTML while still keeping all the capabilities of managing children intact.

    Comment


      #3
      Okay, I understand.

      Maybe you can help me with my problem in another way then.

      I have a draggable layout with children and I would like the drag tracker to be an exact copy of this layout.

      To be more specific, I want the original layout to stay where it is, and drag a "clone" of this layout.

      How would I do this the right (easy) way?

      Comment


        #4
        For most cases, we don't recommend using a drag tracker that closely resembles what is being dragged - it may visually demo well, but is less usable since it tends to occlude possible drop targets and drop indicators, and is just visually noisy overall.

        A simple outline, or a shorthand representation of what is being dragged, is usually better. Take a look at the various appearances offered by ListGrid dragging, for instance.

        Comment

        Working...
        X