Announcement

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

    SmartGWT in a portlet images problem

    Hi all,

    Im running a SmartGWT app within a liferay portlet. I've found some precious informations here at the forum, and over the internet.

    I will do a full tutorial when I will get everything working !

    I've got some problem with the skins and the isomorphicDir, but I solved injecting the isomorphicDir var through JavaScript.

    My problem is now related to my images (the ones placed into my WAR/images folder).

    1. I've set the appImgDir with :
    Code:
    Page.setAppImgDir("MyPortlet/images");
    But with Firebug, I can see that i'm receiving request for this :

    Code:
    <img width="16" height="16" border="0" align="absmiddle" 
    suppress="TRUE" eventpart="icon" style="vertical-align:middle" name="isc_1Cisc_ToolStripButton_1_label$4u" 
    [B]src="http://localhost:8080/web/guest/MyPortlet/images/highlight.png">[/B]
    and it should be

    Code:
    <img width="16" height="16" border="0" align="absmiddle" 
    suppress="TRUE" eventpart="icon" style="vertical-align:middle" name="isc_1Cisc_ToolStripButton_1_label$4u" 
    [B]src="http://localhost:8080/CentipedePortlet/images/highlight.png">[/B]
    In other hand, like im saying, the skins loads fine :
    Code:
    <img width="14" height="14" border="0" align="TEXTTOP" 
    suppress="TRUE" name="isc_19main" 
    [b]src="http://localhost:8080/MyPortlet/MyApp/sc/skins/Enterprise/images/Slider/hthumb.png" [/B]id="aui_3_2_0_11614">
    I would really appreciate any help. Im stuck with this issue.

    There is one solution (using URL redirecting), but I can't afford that.

    Thank you very much.

    Cheers.

    Using SmartGWT 2.4 + GWT 2.3.0 + Firefox 4.0.1
    Last edited by jmichelgarcia; 2 Aug 2011, 05:48.

    #2
    Solved with :

    Code:
    Page.setAppImgDir("[B]/[/B]MyPortlet/images");
    Stupid error.

    Hope it will help someone,

    I will do a full tutorial for SmartGWT apps into a servlet, and I will post the url here.

    Cheers
    Last edited by jmichelgarcia; 2 Aug 2011, 04:21.

    Comment


      #3
      If you specify appImgDir as a relative path it's just relative to the main page URL. So if the main page URL is "http://localhost:8080/web/guest/something" and you want images fetched from "http://localhost:8080/CentipedePortlet/images/something" you will need an appImgDir of either "../../CentidePortlet/" or "/CentidePortlet/".

      Comment


        #4
        Thanks for the explanation!

        Comment

        Working...
        X