Width of the Skin - Websphere

This is a discussion on Width of the Skin - Websphere ; Hi All, I need to get the width of the container in which Portlet is placed. I've a skin with round corners. The central image should repeat based on the width of the portlet. I feel that I'll be able ...

+ Reply to Thread
Results 1 to 19 of 19

Thread: Width of the Skin

  1. Width of the Skin

    Hi All,

    I need to get the width of the container in which Portlet is placed.
    I've a skin with round corners. The central image should repeat based on the width of the portlet. I feel that I'll be able to solve this by getting the width of the portlet.
    Please help me.

    Thanks
    Manoj

  2. Re: Width of the Skin

    if you look in the layeredcontainer-h.jsp it shows how to get this
    (String)currentLayoutNode.getMetrics().getValue(Co mpositionMetrics.WIDTH);



    IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0

    IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0



    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

  3. Re: Width of the Skin

    This width is server-side and is only a recommendation to the browser.
    There's no guarantee that the browser will actually display the column
    at this exact width.

    If you want to repeat an image based on the width of the portlet, the
    easiest way to do it would be to use a CSS background. This technique
    is not recommended if the image is essential to understanding your
    portlet under high contrast accessibility mode.

  4. Re: Width of the Skin

    Hi Jim,
    Thanks for your reply. I tried printing the width in layeredContainer-H.jsp file. It's printed as null.
    I the layout tools portlet I changed the width of the portlet to "277". Still columnWidth is printed as null. If there is a single portlet in a page that portlet is occupying the whole width. How to make the portlet to occupy the width which is mentioned in the Layout Tools potlet?

    Thanks & Regards,
    Manoj

  5. Re: Width of the Skin

    On my machine I added a system out.

    [11/5/08 7:33:06:780 EST] 0000007b SystemOut O This is the width = 700
    [11/5/08 7:33:06:795 EST] 0000007b SystemOut O This is the width = null
    [11/5/08 7:33:19:920 EST] 00000063 SystemOut O This is the width = null
    [11/5/08 7:33:21:701 EST] 00000061 SystemOut O This is the width = null

    I see this in the xmlaccess






    So we can see it is picking it up

    I even checked with one portlet on the page. The big problem to remember here these are all just suggestions to the browser it does not have to honor the table widths. Considering that content inside and outside the portlet is showing with widths of 100% it appears to be doing its best to render the page.

    You may have to add more checks to your skin to get the width.

    Where in the layeredContainer-h.jsp did you add this? Also did you make sure to assign that skin as the default skin for the page?






    IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0

    IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0



    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

  6. Re: Width of the Skin

    Thanks for your response Jim.
    I haven't assigned that skin as the default skin.Now I'm getting the System out messages.
    Is the portal server using the default skin's unlayerdContaienr-H.jsp file?

    I need to create round cornered images for Portelts' title bar. I've three divs.
















    The width of the central image is repeating. I need to specify the width of the central image. For a particular page if the user doesn't have access to one page, the other portlet should occupy it's space. In that case how can I specify the width of the central div.
    I tried getting the width from control.jsp file as follows.

    td valign="top"


    I'm getting an error CompositionMetrics.WIDTH cannot be resolved to a type. Is there another way to implement this?

    Regards,
    Manoj

  7. Re: Width of the Skin

    I've attached the divs

  8. Re: Width of the Skin

    well have you added the imports as in the layeredcontainer?

    And yes the default skin is used to render the rows and columns while control.jsp is used to render the portlet itself.

    In the control.jsp you might need to get the layout model for the page and back up the nodes to get the width



    IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0

    IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0



    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

  9. Re: Width of the Skin



    I've included this is control.jsp file. but the output is null. I'm getting a output from unlayered-h.jsp file.
    I tried putting a println statement inside if and else blocks. Either of these are not being printed.

    Regards,
    Manoj

  10. Re: Width of the Skin

    is this for the skin assigned to the portlet? also not surprising it is null, the width on the portlet is not set you need to get the width from the column which is the parent above it

    That is why I was suggesting to use the layout model and working on finding the columns and what not


    IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0

    IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0



    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

  11. Re: Width of the Skin

    Thanks for the reply Jim. I modified the style classes. Now I'm able to get the width and based on it the central image replicates. I have one more question. If I specify 300px and 200px as the width of the container in Layout tools, why are the portlets not occupying this width? There is no change in the appearance.

    Thanks
    Manoj

  12. Re: Width of the Skin

    well you need to remember that these are just suggestions to the browser, is the html containing the right values?



    IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0

    IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0



    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

  13. Re: Width of the Skin

    The default implementation of column width uses the value you specify in
    the width="" attribute of a table cell. Because the entire table has a
    width="" attribute of 100%, the table cells for your columns begin at
    the widths you specify and then the browser adds an equal amount of
    space to each column such that the table satisfies the 100% width
    requirement.

    The widths specified in the layout tools work best when you leave at
    least one column without a width so that column can expand to fill up
    the remaining space in the table to 100%. When you do this, the other
    columns are usually sized the value you specify. (Assuming there isn't
    content inside the portlet that forces the width to be larger such as a
    wide graphic or a long line of preformatted monospace-font text.)

    If you want to fix the widths of all columns, you must change the markup
    for the columns to at least remove the 100% width on the table... but
    then if you have pages without widths on the columns, your columns may
    shrink to very tiny widths.

    You will likely need to both remove the 100% width on the table and
    change to CSS widths on the table cells for the columns instead of using
    the width="" attribute on the tag.

  14. Re: Width of the Skin

    Yes the html contains correct values . For example the width given in "wptheme-mainContent" is 970px;
    I created three column containers and set the width of each to 300px. In HTML source I can see the width as 300px. But appearance wise it's not true. The central portlet is occupying less width.

    Thanks
    Manoj

  15. Re: Width of the Skin

    In your theme/skin does the width go in the width attribute of a
    tag? If so, HTML 4.0.1 defines the values for the width attribute of a
    table to not use "px" on the end. So you need to specify "300" and not
    "300px".

    Here's the HTML 4.0.1 specification for how widths on tables work:
    http://www.w3.org/TR/html401/struct/...tml#h-11.2.4.4

    If the browser doesn't understand the value you specify for width, it's
    like not specifying a width at all and then then browser just looks at
    the contents of each column and picks random widths.

    It sounds like you really do want fixed width columns. (Since you limit
    the entire page width to 970px. If so, and if your current widths are
    going on the width attribute, this isn't going to work. You will need
    to change your skin to use CSS so width="xxx" is changed to
    style="width:xxx;".

  16. Re: Width of the Skin

    One more thing is if the contents are rendered using CSA theme, then in the HTML source the values are not there.

    Thanks
    Manoj

  17. Re: Width of the Skin

    yes that is correct, with out one of the web 2.0 defects the web 2.0 themes ignore any setting for width



    IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0

    IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0



    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

  18. Re: Width of the Skin

    As I mentioned earlier,in HTML source I can see the width as 300px.There are three column containers, for each one I've given width of 300px. But appearance wise it's not true. The central portlet is occupying less width.
    Please help me

    Regards,
    Manoj

  19. Re: Width of the Skin

    and as I said the widths are just suggestions to the browser on how to display everything, I would use a tool like firebug to see what is going on with the widths, and any other containers that might be causing an issue



    IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0

    IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0



    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

+ Reply to Thread