Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating urls value

Status
Not open for further replies.

niritbakshi

Programmer
Oct 16, 2000
9
IL
I need help in updating a URL object's value when a button is being pressed.
I have Textfield names tf and a url Object names page
I tried the following:
public void action(Event evt, Object arg) {
if (evt.target instanceof Button) {
page = tf.getText();
return true;
}
else return false;
}
}
But when i try to load the application it doesn't work.
Please help me! [sig][/sig]
 
If thc code you just wrote above is from an applet, then you can use showDocument(url) from the AplletContext class, and pass the value of the textfield as parameter in the last part of the URL. Then in server side you must implement a method that knows to modify the url object conforming the value of that parameter...
Something lige this:

.
.
.
AppletContext ac = this.getAppletContext();

public void action(Event evt, Object arg) {
if (evt.target instanceof Button) {
ac.showDocument(page + "?tf=" + tf.getText());
return true;
}
else return false;
}
}
.
.
.


The object page must be of URL type to work this piece of code

Sleepy
[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top