cancel
Showing results for 
Search instead for 
Did you mean: 

HTMLB Link usage, question

Former Member
0 Kudos

I am new to HTMLB, question

....

Button myButton = new Button("submitButton");

myButton.setOnClick("sendName");

myButton.setText("Go to Yahoo");

myButton.setTooltip("Click here to go to Yahoo.");

....

the implementation of onSendName

public void onSendName(Event myName) throws PageException {

String url = "http://www.yahoo.com";

Link lk = new Link("mylink", "yahoo");

lk.setReference("http://www.yahoo.com");

lk.setTarget("_blank");

??????? now what???

//How do I get to the link?

Please help fill in, appreciate:

}

If this is the not the right way, any other way to achieve this?

thanks much.

Dave Wang

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi @all,

I think if you want to generate Links inside a tableCell, you will have to use TableViewCellRenderer.

There is an example how to use a cellRenderer in the EP in HTMLB-Reference.

Regards,

Christian

Former Member
0 Kudos

Instead of using a button, how about using the HTMLB link?

Former Member
0 Kudos

Yes, Eric, thanks for the answer. in this case. I can substitute the button with a link. But

In another scenario, I have a tableview, then every cell clicked will lead to a url generated based on the content of the table cell,

for example, cell(1,2)="userABC", onCellClick() funciton will generate a Link to: "http://xxx?userid=userABC". When user clicks cell(1,2), it should go to the generated URL.

It would be great if I can generate the link then direct the browser to the URL at onCellClick().

How do I handle this case?

thanks for any suggestions.

Dave Wang