Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 951787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:47:31+00:00 2026-05-15T23:47:31+00:00

So my question is the following : Say, I am displaying data in in

  • 0

So my question is the following :

Say, I am displaying data in in a flextable after getting it from a database, am doing this in a routine manner using loops.

Now, in the entire First Column, the text should be clickable, i.e. I should be able to add a Click Handler to First Column values (as I gotta load another table upon clicking any of the first column text vals.)

Question : How can I generate such Hyperlink tags while in a loop ? The problem comes when I try to do so as I don’t know how to name them as the loop runs and use the same concept while adding ClickHandlers.

Should I use something else other than Hyperlink for this task. Kindly explain how ?

I really appreciate help in this as I am a very new GWT coder.

— Chirayu

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:47:31+00:00Added an answer on May 15, 2026 at 11:47 pm

    Using a Hyperlink is maybe not the best way to do something like this, because you shouldn’t use a ClickHandler with a Hyperlink. A Hyperlink sets a HistoryToken and you should respond to the change of the History.
    I would use a Label and maybe style it as a normal link if you want to have the same look and feel.
    (I will use a Label in the following example but you could change it to a Hyperlink if you want to.)

    I would create a class that extends Label. This class would have an ID you set in the constructor. You would send this Id to the server to get the new FlexTable. In the constructor you add a ClickHandler that reads the id field and sends it to the server to get the new FlexTable.

    public class FlexTableLabel extends Label implements ClickHandler {
        int id=0;  
        public FlexTableLabel(String text, int id) {
            this.id=id;
            this.setText=text;
            this.addCickHandler(this);
        }
    
        public void onClick(ClickEvent event) {
            //sends the id to the server, of course you need to replace it with your 
            //service
            yourService.getNewFlexTable(this.id);
        }     
     }
    

    In your loop you would just create objects of the new class and give it the appropriate parameters(I assume you have an ArrayList with the result. The Objects in this ArrayList would have text and id):

    for(int i=0; i<result.size;i++) {
        FlexTable.setWidget(i,0, new FlexTableLabel(result.get(i).text, result.get(i).id);
    }
    

    I hope this gives you at least something to start, if something is still unclear leave a comment and I will try to help make things clear.

    Edit based on Chirayu’s post:

    It’s hard to explain something like this without knowing your application.
    I normally implement the Singleton Pattern to get a specific widget.
    So I would create a class like this:

    public static YourPanel extends Panel {
        private static YourPanel instance=null;
    
        public static YourPanel getInstance() {
            if(instance==null) {
                instance=new YourPanel();
            }
            return instance;
        }
    }
    

    In your EntryPointClass you would have something like this:

    public class YourEntryClass extends EntryPoint {
        public void onModuleLoad() {
            RootPanel.get().add(YourPanel.getInstance());
        }
    }
    

    You can now call the YourPanel.getInstance() method in the onSuccess() part of your service to change the content of the panel:

    yourService.getNewFlexTable(this.id, new AsyncCallback<ArrayList<String>>() {
        public void onSuccess(ArrayList<String> result) {
        For(int i=0;i<result.size;i++) {
                YourPanel.getInstance().add(result.get(i);
            } 
        }
    });
    

    I hope that helps. Leave a comment if it doesn’t.

    Sample app
    Sample app running
    Sample app source code

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following this question: Shuffling numbers in a map and selecting one. Say you need
note: this question and the following answers refer to data.table versions < 1.5.3; v.
Question is following: I have an oracle trigger after row insert. From trigger, I
To simplify my question, let's say I have the following script: var sPath =
I ask this question following the issue I raised here . The point is
This question builds on the following question (s) Indexing : How do I construct
I've made a server/client application in C#. My question is the following: Let's say
I shortly asked the following question: Keep rows of data frame that match certain
Say I get the following question Console.WriteLine(Which teams have faced eachother? - use Red
Using entity framwork with lazy loading - Have the following question on loading related

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.