Announcement

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

    How to display part of the text as hyperlink?

    Hi,
    I want to display a static text and part of the text has to be hyper link. I've tried several ways with LinkItem and HyperLink. But couldnt find the exact solution.

    For example,
    For the text "Password Changed successfully, please login again", i need to display hyperlink for "login". How can i achieve this?

    It would be better if there is any solution with plain hyper link instead of LinkItem. Please reply asap if anybody knows.

    I'm using SmartClient Version: SC_SNAPSHOT-2011-05-03/LGPL Development Only (built 2011-05-03)
    Last edited by skaluva; 12 May 2011, 03:31.

    #2
    Wish there was an easy way to do this, but this is what I do and it works.
    Welcomed to other suggestions also if someone knows how to make this a non-static method please input.

    Code:
    public class ClassName {
    
        public ClassName() {
            exportStaticMethod();
            
            Label label = new Label();
            label.setContents("A text string with <a href=\"javascript:navResultsHome();\">link</a>");
        }
        
        public static void navResultsHome() {
            History.newItem("Results");
        }
    
        /* Call from constructor */
        private native void exportStaticMethod() /*-{
            $wnd.navResultsHome = 
                @<your.pkg>.ClassName::navResultsHome();
         }-*/;
    }
    You can also pass parameters if needed. See source.

    Source: http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=DevGuideJavaFromJavaScript

    Comment

    Working...
    X