Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/FLYSHeader.java @ 6602:244beb29418e
Fix for SAML authentication in FLYSHeader's Info button (#702).
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Thu, 18 Jul 2013 13:25:29 +0200 |
parents | c949681a0ccb |
children | 9f3ffb218bc0 |
comparison
equal
deleted
inserted
replaced
6601:5ecc6d4d73f2 | 6602:244beb29418e |
---|---|
10 | 10 |
11 import com.google.gwt.core.client.GWT; | 11 import com.google.gwt.core.client.GWT; |
12 import com.google.gwt.i18n.client.LocaleInfo; | 12 import com.google.gwt.i18n.client.LocaleInfo; |
13 import com.google.gwt.user.client.Window; | 13 import com.google.gwt.user.client.Window; |
14 import com.google.gwt.user.client.rpc.AsyncCallback; | 14 import com.google.gwt.user.client.rpc.AsyncCallback; |
15 import com.google.gwt.user.client.ui.HTML; | |
15 import com.smartgwt.client.types.Alignment; | 16 import com.smartgwt.client.types.Alignment; |
16 import com.smartgwt.client.types.VerticalAlignment; | 17 import com.smartgwt.client.types.VerticalAlignment; |
17 import com.smartgwt.client.util.BooleanCallback; | 18 import com.smartgwt.client.util.BooleanCallback; |
18 import com.smartgwt.client.util.SC; | 19 import com.smartgwt.client.util.SC; |
19 import com.smartgwt.client.widgets.Button; | 20 import com.smartgwt.client.widgets.Button; |
20 import com.smartgwt.client.widgets.Img; | 21 import com.smartgwt.client.widgets.Img; |
21 import com.smartgwt.client.widgets.Label; | 22 import com.smartgwt.client.widgets.Label; |
22 import com.smartgwt.client.widgets.events.ClickEvent; | 23 import com.smartgwt.client.widgets.events.ClickEvent; |
23 import com.smartgwt.client.widgets.events.ClickHandler; | 24 import com.smartgwt.client.widgets.events.ClickHandler; |
24 import com.smartgwt.client.widgets.form.DynamicForm; | |
25 import com.smartgwt.client.widgets.layout.HLayout; | 25 import com.smartgwt.client.widgets.layout.HLayout; |
26 | 26 |
27 import org.dive4elements.river.client.client.Config; | 27 import org.dive4elements.river.client.client.Config; |
28 import org.dive4elements.river.client.client.FLYS; | 28 import org.dive4elements.river.client.client.FLYS; |
29 import org.dive4elements.river.client.client.FLYSConstants; | 29 import org.dive4elements.river.client.client.FLYSConstants; |
134 }); | 134 }); |
135 | 135 |
136 info.addClickHandler(new ClickHandler() { | 136 info.addClickHandler(new ClickHandler() { |
137 @Override | 137 @Override |
138 public void onClick(ClickEvent event) { | 138 public void onClick(ClickEvent event) { |
139 GWT.log("Clicked 'info' button."); | |
140 String wikiLink = Config.getInstance().getWikiUrl() + "/Info"; | 139 String wikiLink = Config.getInstance().getWikiUrl() + "/Info"; |
141 | 140 |
142 // Create a dynamic form which contains the SAML session | 141 // Create a form which contains the SAML session |
143 // for the user which is currently logged in | 142 // for the user which is currently logged in |
144 DynamicForm df = WikiLinks.dynamicForm(getFlys(), wikiLink); | 143 String html = WikiLinks.imageLinkForm( |
145 info.addChild(df); // add the form somewhere | 144 getFlys(), wikiLink, "", "wikiLinkForm"); |
146 df.submitForm(); // submit the form to go to the wiki | 145 HTML htmlObj = new HTML(html); |
147 info.removeChild(df); // and remove the dynamic form | 146 info.addChild(htmlObj); |
147 fireWikiLinkSubmit(); | |
148 htmlObj.removeFromParent(); | |
148 } | 149 } |
149 }); | 150 }); |
150 init(); | 151 init(); |
151 } | 152 } |
153 | |
154 /** | |
155 * Calls the JS submit() function on the dynamically added | |
156 * wikiLinkForm. This is a workaround for a SmartGWT issue(?) that | |
157 * clears all form fields when using DynamicForm.submit() or .submitForm(). | |
158 */ | |
159 protected native void fireWikiLinkSubmit() /*-{ | |
160 $doc.wikiLinkForm.submit(); | |
161 }-*/; | |
152 | 162 |
153 public void init() { | 163 public void init() { |
154 setStyleName("header"); | 164 setStyleName("header"); |
155 setWidth100(); | 165 setWidth100(); |
156 setHeight(HEIGHT); | 166 setHeight(HEIGHT); |
208 } | 218 } |
209 | 219 |
210 right.addMember(userText); | 220 right.addMember(userText); |
211 right.addMember(logout); | 221 right.addMember(logout); |
212 right.addMember(language); | 222 right.addMember(language); |
213 // TEMPORARILY DEACTIVATED: The info button to link in wiki. | 223 right.addMember(info); |
214 // TODO (issue702) | |
215 //right.addMember(info); | |
216 right.addMember(bfg); | 224 right.addMember(bfg); |
217 | 225 |
218 addMember(left); | 226 addMember(left); |
219 addMember(right); | 227 addMember(right); |
220 } | 228 } |