Announcement

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

    #16
    Tab.setAttribute("src", "roundbut")

    I've tried using
    Code:
    setAttribute("src", "roundbut")
    but this doesn't quite do what I expect. The img url ends up being
    Code:
    http://localhost:8888/images/_start.roundbut
    notably, it appears the 'src' attribute is being used as the extension, rather than the base part of the filename. daniel_gabriel appears to have got this part working, so I wonder if I'm missing a step - no real example was provided.

    Comment


      #17
      I'm having some trouble with this.

      I was able to change the background graphics for the tabSet just fine by setting the "src" attribute on tab; but I can't seem to apply a new text to the tab title; no matter what I try. I've tried:

      Code:
      public class DIDOrderTabCustomizer {
      	
      	public static void customizeTab(Tab tab)
      	{
      		tab.setAttribute("src", "./tabs/didOrders.jpg");
      		tab.setAttribute("styleName", "dmTabTitle");
      	}
      
      }
      and

      Code:
      public class DIDOrderTabCustomizer {
      	
      	public static void customizeTab(Tab tab)
      	{
      		HashMap<String, String> tabPropertiesMap = new HashMap<String,String>();
      		tabPropertiesMap.put("styleName", "dmTabTitle");
      		JavaScriptObject jso = JSOHelper.convertMapToJavascriptObject(tabPropertiesMap);
      		
      		tab.setAttribute("src", "./tabs/didOrders.jpg");
      		tab.setAttribute("tabProperties", jso);
      	}
      The "src" attribute seems to take; the "styleName" one doesn't. (I'm trying to change the font-color of the tab title from black to white as the background image for the tab itself is quite dark).

      Comment


        #18
        Doh. Found it. I should have been setting titleStyle, not styleName; i.e.:

        Code:
        public class DIDOrderTabCustomizer {
        	
        	public static void customizeTab(Tab tab)
        	{
        		
        		tab.setAttribute("src", "./tabs/didOrders.jpg");
        		tab.setAttribute("titleStyle", "dmTabTitle");
        	}
        
        }

        Comment

        Working...
        X