cancel
Showing results for 
Search instead for 
Did you mean: 

how to execute a url using a Link

Former Member
0 Kudos

hi

I have to execute the url. when the user enters a url in an inputfield and clicks on the link, the url that is entered in the input field should get executed. initially when the page is loaded a default url will be displayed in the inputfield, now when the user gives a new url and clicks on this link, this new url should get executed.

i am giving the sample code

InputField input = new InputField("url");

form.addComponent(input);

String TestUrl=input.getString().getValueAsString();

Link testApplicationLink = new Link("testurl");

testApplicationLink.setReference(TestUrl);

i am able to execute the url that is set when the page is loaded and not the new url that is modified by the user

thanks in advance

regards

Mani

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mani,

i suppose javascript can solve u r problem, just try this and check if this works

testApplicationLink.setOnClientClick("setUrlForTesting()");

<script language='JavaScript'>

function setUrlForTesting() {

var input = inputfield.getValue(); // JUST GET THE URL IN THE INPUT FILED

opnewwin = window.open(input.toString()); opnewwin.focus();

} </script>

reg

jag

Answers (1)

Answers (1)

Former Member
0 Kudos

You have to store the new url in some variable in ProcessAfterInput method and set the link to this new variable in ProcessBeforeOutput method.

I guess you are using PDK.

RK

Former Member
0 Kudos

Hi Radha Krishna Bodapati,

requirement is to perform a client side validation, because every time if it hits the server, i think the performance might go down.

regards

mani