Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java @ 14:fe2f4d1dd784
Integrated the httpclient for the communication between client and server. It is now possible to create a new WINFO artifact.
flys-client/trunk@1326 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 17 Feb 2011 11:52:55 +0000 |
parents | 8d9075c07667 |
children | f48b2cb2e219 |
comparison
equal
deleted
inserted
replaced
13:8d9075c07667 | 14:fe2f4d1dd784 |
---|---|
15 import com.smartgwt.client.widgets.tab.Tab; | 15 import com.smartgwt.client.widgets.tab.Tab; |
16 | 16 |
17 import de.intevation.flys.client.shared.model.Artifact; | 17 import de.intevation.flys.client.shared.model.Artifact; |
18 import de.intevation.flys.client.shared.model.Collection; | 18 import de.intevation.flys.client.shared.model.Collection; |
19 | 19 |
20 import de.intevation.flys.client.client.Config; | |
20 import de.intevation.flys.client.client.FLYS; | 21 import de.intevation.flys.client.client.FLYS; |
21 import de.intevation.flys.client.client.FLYSMessages; | 22 import de.intevation.flys.client.client.FLYSMessages; |
22 import de.intevation.flys.client.client.services.ArtifactService; | 23 import de.intevation.flys.client.client.services.ArtifactService; |
23 import de.intevation.flys.client.client.services.ArtifactServiceAsync; | 24 import de.intevation.flys.client.client.services.ArtifactServiceAsync; |
24 | 25 |
122 form.setFields(radio); | 123 form.setFields(radio); |
123 | 124 |
124 IButton go = new IButton(messages.next()); | 125 IButton go = new IButton(messages.next()); |
125 go.addClickHandler(new ClickHandler() { | 126 go.addClickHandler(new ClickHandler() { |
126 public void onClick(ClickEvent event) { | 127 public void onClick(ClickEvent event) { |
127 artifactService.create("winfo", new AsyncCallback<Artifact>() { | 128 String serverUrl = Config.getInstance().getServerUrl(); |
128 public void onFailure(Throwable caught) { | |
129 GWT.log("Could not create the new artifact."); | |
130 GWT.log(caught.getMessage()); | |
131 } | |
132 | 129 |
133 public void onSuccess(Artifact artifact) { | 130 artifactService.create( |
134 GWT.log("Successfully created a new artifact."); | 131 serverUrl, "winfo", |
135 setArtifact(artifact); | 132 new AsyncCallback<Artifact>() { |
136 } | 133 public void onFailure(Throwable caught) { |
134 GWT.log("Could not create the new artifact."); | |
135 GWT.log(caught.getMessage()); | |
136 } | |
137 | |
138 public void onSuccess(Artifact artifact) { | |
139 GWT.log("Successfully created a new artifact."); | |
140 setArtifact(artifact); | |
141 } | |
137 }); | 142 }); |
138 } | 143 } |
139 }); | 144 }); |
140 | 145 |
141 layout.addMember(form); | 146 layout.addMember(form); |