Simple hyperlink in GWT? - gwt

This should be simple, but somehow I can't find a way to create simple hyperlink in GWT. Basically, I want to load another page when users clicks on something.
Hyperlink seems to point to internal GWT application state only. I guess I could put the link in HTML code itself, but how do I create it in Java?

Anchor
this.add(new Anchor("www.stackoverflow.com"));

You're looking for Anchor.

Related

Open an external link in a wicket modal window

I'm pretty new to wicket, so apologies if this is very easy - I'd like to open an external link in a modal window. The url is fixed and isn't a lot more than a static page - how should I go about doing this?
My money would be on the Include component. Javadoc. Example in wicket examples
I'm afraid I didn't ever have to use this particular component, so I can't provide any more information, but it looks like you should be able to use it like any other wicket component with no particular complications.
Hope this helps!
you should have a look at ExternalLink. You can use it like so:
java:
ExternalLink link = new ExternalLink("linkid", "http://www.google.com");
add(link);
with html
Link
btw. Google is your friend when developing wicket. Lots of questions have already been asked, inlcuding this one.

Page Navigation in GWT Application

I want to navigate to another page in my application. I don't want the page to reload(i.e.. application should be a single URL application).
I know only one way to accomplish this by changing the proper div attached in the RootPanel by whatever data I want to display. But I fell that might get cumbersome if there are many navigations(I haven't tried it though :P).
Is there any other way to accomplish this or make the above said approach better?
Thanks in advance.
I guess you need GWT Development with Activities and Places
Well ,its time to have a look on MVP
With that you can do
History.newItem(tokenOfYourPresenterScreen);
A nice single EntryPoint demo app is here : (BrowserHistoryExample.java)
http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsHistory.html
I added the below to the example to demonstrate links.
vertPanel.add(new Label("Access history via Hyperlinks"));
vertPanel.add(new Hyperlink("External Page 0","page0"));
vertPanel.add(new Hyperlink("External Page 1","page1"));
vertPanel.add(new Hyperlink("External Page 2","page2"));

Auto form filling

I have a requirement like I need to fill an online form automatically. (Auto form filling).
Means I need to create an application in which clicking on the "Auto fill” button it will open the form in browser (form is another website page) and fill the data automatically.
The data (which may change each time) I will supply from my application. So first I thought of implementing the functionality using iMacro.
But later I realized I can’t call this imacro from an application if it is free version. So please suggest me some idea to achieve this functionality.
Thanks.
as far as i under stand your problem i would say try sikuli ..it just a simple you can say a compiler and a language which uses image recognition and you can make autobot through this and a very easy to learn ..

Go to a new page, but still have GWT variables?

In GWT, I would like to do something like a form submission that takes me to a new page, with new style sheet and new static elements, and when I get there, be able to extract the values of GWT variables still in GWT. In other words, I want to do most of the form processing on the client side instead of sending it to a servlet to be processed and sent back. Is that possible? Would FormPanel allow me to do that? How do I access the contents of the form fields in GWT on the new page?
I'm not sure I'm getting the right picture here, but I see several possibilities:
Pass the variables in the url like example.com/myform#create/param1/param2 or any other format you want, then read it using the History class
Use something like this - create an iframe from GWT (maybe put it in Lightbox or something similar), populate it the way you want using the current state of the app, and when the user is finished, he'll just close the (Lightbox) frame and get back to the main application
You could also pass around data in a "hidden" way (no visible data in the url or even through POST) using the window.name hack - there's even a sample implementation for GWT to get you started
ATM, I prefer the second option, since it goes best with the whole no refresh, same page, one app, GWT thing :) That is, unless I'm getting the wrong picture and you want to do something else.
GWT is really meant to be used for the whole application, where "pages" are replaced by application state and URL fragments, and "form submission" is replaced by AJAX calls.
If you want to validate form fields, this can easily be done with regular JS or a library like jQuery.
I'm not sure it I get you right either, but for what I'm receiving, having a new page to process the form is not the optimal design. The reason been that you might have to write different GWT app for that which mean overheads, and creating new window (or tab) will move the user's attention away from where they are. Why not using another page WITHIN gwt to process the form with tab panel or hidden panel?

Dynamic forms in zend?

hey, i'm stuck at a problem which is kind of similar to one that Erik asked about. I'm trying to create a dynamic form in zend and what i wanna do is that there should be a button which when clicked adds a new text box or any form element dynamically.
now the problem is that i'm new to zend framework. i'm using 1.9.7 right now. i've done some functionality like user registration and login etc but dojo and zend subform are completely alien to me. so i need your help. please guide me that where should i start and what would be the logic of this dynamic form.
regards,
furqan
These new elements should be instances of new Zend_Form_Subform to have server side validation working properly.
New subforms may be added via AJAX (see ajaxLink view helper) or to be already present on the page, but hidden with CSS+JavaScript.
I don't know a lot about zend, but if you want to do that on the client side, you can use dojo.place as described here.