Skip to main content
Published: August 24 2009, 1:12:00 PMUpdated: November 28 2020, 7:43:55 PM

Implement dynamic resizing for URL type gadgets

Summary

   To dynamic resize the pages of your URL-type Open eBay Apps Gadget in iframe (canvas),  you need to make sure the followings are implemented:


        1. define dynamic-height  property as in your deployment descriptor :
                <Gadget>..<Require feature="dynamic-height">..</Gadget>
        2. specify an initial height in the DD if required:
               <Gadget>..<ModulePrefs   height="500"  ...>..</Gadget>
        3.  include the decoded IS parameter value at the top of each your page, preferably in the head element as:
<head>
    <%=new String(Base64.decode(session.getAttribute("is").getBytes("UTF-8")), "UTF-8")%>;
</head>
        4. To change the height to the contents of your gadget automatically, you can call
          gadgets.window.adjustHeight() on the the page load event

Keep in mind that the width for the canvas iframe is 944, go larger and you get a horizontal scroll bar. Once you get a horizontal scroll bar, it cuts into the height and the vertical bar appears in some browsers.  The solution is to adjust the CSS such that the elements do not cause horizontal scrolling or you might want to add overflow-x: hidden and overflow-y: hidden to the body element in your stylesheet:


Additional Resources

Open eBay Apps API Guide

How well did this answer your question?
Answers others found helpful