Project

General

Profile

Defect #798 ยป latestVersionOfPluginPatch.txt

this patch includes non-committed changes for both this issue and Andrei Costecu's fix on issue #750 - H Hardut, 03/31/2014 09:43 AM

 
1
### Eclipse Workspace Patch 1.0
2
#P web_client_utils
3
Index: src/com/servoy/plugins/ReferencesBehaviorProvider.java
4
===================================================================
5
--- src/com/servoy/plugins/ReferencesBehaviorProvider.java	(revision 0)
6
+++ src/com/servoy/plugins/ReferencesBehaviorProvider.java	(working copy)
7
@@ -0,0 +1,209 @@
8
+/*
9
+ * BehaviorProvider.java
10
+ *
11
+ * Created on November 29, 2007, 1:23 PM
12
+ *
13
+ * To change this template, choose Tools | Template Manager
14
+ * and open the template in the editor.
15
+ */
16
+
17
+package com.servoy.plugins;
18
+
19
+import java.util.ArrayList;
20
+import java.util.List;
21
+
22
+import org.apache.wicket.Component;
23
+import org.apache.wicket.RequestCycle;
24
+import org.apache.wicket.ResourceReference;
25
+import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior;
26
+import org.apache.wicket.ajax.AjaxRequestTarget;
27
+import org.apache.wicket.markup.html.IHeaderResponse;
28
+import org.apache.wicket.util.string.Strings;
29
+
30
+import com.servoy.j2db.server.headlessclient.IWebClientPluginAccess;
31
+import com.servoy.j2db.ui.IProviderStylePropertyChanges;
32
+import com.servoy.j2db.ui.IStylePropertyChanges;
33
+
34
+/**
35
+ * A behavior that can link CSS and JS references to Wicket components.
36
+ * 
37
+ * @author Sean Devlin
38
+ * @author Servoy Stuff
39
+ * @author Andrei Costescu
40
+ */
41
+public class ReferencesBehaviorProvider extends AbstractDefaultAjaxBehavior {
42
+    
43
+	private static final long serialVersionUID = 7666601280436256255L;
44
+
45
+	protected final IWebClientPluginAccess app;
46
+
47
+	protected final List<Ref> references = new ArrayList<Ref>(2); // all reference types are kept in the order they were added (for example some js files need to load after a css file they use is loaded)
48
+	
49
+	protected static class Ref {
50
+		
51
+		public static final byte JS = 0;
52
+		public static final byte CSS = 1;
53
+		
54
+		protected final byte type;
55
+		protected final Object value;
56
+		
57
+		public Ref(byte type, Object value) {
58
+			this.type = type;
59
+			this.value = value;
60
+		}
61
+
62
+		@Override
63
+		public boolean equals(Object obj) {
64
+			if (this == obj)
65
+				return true;
66
+			if (obj == null)
67
+				return false;
68
+			if (getClass() != obj.getClass())
69
+				return false;
70
+			Ref other = (Ref) obj;
71
+			if (type != other.type)
72
+				return false;
73
+			if (value == null) {
74
+				if (other.value != null)
75
+					return false;
76
+			} else if (!value.equals(other.value))
77
+				return false;
78
+			return true;
79
+		}
80
+		
81
+	}
82
+
83
+    public ReferencesBehaviorProvider(IWebClientPluginAccess app) {
84
+		this.app = app;
85
+	}
86
+    
87
+    @Override
88
+    public void renderHead(IHeaderResponse response) {
89
+    	super.renderHead(response);
90
+		ResourceReference resourceReference = new ResourceReference("media");
91
+		String solutionName = app.getSolutionName();
92
+    	for (Ref ref : references) {
93
+    		if (Ref.JS == ref.type) {
94
+	    		if (ref.value instanceof ResourceReference) {
95
+	    			response.renderJavascriptReference((ResourceReference)ref.value);
96
+	    		} else {
97
+	    			response.renderJavascriptReference(Strings.replaceAll((String)ref.value, "media:///", RequestCycle.get().urlFor(resourceReference) + "?s=" + solutionName + "&amp;id=").toString());
98
+	    		}
99
+    		} else if (Ref.CSS == ref.type) {
100
+    			if (ref.value instanceof ResourceReference) {
101
+    				response.renderCSSReference((ResourceReference)ref.value);
102
+    			} else {
103
+    				response.renderCSSReference(Strings.replaceAll((String)ref.value, "media:///", RequestCycle.get().urlFor(resourceReference) + "?s=" + solutionName + "&amp;id=").toString());
104
+    			}
105
+    		}
106
+		}
107
+    }
108
+    
109
+    @Override
110
+    protected void respond(AjaxRequestTarget target) {
111
+    	// not interested
112
+    }
113
+    
114
+    protected int getReferencesCount()
115
+    {
116
+    	return references.size();
117
+    }
118
+
119
+    private void markComponentAsChanged(Component component) {
120
+    	// if the component is already showing mark it for re-render so that our behavior gets rendered as well
121
+    	Component c = component;
122
+    	while (c != null && !(c instanceof IProviderStylePropertyChanges))
123
+    	{
124
+    		c = c.getParent();
125
+    	}
126
+    	if (c instanceof IProviderStylePropertyChanges) {
127
+    		IStylePropertyChanges spc = ((IProviderStylePropertyChanges) c).getStylePropertyChanges();
128
+    		if (spc != null) spc.setChanged();
129
+    	}
130
+    }
131
+    
132
+	public void addCssReference(String url, Component component) {
133
+		if (url != null) {
134
+			Ref r = new Ref(Ref.CSS, url);
135
+			if (!references.contains(r)) {
136
+				if (getReferencesCount() == 0) component.add(this);
137
+				references.add(r);
138
+				markComponentAsChanged(component);
139
+			}
140
+		}
141
+	}
142
+
143
+	public void addJsReference(String url, Component component) {
144
+		if (url != null) {
145
+			Ref r = new Ref(Ref.JS, url);
146
+			if (!references.contains(r)) {
147
+				if (getReferencesCount() == 0) component.add(this);
148
+				references.add(r);
149
+				markComponentAsChanged(component);
150
+			}
151
+		}
152
+	}
153
+
154
+	public void addCssReference(ResourceReference ref, Component component) {
155
+		if (ref != null) {
156
+			Ref r = new Ref(Ref.CSS, ref);
157
+			if (!references.contains(r)) {
158
+				if (getReferencesCount() == 0) component.add(this);
159
+				references.add(r);
160
+				markComponentAsChanged(component);
161
+			}
162
+		}
163
+	}
164
+
165
+	public void addJsReference(ResourceReference ref, Component component) {
166
+		if (ref != null) {
167
+			Ref r = new Ref(Ref.JS, ref);
168
+			if (!references.contains(r)) {
169
+				if (getReferencesCount() == 0) component.add(this);
170
+				references.add(r);
171
+				markComponentAsChanged(component);
172
+			}
173
+		}
174
+	}
175
+
176
+	public void removeCssReference(ResourceReference ref, Component component) {
177
+		if (ref != null) {
178
+			Ref r = new Ref(Ref.CSS, ref);
179
+			if (references.remove(r)) {
180
+				if (getReferencesCount() == 0) component.remove(this);
181
+				markComponentAsChanged(component);
182
+			}
183
+		}
184
+	}
185
+
186
+	public void removeCssReference(String url, Component component) {
187
+		if (url != null) {
188
+			Ref r = new Ref(Ref.CSS, url);
189
+			if (references.remove(r)) {
190
+				if (getReferencesCount() == 0) component.remove(this);
191
+				markComponentAsChanged(component);
192
+			}
193
+		}
194
+	}
195
+
196
+	public void removeJsReference(ResourceReference ref, Component component) {
197
+		if (ref != null) {
198
+			Ref r = new Ref(Ref.JS, ref);
199
+			if (references.remove(r)) {
200
+				if (getReferencesCount() == 0) component.remove(this);
201
+				markComponentAsChanged(component);
202
+			}
203
+		}
204
+	}
205
+
206
+	public void removeJsReference(String url, Component component) {
207
+		if (url != null) {
208
+			Ref r = new Ref(Ref.JS, url);
209
+			if (references.remove(r)) {
210
+				if (getReferencesCount() == 0) component.remove(this);
211
+				markComponentAsChanged(component);
212
+			}
213
+		}
214
+	}
215
+    
216
+}
217
\ No newline at end of file
218
Index: src/com/servoy/plugins/BehaviorProvider.java
219
===================================================================
220
--- src/com/servoy/plugins/BehaviorProvider.java	(revision 54)
221
+++ src/com/servoy/plugins/BehaviorProvider.java	(working copy)
222
@@ -9,8 +9,7 @@
223
 
224
 package com.servoy.plugins;
225
 
226
-import java.util.ArrayList;
227
-import java.util.List;
228
+import java.lang.reflect.Method;
229
 import java.util.Map;
230
 import java.util.concurrent.ConcurrentHashMap;
231
 
232
@@ -17,15 +16,13 @@
233
 import org.apache.wicket.Request;
234
 import org.apache.wicket.RequestCycle;
235
 import org.apache.wicket.ResourceReference;
236
-import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior;
237
 import org.apache.wicket.ajax.AjaxRequestTarget;
238
-import org.apache.wicket.markup.html.IHeaderResponse;
239
 import org.apache.wicket.protocol.http.servlet.ServletWebRequest;
240
 import org.apache.wicket.request.RequestParameters;
241
-import org.apache.wicket.util.string.Strings;
242
 import org.mozilla.javascript.Function;
243
 
244
 import com.servoy.j2db.scripting.FunctionDefinition;
245
+import com.servoy.j2db.server.headlessclient.IPageContributor;
246
 import com.servoy.j2db.server.headlessclient.IWebClientPluginAccess;
247
 import com.servoy.j2db.server.headlessclient.dataui.WebEventExecutor;
248
 import com.servoy.j2db.util.Utils;
249
@@ -36,50 +33,19 @@
250
  * @author Sean Devlin
251
  * @author Servoy Stuff
252
  */
253
-public class BehaviorProvider extends AbstractDefaultAjaxBehavior {
254
+public class BehaviorProvider extends ReferencesBehaviorProvider {
255
     
256
-	private static final long serialVersionUID = 7666601280436256255L;
257
+	private static final long serialVersionUID = 7666601280436256256L;
258
 
259
-	public final static String CALLBACK_BEHAVIOR = "com.servoy.jscallback";
260
+	public final static String BEHAVIOR_ID = "com.servoy.jscallback";
261
 	
262
     protected Map<Integer,FunctionDefinition> callbacks = new ConcurrentHashMap<Integer,FunctionDefinition>();
263
-
264
-	protected final IWebClientPluginAccess app;
265
-
266
-	private final List<Object> jsReferences = new ArrayList<Object>(2);
267
-	private final List<Object> cssReferences = new ArrayList<Object>(2);
268
-
269
+	protected boolean showIndicator = true;
270
+	
271
     public BehaviorProvider(IWebClientPluginAccess app) {
272
-		this.app = app;
273
+		super(app);
274
 	}
275
     
276
-    @Override
277
-    public void renderHead(IHeaderResponse response) {
278
-    	super.renderHead(response);
279
-		ResourceReference resourceReference = new ResourceReference("media");
280
-		String solutionName = app.getSolutionName();
281
-    	for (Object url : jsReferences) {
282
-    		if (url instanceof ResourceReference)
283
-    		{
284
-    			response.renderJavascriptReference((ResourceReference)url);
285
-    		}
286
-    		else {
287
-    			url = Strings.replaceAll((String)url, "media:///", RequestCycle.get().urlFor(resourceReference) + "?s=" + solutionName + "&amp;id=");
288
-    			response.renderJavascriptReference(url.toString());
289
-    		}
290
-		}
291
-    	for (Object url : cssReferences) {
292
-			if (url instanceof ResourceReference)
293
-    		{
294
-    			response.renderCSSReference((ResourceReference)url);
295
-    		}
296
-    		else {
297
-				url = Strings.replaceAll((String)url, "media:///", RequestCycle.get().urlFor(resourceReference) + "?s=" + solutionName + "&amp;id=");
298
-    			response.renderCSSReference(url.toString());
299
-    		}
300
-		}
301
-    }
302
-
303
 	protected void respond(final AjaxRequestTarget target){   
304
         Request request = RequestCycle.get().getRequest();
305
 		final String param = request.getParameter("m");  
306
@@ -114,8 +80,6 @@
307
         }
308
     }
309
 	
310
-	private boolean showIndicator = true;
311
-	
312
     @Override
313
     protected String findIndicatorId() {
314
     	if (showIndicator)
315
@@ -126,7 +90,7 @@
316
     
317
 	public String getUrlForCallback(Function callback, String[] args, boolean showLoadingIndicator) {
318
 		// make sure it is added the the current page.
319
-		app.getPageContributor().addBehavior(CALLBACK_BEHAVIOR, this);
320
+		app.getPageContributor().addBehavior(BEHAVIOR_ID, this);
321
 
322
 		FunctionDefinition fd = addCallBack(callback);
323
 
324
@@ -183,41 +147,81 @@
325
     }
326
 
327
 	public void addCssReference(String url) {
328
-		app.getPageContributor().addBehavior(CALLBACK_BEHAVIOR, this);
329
-		if (url != null && !cssReferences.contains(url)) cssReferences.add(url);
330
+		if(!executeGlobalMethod("addGlobalCSSResourceReference", String.class, url)) {
331
+			app.getPageContributor().addBehavior(BEHAVIOR_ID, this);
332
+			if (url != null) {
333
+				Ref r = new Ref(Ref.CSS, url);
334
+				if (!references.contains(r)) references.add(r);
335
+			}
336
+		}
337
 	}
338
 
339
 	public void addJsReference(String url) {
340
-		app.getPageContributor().addBehavior(CALLBACK_BEHAVIOR, this);
341
-		if (url != null && !jsReferences.contains(url)) jsReferences.add(url);
342
+		if(!executeGlobalMethod("addGlobalJSResourceReference", String.class, url)) {
343
+			app.getPageContributor().addBehavior(BEHAVIOR_ID, this);
344
+			if (url != null) {
345
+				Ref r = new Ref(Ref.JS, url);
346
+				if (!references.contains(r)) references.add(r);
347
+			}
348
+		}
349
 	}
350
 
351
 	public void addCssReference(ResourceReference url) {
352
-		app.getPageContributor().addBehavior(CALLBACK_BEHAVIOR, this);
353
-		if (url != null && !cssReferences.contains(url)) cssReferences.add(url);
354
+		if(!executeGlobalMethod("addGlobalCSSResourceReference", ResourceReference.class, url)) {
355
+			app.getPageContributor().addBehavior(BEHAVIOR_ID, this);
356
+			if (url != null) {
357
+				Ref r = new Ref(Ref.CSS, url);
358
+				if (!references.contains(r)) references.add(r);
359
+			}
360
+		}
361
 	}
362
 
363
 	public void addJsReference(ResourceReference url) {
364
-		app.getPageContributor().addBehavior(CALLBACK_BEHAVIOR, this);
365
-		if (url != null && !jsReferences.contains(url)) jsReferences.add(url);
366
+		if(!executeGlobalMethod("addGlobalJSResourceReference", ResourceReference.class, url)) {
367
+			app.getPageContributor().addBehavior(BEHAVIOR_ID, this);
368
+			if (url != null) {
369
+				Ref r = new Ref(Ref.JS, url);
370
+				if (!references.contains(r)) references.add(r);
371
+			}
372
+		}
373
 	}
374
 
375
 	public void removeCssReference(ResourceReference url) {
376
-		cssReferences.remove(url);
377
+		if(!executeGlobalMethod("removeGlobalResourceReference", ResourceReference.class, url)) {
378
+			if (url != null) references.remove(new Ref(Ref.CSS, url));
379
+		}
380
 	}
381
 
382
 	public void removeCssReference(String url) {
383
-		 cssReferences.remove(url);
384
+		if(!executeGlobalMethod("removeGlobalResourceReference", String.class, url)) {
385
+			if (url != null) references.remove(new Ref(Ref.CSS, url));
386
+		}
387
 	}
388
 
389
 	public void removeJsReference(ResourceReference url) {
390
-		jsReferences.remove(url);		
391
+		if(!executeGlobalMethod("removeGlobalResourceReference", ResourceReference.class, url)) {
392
+			if (url != null) references.remove(new Ref(Ref.JS, url));
393
+		}
394
 	}
395
 
396
 	public void removeJsReference(String url) {
397
-		jsReferences.remove(url);
398
+		if(!executeGlobalMethod("removeGlobalResourceReference", String.class, url)) {
399
+			if (url != null) references.remove(new Ref(Ref.JS, url));
400
+		}
401
 	}
402
     
403
+	private boolean executeGlobalMethod(String methodName, Class<?> parameterType, Object url) {
404
+		try {
405
+			IPageContributor pageContributor = app.getPageContributor();
406
+			Class<? extends IPageContributor> clazz = pageContributor.getClass();
407
+			Method m = clazz.getDeclaredMethod(methodName, new Class[]{ parameterType });
408
+			m.invoke(pageContributor, new Object[] { url });
409
+			return true;
410
+		} catch (Exception e) {
411
+			return false;
412
+		}
413
+	}
414
+	
415
 	/*
416
 	public interface ILatestPageBehaviorListener extends IBehaviorListener
417
 	{
418
Index: src/com/servoy/plugins/IWebClientProvider.java
419
===================================================================
420
--- src/com/servoy/plugins/IWebClientProvider.java	(revision 54)
421
+++ src/com/servoy/plugins/IWebClientProvider.java	(working copy)
422
@@ -3,7 +3,8 @@
423
 import org.apache.wicket.ResourceReference;
424
 import org.mozilla.javascript.Function;
425
 
426
-import com.servoy.j2db.scripting.IScriptObject;
427
+import com.servoy.j2db.scripting.IReturnedTypesProvider;
428
+import com.servoy.j2db.scripting.IScriptable;
429
 
430
 /**
431
  * Defines the provider's contract
432
@@ -10,17 +11,17 @@
433
  * 
434
  * @author sean
435
  */
436
-public interface IWebClientProvider extends IScriptObject {
437
+public interface IWebClientProvider extends IScriptable, IReturnedTypesProvider {
438
 	
439
 	public String executeJS(final String js, final Function callback, final String[] args);
440
 	public String addCallback(final Function callback, final String[] args, boolean showLoadingIndicator);
441
-	public void addCssReference(String url);
442
-	public void addCssReference(ResourceReference url);
443
-	public void removeCssReference(String url);
444
-	public void removeCssReference(ResourceReference url);
445
-	public void addJsReference(String url);
446
-	public void addJsReference(ResourceReference url);
447
-	public void removeJsReference(String url);
448
-	public void removeJsReference(ResourceReference url);
449
+	public void internalAddCssReference(String url);
450
+	public void internalAddCssReference(ResourceReference url);
451
+	public void internalRemoveCssReference(String url);
452
+	public void internalRemoveCssReference(ResourceReference url);
453
+	public void internalAddJsReference(String url);
454
+	public void internalAddJsReference(ResourceReference url);
455
+	public void internalRemoveJsReference(String url);
456
+	public void internalRemoveJsReference(ResourceReference url);
457
 	
458
 }
459
Index: src/com/servoy/plugins/servoy-extension.warnings.txt
460
===================================================================
461
--- src/com/servoy/plugins/servoy-extension.warnings.txt	(revision 0)
462
+++ src/com/servoy/plugins/servoy-extension.warnings.txt	(working copy)
463
@@ -0,0 +1,67 @@
464
+65 warnings
465
+
466
+EmptyTag - boolean com.servoy.plugins.WebClientProvider.isMarkupVisible(Object element): @return is empty.
467
+EmptyTag - java.lang.String com.servoy.plugins.WebClientProvider.addCallback(Function callbackMethod): @return is empty.
468
+EmptyTag - java.lang.String com.servoy.plugins.WebClientProvider.addCallback(Function callbackMethod, String[] argArray): @return is empty.
469
+EmptyTag - java.lang.String com.servoy.plugins.WebClientProvider.generateCallbackScript(Function callbackMethod): @return is empty.
470
+EmptyTag - java.lang.String com.servoy.plugins.WebClientProvider.generateCallbackScript(Function callbackMethod, String[] argArray): @return is empty.
471
+EmptyTag - java.lang.String com.servoy.plugins.WebClientProvider.generateCallbackScript(Function callbackMethod, String[] argArray, boolean showIndicator): @return is empty.
472
+EmptyTag - java.lang.String com.servoy.plugins.WebClientProvider.getElementMarkupId(Object formElement): @return is empty.
473
+EmptyTag - java.lang.String com.servoy.plugins.WebClientProvider.getJSONCallbackURL(Function function): @return is empty.
474
+EmptyTag - java.lang.String com.servoy.plugins.WebClientProvider.getJSONCallbackURL(Function function, Scriptable parametersObject): @return is empty.
475
+EmptyTag - java.lang.String com.servoy.plugins.WebClientProvider.getVersion(): @return is empty.
476
+EmptyTag - java.lang.String com.servoy.plugins.WebClientProvider.getXMLCallbackURL(Function function): @return is empty.
477
+EmptyTag - java.lang.String com.servoy.plugins.WebClientProvider.getXMLCallbackURL(Function function, Scriptable parametersObject): @return is empty.
478
+ParamTagWithoutContent - boolean com.servoy.plugins.WebClientProvider.isMarkupVisible(Object element): @param tag without text: 'element'.
479
+ParamTagWithoutContent - java.lang.String com.servoy.plugins.WebClientProvider.addCallback(Function callbackMethod): @param tag without text: 'callbackMethod'.
480
+ParamTagWithoutContent - java.lang.String com.servoy.plugins.WebClientProvider.addCallback(Function callbackMethod, String[] argArray): @param tag without text: 'argArray'.
481
+ParamTagWithoutContent - java.lang.String com.servoy.plugins.WebClientProvider.addCallback(Function callbackMethod, String[] argArray): @param tag without text: 'callbackMethod'.
482
+ParamTagWithoutContent - java.lang.String com.servoy.plugins.WebClientProvider.generateCallbackScript(Function callbackMethod): @param tag without text: 'callbackMethod'.
483
+ParamTagWithoutContent - java.lang.String com.servoy.plugins.WebClientProvider.generateCallbackScript(Function callbackMethod, String[] argArray): @param tag without text: 'argArray'.
484
+ParamTagWithoutContent - java.lang.String com.servoy.plugins.WebClientProvider.generateCallbackScript(Function callbackMethod, String[] argArray): @param tag without text: 'callbackMethod'.
485
+ParamTagWithoutContent - java.lang.String com.servoy.plugins.WebClientProvider.generateCallbackScript(Function callbackMethod, String[] argArray, boolean showIndicator): @param tag without text: 'argArray'.
486
+ParamTagWithoutContent - java.lang.String com.servoy.plugins.WebClientProvider.generateCallbackScript(Function callbackMethod, String[] argArray, boolean showIndicator): @param tag without text: 'callbackMethod'.
487
+ParamTagWithoutContent - java.lang.String com.servoy.plugins.WebClientProvider.generateCallbackScript(Function callbackMethod, String[] argArray, boolean showIndicator): @param tag without text: 'showIndicator'.
488
+ParamTagWithoutContent - java.lang.String com.servoy.plugins.WebClientProvider.getElementMarkupId(Object formElement): @param tag without text: 'formElement'.
489
+ParamTagWithoutContent - java.lang.String com.servoy.plugins.WebClientProvider.getJSONCallbackURL(Function function): @param tag without text: 'function'.
490
+ParamTagWithoutContent - java.lang.String com.servoy.plugins.WebClientProvider.getJSONCallbackURL(Function function, Scriptable parametersObject): @param tag without text: 'funtion'.
491
+ParamTagWithoutContent - java.lang.String com.servoy.plugins.WebClientProvider.getJSONCallbackURL(Function function, Scriptable parametersObject): @param tag without text: 'parametersObject'.
492
+ParamTagWithoutContent - java.lang.String com.servoy.plugins.WebClientProvider.getXMLCallbackURL(Function function): @param tag without text: 'function'.
493
+ParamTagWithoutContent - java.lang.String com.servoy.plugins.WebClientProvider.getXMLCallbackURL(Function function, Scriptable parametersObject): @param tag without text: 'function'.
494
+ParamTagWithoutContent - java.lang.String com.servoy.plugins.WebClientProvider.getXMLCallbackURL(Function function, Scriptable parametersObject): @param tag without text: 'parametersObject'.
495
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.addCssReference(ResourceReference webResourceReference): @param tag without text: 'webResourceReference'.
496
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.addCssReference(ResourceReference webResourceReference, Object formOrElement): @param tag without text: 'formOrElement'.
497
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.addCssReference(ResourceReference webResourceReference, Object formOrElement): @param tag without text: 'webResourceReference'.
498
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.addCssReference(String stringReference): @param tag without text: 'stringReference'.
499
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.addCssReference(String stringReference, Object formOrElement): @param tag without text: 'formOrElement'.
500
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.addCssReference(String stringReference, Object formOrElement): @param tag without text: 'stringReference'.
501
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.addJsReference(ResourceReference webResourceReference): @param tag without text: 'webResourceReference'.
502
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.addJsReference(ResourceReference webResourceReference, Object formOrElement): @param tag without text: 'formOrElement'.
503
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.addJsReference(ResourceReference webResourceReference, Object formOrElement): @param tag without text: 'webResourceReference'.
504
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.addJsReference(String stringReference): @param tag without text: 'stringReference'.
505
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.addJsReference(String stringReference, Object formOrElement): @param tag without text: 'formOrElement'.
506
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.addJsReference(String stringReference, Object formOrElement): @param tag without text: 'stringReference'.
507
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.executeClientSideJS(String jsToExecute): @param tag without text: 'jsToExecute'.
508
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.executeClientSideJS(String jsToExecute, Function callbackMethod): @param tag without text: 'callbackMethod'.
509
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.executeClientSideJS(String jsToExecute, Function callbackMethod): @param tag without text: 'jsToExecute'.
510
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.executeClientSideJS(String jsToExecute, Function callbackMethod, String[] argArray): @param tag without text: 'argArray'.
511
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.executeClientSideJS(String jsToExecute, Function callbackMethod, String[] argArray): @param tag without text: 'callbackMethod'.
512
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.executeClientSideJS(String jsToExecute, Function callbackMethod, String[] argArray): @param tag without text: 'jsToExecute'.
513
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.removeCssReference(ResourceReference webResourceReference): @param tag without text: 'webResourceReference'.
514
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.removeCssReference(ResourceReference webResourceReference, Object formOrElement): @param tag without text: 'formOrElement'.
515
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.removeCssReference(ResourceReference webResourceReference, Object formOrElement): @param tag without text: 'webResourceReference'.
516
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.removeCssReference(String stringReference): @param tag without text: 'stringReference'.
517
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.removeCssReference(String stringReference, Object formOrElement): @param tag without text: 'formOrElement'.
518
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.removeCssReference(String stringReference, Object formOrElement): @param tag without text: 'stringReference'.
519
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.removeExtraCssClass(Object element): @param tag without text: 'element'.
520
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.removeJsReference(ResourceReference webResourceReference): @param tag without text: 'webResourceReference'.
521
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.removeJsReference(ResourceReference webResourceReference, Object formOrElement): @param tag without text: 'formOrElement'.
522
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.removeJsReference(ResourceReference webResourceReference, Object formOrElement): @param tag without text: 'webResourceReference'.
523
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.removeJsReference(String stringReference): @param tag without text: 'stringReference'.
524
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.removeJsReference(String stringReference, Object formOrElement): @param tag without text: 'formOrElement'.
525
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.removeJsReference(String stringReference, Object formOrElement): @param tag without text: 'stringReference'.
526
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.setExtraCssClass(Object element, String classAttribute): @param tag without text: 'classAttribute'.
527
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.setExtraCssClass(Object element, String classAttribute): @param tag without text: 'element'.
528
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.setMarkupVisible(Object element, boolean visibility): @param tag without text: 'element'.
529
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.setMarkupVisible(Object element, boolean visibility): @param tag without text: 'visibility'.
530
+ParamTagWithoutContent - void com.servoy.plugins.WebClientProvider.setRendered(Object element): @param tag without text: 'element'.
531
Index: src/com/servoy/plugins/servoy-extension.xml
532
===================================================================
533
--- src/com/servoy/plugins/servoy-extension.xml	(revision 0)
534
+++ src/com/servoy/plugins/servoy-extension.xml	(working copy)
535
@@ -0,0 +1,787 @@
536
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
537
+<servoyextension>
538
+  <servoydoc>
539
+    <plugins>
540
+      <object clientSupport="wc,sc" publicName="WebClientUtils" qualifiedName="com.servoy.plugins.WebClientProvider" scriptingName="plugins.WebClientUtils">
541
+        <functions>
542
+          <function clientSupport="wc,sc" deprecated="true" name="addCallback" undocumented="true">
543
+            <argumentsTypes>
544
+              <argumentType typecode="org.mozilla.javascript.Function"/>
545
+            </argumentsTypes>
546
+            <return type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
547
+            <parameters>
548
+              <parameter name="callbackMethod" type="com.servoy.j2db.documentation.scripting.docs.Function" typecode="org.mozilla.javascript.Function"/>
549
+            </parameters>
550
+          </function>
551
+          <function clientSupport="wc,sc" deprecated="true" name="addCallback" undocumented="true">
552
+            <argumentsTypes>
553
+              <argumentType typecode="org.mozilla.javascript.Function"/>
554
+              <argumentType typecode="[Ljava.lang.String;"/>
555
+            </argumentsTypes>
556
+            <return type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
557
+            <parameters>
558
+              <parameter name="callbackMethod" type="com.servoy.j2db.documentation.scripting.docs.Function" typecode="org.mozilla.javascript.Function"/>
559
+              <parameter name="argArray" type="com.servoy.j2db.documentation.scripting.docs.String[]" typecode="[Ljava.lang.String;"/>
560
+            </parameters>
561
+          </function>
562
+          <function clientSupport="wc,sc" name="addCssReference">
563
+            <argumentsTypes>
564
+              <argumentType typecode="java.lang.String"/>
565
+            </argumentsTypes>
566
+            <return type="void" typecode="void"/>
567
+            <descriptions>
568
+              <description clientSupport="wc,sc"><![CDATA[Adds a global (or form/element when the second arg. is provided) css url.
569
+Note: up to plugin version v1.3.6, global references had a bug - they were only added to current request's page (each time the API was used).]]></description>
570
+            </descriptions>
571
+            <summaries>
572
+              <summary clientSupport="wc,sc"><![CDATA[Adds a global (or form/element when the second arg.]]></summary>
573
+            </summaries>
574
+            <samples>
575
+              <sample clientSupport="wc,sc"><![CDATA[// add global reference (to all pages)
576
+%%elementName%%.addCssReference('http://yourserver.com/css/yourstyle.css');
577
+//add form reference
578
+%%elementName%%.addCssReference('http://yourserver.com/css/yourstyle.css', forms.myFormWithSpecialCSS);
579
+//add form element reference
580
+%%elementName%%.addCssReference('http://yourserver.com/css/yourstyle.css', elements.myElementWithSpecialCSS);]]></sample>
581
+            </samples>
582
+            <parameters>
583
+              <parameter name="stringReference" type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
584
+            </parameters>
585
+          </function>
586
+          <function clientSupport="wc,sc" name="addCssReference">
587
+            <argumentsTypes>
588
+              <argumentType typecode="java.lang.String"/>
589
+              <argumentType typecode="java.lang.Object"/>
590
+            </argumentsTypes>
591
+            <return type="void" typecode="void"/>
592
+            <descriptions>
593
+              <description clientSupport="wc,sc"><![CDATA[Adds a global (or form/element when the second arg. is provided) css url.
594
+Note: up to plugin version v1.3.6, global references had a bug - they were only added to current request's page (each time the API was used).]]></description>
595
+            </descriptions>
596
+            <summaries>
597
+              <summary clientSupport="wc,sc"><![CDATA[Adds a global (or form/element when the second arg.]]></summary>
598
+            </summaries>
599
+            <samples>
600
+              <sample clientSupport="wc,sc"><![CDATA[// add global reference (to all pages)
601
+%%elementName%%.addCssReference('http://yourserver.com/css/yourstyle.css');
602
+//add form reference
603
+%%elementName%%.addCssReference('http://yourserver.com/css/yourstyle.css', forms.myFormWithSpecialCSS);
604
+//add form element reference
605
+%%elementName%%.addCssReference('http://yourserver.com/css/yourstyle.css', elements.myElementWithSpecialCSS);]]></sample>
606
+            </samples>
607
+            <parameters>
608
+              <parameter name="stringReference" type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
609
+              <parameter name="formOrElement" type="com.servoy.j2db.documentation.scripting.docs.Object" typecode="java.lang.Object"/>
610
+            </parameters>
611
+          </function>
612
+          <function clientSupport="wc,sc" name="addCssReference">
613
+            <argumentsTypes>
614
+              <argumentType typecode="org.apache.wicket.ResourceReference"/>
615
+            </argumentsTypes>
616
+            <return type="void" typecode="void"/>
617
+            <descriptions>
618
+              <description clientSupport="wc,sc"><![CDATA[Adds a built-in servoy css reference (see SERVOY_WEB_RESOURCES) to all pages (when global) or only to pages containing that form/element (when the second arg. is provided).
619
+Note: up to plugin version v1.3.6, global references had a bug - they were only added to current request's page (each time the API was used).]]></description>
620
+            </descriptions>
621
+            <summaries>
622
+              <summary clientSupport="wc,sc"><![CDATA[Adds a built-in servoy css reference (see SERVOY_WEB_RESOURCES) to all pages (when global) or only to pages containing that form/element (when the second arg.]]></summary>
623
+            </summaries>
624
+            <samples>
625
+              <sample clientSupport="wc,sc"><![CDATA[// add Servoy internal CSS style sheets (like Yahoo UI widgets styles)
626
+// Note that Yahoo UI widgets are only present from Servoy 60 and higer.
627
+%%elementName%%.addCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU)
628
+//add form reference
629
+%%elementName%%.addCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU, forms.myFormWithSpecialCSS);
630
+//add form element reference
631
+%%elementName%%.addCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU, elements.myElementWithSpecialCSS);]]></sample>
632
+            </samples>
633
+            <parameters>
634
+              <parameter name="webResourceReference" type="org.apache.wicket.ResourceReference" typecode="org.apache.wicket.ResourceReference"/>
635
+            </parameters>
636
+          </function>
637
+          <function clientSupport="wc,sc" name="addCssReference">
638
+            <argumentsTypes>
639
+              <argumentType typecode="org.apache.wicket.ResourceReference"/>
640
+              <argumentType typecode="java.lang.Object"/>
641
+            </argumentsTypes>
642
+            <return type="void" typecode="void"/>
643
+            <descriptions>
644
+              <description clientSupport="wc,sc"><![CDATA[Adds a built-in servoy css reference (see SERVOY_WEB_RESOURCES) to all pages (when global) or only to pages containing that form/element (when the second arg. is provided).
645
+Note: up to plugin version v1.3.6, global references had a bug - they were only added to current request's page (each time the API was used).]]></description>
646
+            </descriptions>
647
+            <summaries>
648
+              <summary clientSupport="wc,sc"><![CDATA[Adds a built-in servoy css reference (see SERVOY_WEB_RESOURCES) to all pages (when global) or only to pages containing that form/element (when the second arg.]]></summary>
649
+            </summaries>
650
+            <samples>
651
+              <sample clientSupport="wc,sc"><![CDATA[// add Servoy internal CSS style sheets (like Yahoo UI widgets styles)
652
+// Note that Yahoo UI widgets are only present from Servoy 60 and higer.
653
+%%elementName%%.addCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU)
654
+//add form reference
655
+%%elementName%%.addCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU, forms.myFormWithSpecialCSS);
656
+//add form element reference
657
+%%elementName%%.addCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU, elements.myElementWithSpecialCSS);]]></sample>
658
+            </samples>
659
+            <parameters>
660
+              <parameter name="webResourceReference" type="org.apache.wicket.ResourceReference" typecode="org.apache.wicket.ResourceReference"/>
661
+              <parameter name="formOrElement" type="com.servoy.j2db.documentation.scripting.docs.Object" typecode="java.lang.Object"/>
662
+            </parameters>
663
+          </function>
664
+          <function clientSupport="wc,sc" name="addJsReference">
665
+            <argumentsTypes>
666
+              <argumentType typecode="java.lang.String"/>
667
+            </argumentsTypes>
668
+            <return type="void" typecode="void"/>
669
+            <descriptions>
670
+              <description clientSupport="wc,sc"><![CDATA[Adds a global (or form/element when the second arg. is provided) javascript url.
671
+Note: up to plugin version v1.3.6, global references had a bug - they were only added to current request's page (each time the API was used).]]></description>
672
+            </descriptions>
673
+            <summaries>
674
+              <summary clientSupport="wc,sc"><![CDATA[Adds a global (or form/element when the second arg.]]></summary>
675
+            </summaries>
676
+            <samples>
677
+              <sample clientSupport="wc,sc"><![CDATA[// add global reference (to all pages)
678
+%%elementName%%.addJsReference('http://yourserver.com/js/yourscript.js');
679
+//add form reference
680
+%%elementName%%.addJsReference('http://yourserver.com/js/yourscript.js', forms.myFormWithSpecialJS);
681
+//add form element reference
682
+%%elementName%%.addJsReference('http://yourserver.com/js/yourscript.js', elements.myElementWithSpecialJS);]]></sample>
683
+            </samples>
684
+            <parameters>
685
+              <parameter name="stringReference" type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
686
+            </parameters>
687
+          </function>
688
+          <function clientSupport="wc,sc" name="addJsReference">
689
+            <argumentsTypes>
690
+              <argumentType typecode="java.lang.String"/>
691
+              <argumentType typecode="java.lang.Object"/>
692
+            </argumentsTypes>
693
+            <return type="void" typecode="void"/>
694
+            <descriptions>
695
+              <description clientSupport="wc,sc"><![CDATA[Adds a global (or form/element when the second arg. is provided) javascript url.
696
+Note: up to plugin version v1.3.6, global references had a bug - they were only added to current request's page (each time the API was used).]]></description>
697
+            </descriptions>
698
+            <summaries>
699
+              <summary clientSupport="wc,sc"><![CDATA[Adds a global (or form/element when the second arg.]]></summary>
700
+            </summaries>
701
+            <samples>
702
+              <sample clientSupport="wc,sc"><![CDATA[// add global reference (to all pages)
703
+%%elementName%%.addJsReference('http://yourserver.com/js/yourscript.js');
704
+//add form reference
705
+%%elementName%%.addJsReference('http://yourserver.com/js/yourscript.js', forms.myFormWithSpecialJS);
706
+//add form element reference
707
+%%elementName%%.addJsReference('http://yourserver.com/js/yourscript.js', elements.myElementWithSpecialJS);]]></sample>
708
+            </samples>
709
+            <parameters>
710
+              <parameter name="stringReference" type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
711
+              <parameter name="formOrElement" type="com.servoy.j2db.documentation.scripting.docs.Object" typecode="java.lang.Object"/>
712
+            </parameters>
713
+          </function>
714
+          <function clientSupport="wc,sc" name="addJsReference">
715
+            <argumentsTypes>
716
+              <argumentType typecode="org.apache.wicket.ResourceReference"/>
717
+            </argumentsTypes>
718
+            <return type="void" typecode="void"/>
719
+            <descriptions>
720
+              <description clientSupport="wc,sc"><![CDATA[Adds a built-in servoy javascript reference (see SERVOY_WEB_RESOURCES) to all pages (when global) or only to pages containing that form/element (when the second arg. is provided).
721
+Note: up to plugin version v1.3.6, global references had a bug - they were only added to current request's page (each time the API was used).]]></description>
722
+            </descriptions>
723
+            <summaries>
724
+              <summary clientSupport="wc,sc"><![CDATA[Adds a built-in servoy javascript reference (see SERVOY_WEB_RESOURCES) to all pages (when global) or only to pages containing that form/element (when the second arg.]]></summary>
725
+            </summaries>
726
+            <samples>
727
+              <sample clientSupport="wc,sc"><![CDATA[// add Servoy internal reference scripts (like Yahoo UI widgets)
728
+// Note that Yahoo UI widgets are only present from Servoy 60 and higer.
729
+%%elementName%%.addJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU);
730
+//add form reference
731
+%%elementName%%.addJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU, forms.myFormWithSpecialJS);
732
+//add form element reference
733
+%%elementName%%.addJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU, elements.myElementWithSpecialJS);]]></sample>
734
+            </samples>
735
+            <parameters>
736
+              <parameter name="webResourceReference" type="org.apache.wicket.ResourceReference" typecode="org.apache.wicket.ResourceReference"/>
737
+            </parameters>
738
+          </function>
739
+          <function clientSupport="wc,sc" name="addJsReference">
740
+            <argumentsTypes>
741
+              <argumentType typecode="org.apache.wicket.ResourceReference"/>
742
+              <argumentType typecode="java.lang.Object"/>
743
+            </argumentsTypes>
744
+            <return type="void" typecode="void"/>
745
+            <descriptions>
746
+              <description clientSupport="wc,sc"><![CDATA[Adds a built-in servoy javascript reference (see SERVOY_WEB_RESOURCES) to all pages (when global) or only to pages containing that form/element (when the second arg. is provided).
747
+Note: up to plugin version v1.3.6, global references had a bug - they were only added to current request's page (each time the API was used).]]></description>
748
+            </descriptions>
749
+            <summaries>
750
+              <summary clientSupport="wc,sc"><![CDATA[Adds a built-in servoy javascript reference (see SERVOY_WEB_RESOURCES) to all pages (when global) or only to pages containing that form/element (when the second arg.]]></summary>
751
+            </summaries>
752
+            <samples>
753
+              <sample clientSupport="wc,sc"><![CDATA[// add Servoy internal reference scripts (like Yahoo UI widgets)
754
+// Note that Yahoo UI widgets are only present from Servoy 60 and higer.
755
+%%elementName%%.addJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU);
756
+//add form reference
757
+%%elementName%%.addJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU, forms.myFormWithSpecialJS);
758
+//add form element reference
759
+%%elementName%%.addJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU, elements.myElementWithSpecialJS);]]></sample>
760
+            </samples>
761
+            <parameters>
762
+              <parameter name="webResourceReference" type="org.apache.wicket.ResourceReference" typecode="org.apache.wicket.ResourceReference"/>
763
+              <parameter name="formOrElement" type="com.servoy.j2db.documentation.scripting.docs.Object" typecode="java.lang.Object"/>
764
+            </parameters>
765
+          </function>
766
+          <function clientSupport="wc,sc" name="executeClientSideJS">
767
+            <argumentsTypes>
768
+              <argumentType typecode="java.lang.String"/>
769
+            </argumentsTypes>
770
+            <return type="void" typecode="void"/>
771
+            <descriptions>
772
+              <description clientSupport="wc,sc"><![CDATA[Executes Client-Side Javascript with optional callback on server.]]></description>
773
+            </descriptions>
774
+            <summaries>
775
+              <summary clientSupport="wc,sc"><![CDATA[Executes Client-Side Javascript with optional callback on server.]]></summary>
776
+            </summaries>
777
+            <samples>
778
+              <sample clientSupport="wc,sc"><![CDATA[// ex 1) Execute simple Client-Side Javascript (Web-Client only)
779
+var jsToExecute = \"alert('Hello World: Called From Servoy Method!');
780
+plugins.WebClientUtils.executeClientSideJS(jsToExecute)
781
+// ex 2) Execute client-side script w/ callback
782
+// Add two numbers on the client and send the result to the server.
783
+// You can send an array of literals back to the server and into a callback method.
784
+// (Literals will be evaluated on the client first)
785
+var jsToExecute = \"var sum = 1 + 2\";
786
+%%elementName%%.executeClientSideJS(jsToExecute, myCallBackMethod, ['sum']);]]></sample>
787
+            </samples>
788
+            <parameters>
789
+              <parameter name="jsToExecute" type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
790
+            </parameters>
791
+          </function>
792
+          <function clientSupport="wc,sc" name="executeClientSideJS">
793
+            <argumentsTypes>
794
+              <argumentType typecode="java.lang.String"/>
795
+              <argumentType typecode="org.mozilla.javascript.Function"/>
796
+            </argumentsTypes>
797
+            <return type="void" typecode="void"/>
798
+            <descriptions>
799
+              <description clientSupport="wc,sc"><![CDATA[Executes Client-Side Javascript with optional callback on server.]]></description>
800
+            </descriptions>
801
+            <summaries>
802
+              <summary clientSupport="wc,sc"><![CDATA[Executes Client-Side Javascript with optional callback on server.]]></summary>
803
+            </summaries>
804
+            <samples>
805
+              <sample clientSupport="wc,sc"><![CDATA[// ex 1) Execute simple Client-Side Javascript (Web-Client only)
806
+var jsToExecute = \"alert('Hello World: Called From Servoy Method!');
807
+plugins.WebClientUtils.executeClientSideJS(jsToExecute)
808
+// ex 2) Execute client-side script w/ callback
809
+// Add two numbers on the client and send the result to the server.
810
+// You can send an array of literals back to the server and into a callback method.
811
+// (Literals will be evaluated on the client first)
812
+var jsToExecute = \"var sum = 1 + 2\";
813
+%%elementName%%.executeClientSideJS(jsToExecute, myCallBackMethod, ['sum']);]]></sample>
814
+            </samples>
815
+            <parameters>
816
+              <parameter name="jsToExecute" type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
817
+              <parameter name="callbackMethod" type="com.servoy.j2db.documentation.scripting.docs.Function" typecode="org.mozilla.javascript.Function"/>
818
+            </parameters>
819
+          </function>
820
+          <function clientSupport="wc,sc" name="executeClientSideJS">
821
+            <argumentsTypes>
822
+              <argumentType typecode="java.lang.String"/>
823
+              <argumentType typecode="org.mozilla.javascript.Function"/>
824
+              <argumentType typecode="[Ljava.lang.String;"/>
825
+            </argumentsTypes>
826
+            <return type="void" typecode="void"/>
827
+            <descriptions>
828
+              <description clientSupport="wc,sc"><![CDATA[Executes Client-Side Javascript with optional callback on server.]]></description>
829
+            </descriptions>
830
+            <summaries>
831
+              <summary clientSupport="wc,sc"><![CDATA[Executes Client-Side Javascript with optional callback on server.]]></summary>
832
+            </summaries>
833
+            <samples>
834
+              <sample clientSupport="wc,sc"><![CDATA[// ex 1) Execute simple Client-Side Javascript (Web-Client only)
835
+var jsToExecute = \"alert('Hello World: Called From Servoy Method!');
836
+plugins.WebClientUtils.executeClientSideJS(jsToExecute)
837
+// ex 2) Execute client-side script w/ callback
838
+// Add two numbers on the client and send the result to the server.
839
+// You can send an array of literals back to the server and into a callback method.
840
+// (Literals will be evaluated on the client first)
841
+var jsToExecute = \"var sum = 1 + 2\";
842
+%%elementName%%.executeClientSideJS(jsToExecute, myCallBackMethod, ['sum']);]]></sample>
843
+            </samples>
844
+            <parameters>
845
+              <parameter name="jsToExecute" type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
846
+              <parameter name="callbackMethod" type="com.servoy.j2db.documentation.scripting.docs.Function" typecode="org.mozilla.javascript.Function"/>
847
+              <parameter name="argArray" type="com.servoy.j2db.documentation.scripting.docs.String[]" typecode="[Ljava.lang.String;"/>
848
+            </parameters>
849
+          </function>
850
+          <function clientSupport="wc,sc" name="generateCallbackScript">
851
+            <argumentsTypes>
852
+              <argumentType typecode="org.mozilla.javascript.Function"/>
853
+            </argumentsTypes>
854
+            <return type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
855
+            <descriptions>
856
+              <description clientSupport="wc,sc"><![CDATA[Adds web-client call-back behavior for a method, passing optional parameters, and optionally hiding the Ajax callback indicator.
857
+Returns the javascript for the client.]]></description>
858
+            </descriptions>
859
+            <summaries>
860
+              <summary clientSupport="wc,sc"><![CDATA[Adds web-client call-back behavior for a method, passing optional parameters, and optionally hiding the Ajax callback indicator.]]></summary>
861
+            </summaries>
862
+            <samples>
863
+              <sample clientSupport="wc,sc"><![CDATA[var callback = %%elementName%%.generateCallbackScript(myMethod, ['arg1','argN'], true);
864
+var script = 'function myFunction(arg1, argN){'+callback+'}';
865
+var markup = '<html><head><script type=\"text/javascript\">'+script+'</script></head></html>';]]></sample>
866
+            </samples>
867
+            <parameters>
868
+              <parameter name="callbackMethod" type="com.servoy.j2db.documentation.scripting.docs.Function" typecode="org.mozilla.javascript.Function"/>
869
+            </parameters>
870
+          </function>
871
+          <function clientSupport="wc,sc" name="generateCallbackScript">
872
+            <argumentsTypes>
873
+              <argumentType typecode="org.mozilla.javascript.Function"/>
874
+              <argumentType typecode="[Ljava.lang.String;"/>
875
+            </argumentsTypes>
876
+            <return type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
877
+            <descriptions>
878
+              <description clientSupport="wc,sc"><![CDATA[Adds web-client call-back behavior for a method, passing optional parameters, and optionally hiding the Ajax callback indicator.
879
+Returns the javascript for the client.]]></description>
880
+            </descriptions>
881
+            <summaries>
882
+              <summary clientSupport="wc,sc"><![CDATA[Adds web-client call-back behavior for a method, passing optional parameters, and optionally hiding the Ajax callback indicator.]]></summary>
883
+            </summaries>
884
+            <samples>
885
+              <sample clientSupport="wc,sc"><![CDATA[var callback = %%elementName%%.generateCallbackScript(myMethod, ['arg1','argN'], true);
886
+var script = 'function myFunction(arg1, argN){'+callback+'}';
887
+var markup = '<html><head><script type=\"text/javascript\">'+script+'</script></head></html>';]]></sample>
888
+            </samples>
889
+            <parameters>
890
+              <parameter name="callbackMethod" type="com.servoy.j2db.documentation.scripting.docs.Function" typecode="org.mozilla.javascript.Function"/>
891
+              <parameter name="argArray" type="com.servoy.j2db.documentation.scripting.docs.String[]" typecode="[Ljava.lang.String;"/>
892
+            </parameters>
893
+          </function>
894
+          <function clientSupport="wc,sc" name="generateCallbackScript">
895
+            <argumentsTypes>
896
+              <argumentType typecode="org.mozilla.javascript.Function"/>
897
+              <argumentType typecode="[Ljava.lang.String;"/>
898
+              <argumentType typecode="boolean"/>
899
+            </argumentsTypes>
900
+            <return type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
901
+            <descriptions>
902
+              <description clientSupport="wc,sc"><![CDATA[Adds web-client call-back behavior for a method, passing optional parameters, and optionally hiding the Ajax callback indicator.
903
+Returns the javascript for the client.]]></description>
904
+            </descriptions>
905
+            <summaries>
906
+              <summary clientSupport="wc,sc"><![CDATA[Adds web-client call-back behavior for a method, passing optional parameters, and optionally hiding the Ajax callback indicator.]]></summary>
907
+            </summaries>
908
+            <samples>
909
+              <sample clientSupport="wc,sc"><![CDATA[var callback = %%elementName%%.generateCallbackScript(myMethod, ['arg1','argN'], true);
910
+var script = 'function myFunction(arg1, argN){'+callback+'}';
911
+var markup = '<html><head><script type=\"text/javascript\">'+script+'</script></head></html>';]]></sample>
912
+            </samples>
913
+            <parameters>
914
+              <parameter name="callbackMethod" type="com.servoy.j2db.documentation.scripting.docs.Function" typecode="org.mozilla.javascript.Function"/>
915
+              <parameter name="argArray" type="com.servoy.j2db.documentation.scripting.docs.String[]" typecode="[Ljava.lang.String;"/>
916
+              <parameter name="showIndicator" type="com.servoy.j2db.documentation.scripting.docs.Boolean" typecode="boolean"/>
917
+            </parameters>
918
+          </function>
919
+          <function clientSupport="wc,sc" name="getElementMarkupId">
920
+            <argumentsTypes>
921
+              <argumentType typecode="java.lang.Object"/>
922
+            </argumentsTypes>
923
+            <return type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
924
+            <descriptions>
925
+              <description clientSupport="wc,sc"><![CDATA[Returns a Servoy markup Id to be used in your browser scripts.]]></description>
926
+            </descriptions>
927
+            <summaries>
928
+              <summary clientSupport="wc,sc"><![CDATA[Returns a Servoy markup Id to be used in your browser scripts.]]></summary>
929
+            </summaries>
930
+            <samples>
931
+              <sample clientSupport="wc,sc"><![CDATA[var wicketID = %%elementName%%.getElementMarkupId(elements.aField);]]></sample>
932
+            </samples>
933
+            <parameters>
934
+              <parameter name="formElement" type="com.servoy.j2db.documentation.scripting.docs.Object" typecode="java.lang.Object"/>
935
+            </parameters>
936
+          </function>
937
+          <function clientSupport="wc,sc" name="getJSONCallbackURL">
938
+            <argumentsTypes>
939
+              <argumentType typecode="org.mozilla.javascript.Function"/>
940
+            </argumentsTypes>
941
+            <return type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
942
+            <descriptions>
943
+              <description clientSupport="wc,sc"><![CDATA[Creates a URL for a Servoy method returning a JSON object to be used in Ajax calls for example.]]></description>
944
+            </descriptions>
945
+            <summaries>
946
+              <summary clientSupport="wc,sc"><![CDATA[Creates a URL for a Servoy method returning a JSON object to be used in Ajax calls for example.]]></summary>
947
+            </summaries>
948
+            <samples>
949
+              <sample clientSupport="wc,sc"><![CDATA[var url = %%elementName%%.getJSONCallbackURL(callbackFunction);]]></sample>
950
+            </samples>
951
+            <parameters>
952
+              <parameter name="function" type="com.servoy.j2db.documentation.scripting.docs.Function" typecode="org.mozilla.javascript.Function"/>
953
+            </parameters>
954
+          </function>
955
+          <function clientSupport="wc,sc" name="getJSONCallbackURL">
956
+            <argumentsTypes>
957
+              <argumentType typecode="org.mozilla.javascript.Function"/>
958
+              <argumentType typecode="org.mozilla.javascript.Scriptable"/>
959
+            </argumentsTypes>
960
+            <return type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
961
+            <descriptions>
962
+              <description clientSupport="wc,sc"><![CDATA[Creates a URL for a Servoy method returning a JSON object to be used in Ajax calls for example.]]></description>
963
+            </descriptions>
964
+            <summaries>
965
+              <summary clientSupport="wc,sc"><![CDATA[Creates a URL for a Servoy method returning a JSON object to be used in Ajax calls for example.]]></summary>
966
+            </summaries>
967
+            <samples>
968
+              <sample clientSupport="wc,sc"><![CDATA[var url = %%elementName%%.getJSONCallbackURL(callbackFunction);]]></sample>
969
+            </samples>
970
+            <parameters>
971
+              <parameter name="funtion"/>
972
+              <parameter name="parametersObject" type="com.servoy.j2db.documentation.scripting.docs.Object" typecode="org.mozilla.javascript.Scriptable"/>
973
+            </parameters>
974
+          </function>
975
+          <function clientSupport="wc,sc" name="getVersion">
976
+            <argumentsTypes/>
977
+            <return type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
978
+            <descriptions>
979
+              <description clientSupport="wc,sc"><![CDATA[Returns the plugin version.]]></description>
980
+            </descriptions>
981
+            <summaries>
982
+              <summary clientSupport="wc,sc"><![CDATA[Returns the plugin version.]]></summary>
983
+            </summaries>
984
+            <samples>
985
+              <sample clientSupport="wc,sc"><![CDATA[application.output(%%elementName%%.getVersion());]]></sample>
986
+            </samples>
987
+          </function>
988
+          <function clientSupport="wc,sc" name="getXMLCallbackURL">
989
+            <argumentsTypes>
990
+              <argumentType typecode="org.mozilla.javascript.Function"/>
991
+            </argumentsTypes>
992
+            <return type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
993
+            <descriptions>
994
+              <description clientSupport="wc,sc"><![CDATA[Creates a URL for a Servoy method returning a XML object to be used in Ajax calls for example.]]></description>
995
+            </descriptions>
996
+            <summaries>
997
+              <summary clientSupport="wc,sc"><![CDATA[Creates a URL for a Servoy method returning a XML object to be used in Ajax calls for example.]]></summary>
998
+            </summaries>
999
+            <samples>
1000
+              <sample clientSupport="wc,sc"><![CDATA[var url = %%elementName%%.getXMLCallbackURL(callbackFunction);]]></sample>
1001
+            </samples>
1002
+            <parameters>
1003
+              <parameter name="function" type="com.servoy.j2db.documentation.scripting.docs.Function" typecode="org.mozilla.javascript.Function"/>
1004
+            </parameters>
1005
+          </function>
1006
+          <function clientSupport="wc,sc" name="getXMLCallbackURL">
1007
+            <argumentsTypes>
1008
+              <argumentType typecode="org.mozilla.javascript.Function"/>
1009
+              <argumentType typecode="org.mozilla.javascript.Scriptable"/>
1010
+            </argumentsTypes>
1011
+            <return type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
1012
+            <descriptions>
1013
+              <description clientSupport="wc,sc"><![CDATA[Creates a URL for a Servoy method returning a XML object to be used in Ajax calls for example.]]></description>
1014
+            </descriptions>
1015
+            <summaries>
1016
+              <summary clientSupport="wc,sc"><![CDATA[Creates a URL for a Servoy method returning a XML object to be used in Ajax calls for example.]]></summary>
1017
+            </summaries>
1018
+            <samples>
1019
+              <sample clientSupport="wc,sc"><![CDATA[var url = %%elementName%%.getXMLCallbackURL(callbackFunction);]]></sample>
1020
+            </samples>
1021
+            <parameters>
1022
+              <parameter name="function" type="com.servoy.j2db.documentation.scripting.docs.Function" typecode="org.mozilla.javascript.Function"/>
1023
+              <parameter name="parametersObject" type="com.servoy.j2db.documentation.scripting.docs.Object" typecode="org.mozilla.javascript.Scriptable"/>
1024
+            </parameters>
1025
+          </function>
1026
+          <function clientSupport="wc,sc" name="isMarkupVisible">
1027
+            <argumentsTypes>
1028
+              <argumentType typecode="java.lang.Object"/>
1029
+            </argumentsTypes>
1030
+            <return type="com.servoy.j2db.documentation.scripting.docs.Boolean" typecode="boolean"/>
1031
+            <descriptions>
1032
+              <description clientSupport="wc,sc"><![CDATA[Returns true if the elements markup is visible in the page.]]></description>
1033
+            </descriptions>
1034
+            <summaries>
1035
+              <summary clientSupport="wc,sc"><![CDATA[Returns true if the elements markup is visible in the page.]]></summary>
1036
+            </summaries>
1037
+            <samples>
1038
+              <sample clientSupport="wc,sc"><![CDATA[var visible = %%elementName%%.isMarkupVisible(elements.yourElement);
1039
+%%elementName%%.setMarkupVisible(elements.yourElement,!visible);]]></sample>
1040
+            </samples>
1041
+            <parameters>
1042
+              <parameter name="element" type="com.servoy.j2db.documentation.scripting.docs.Object" typecode="java.lang.Object"/>
1043
+            </parameters>
1044
+          </function>
1045
+          <function clientSupport="wc,sc" name="removeCssReference">
1046
+            <argumentsTypes>
1047
+              <argumentType typecode="java.lang.String"/>
1048
+            </argumentsTypes>
1049
+            <return type="void" typecode="void"/>
1050
+            <descriptions>
1051
+              <description clientSupport="wc,sc"><![CDATA[Removes a global (or form/element when the second arg. is provided) css url.]]></description>
1052
+            </descriptions>
1053
+            <summaries>
1054
+              <summary clientSupport="wc,sc"><![CDATA[Removes a global (or form/element when the second arg.]]></summary>
1055
+            </summaries>
1056
+            <samples>
1057
+              <sample clientSupport="wc,sc"><![CDATA[// remove global reference
1058
+%%elementName%%.removeCssReference('http://yourserver.com/css/yourstyle.css');
1059
+//remove form reference
1060
+%%elementName%%.removeCssReference('http://yourserver.com/css/yourstyle.css', forms.myFormWithSpecialCSS);
1061
+//remove form element reference
1062
+%%elementName%%.removeCssReference('http://yourserver.com/css/yourstyle.css', elements.myElementWithSpecialCSS);]]></sample>
1063
+            </samples>
1064
+            <parameters>
1065
+              <parameter name="stringReference" type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
1066
+            </parameters>
1067
+          </function>
1068
+          <function clientSupport="wc,sc" name="removeCssReference">
1069
+            <argumentsTypes>
1070
+              <argumentType typecode="java.lang.String"/>
1071
+              <argumentType typecode="java.lang.Object"/>
1072
+            </argumentsTypes>
1073
+            <return type="void" typecode="void"/>
1074
+            <descriptions>
1075
+              <description clientSupport="wc,sc"><![CDATA[Removes a global (or form/element when the second arg. is provided) css url.]]></description>
1076
+            </descriptions>
1077
+            <summaries>
1078
+              <summary clientSupport="wc,sc"><![CDATA[Removes a global (or form/element when the second arg.]]></summary>
1079
+            </summaries>
1080
+            <samples>
1081
+              <sample clientSupport="wc,sc"><![CDATA[// remove global reference
1082
+%%elementName%%.removeCssReference('http://yourserver.com/css/yourstyle.css');
1083
+//remove form reference
1084
+%%elementName%%.removeCssReference('http://yourserver.com/css/yourstyle.css', forms.myFormWithSpecialCSS);
1085
+//remove form element reference
1086
+%%elementName%%.removeCssReference('http://yourserver.com/css/yourstyle.css', elements.myElementWithSpecialCSS);]]></sample>
1087
+            </samples>
1088
+            <parameters>
1089
+              <parameter name="stringReference" type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
1090
+              <parameter name="formOrElement" type="com.servoy.j2db.documentation.scripting.docs.Object" typecode="java.lang.Object"/>
1091
+            </parameters>
1092
+          </function>
1093
+          <function clientSupport="wc,sc" name="removeCssReference">
1094
+            <argumentsTypes>
1095
+              <argumentType typecode="org.apache.wicket.ResourceReference"/>
1096
+            </argumentsTypes>
1097
+            <return type="void" typecode="void"/>
1098
+            <descriptions>
1099
+              <description clientSupport="wc,sc"><![CDATA[Removes a built-in Servoy css reference (see SERVOY_WEB_RESOURCES).]]></description>
1100
+            </descriptions>
1101
+            <summaries>
1102
+              <summary clientSupport="wc,sc"><![CDATA[Removes a built-in Servoy css reference (see SERVOY_WEB_RESOURCES).]]></summary>
1103
+            </summaries>
1104
+            <samples>
1105
+              <sample clientSupport="wc,sc"><![CDATA[// remove Servoy internal CSS style sheets (like Yahoo UI widgets styles)
1106
+// Note that Yahoo UI widgets are only present from Servoy 60 and higer.
1107
+%%elementName%%.removeCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU);
1108
+//remove form reference
1109
+%%elementName%%.removeCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU, forms.myFormWithSpecialCSS);
1110
+//remove form element reference
1111
+%%elementName%%.removeCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU, elements.myElementWithSpecialCSS);]]></sample>
1112
+            </samples>
1113
+            <parameters>
1114
+              <parameter name="webResourceReference" type="org.apache.wicket.ResourceReference" typecode="org.apache.wicket.ResourceReference"/>
1115
+            </parameters>
1116
+          </function>
1117
+          <function clientSupport="wc,sc" name="removeCssReference">
1118
+            <argumentsTypes>
1119
+              <argumentType typecode="org.apache.wicket.ResourceReference"/>
1120
+              <argumentType typecode="java.lang.Object"/>
1121
+            </argumentsTypes>
1122
+            <return type="void" typecode="void"/>
1123
+            <descriptions>
1124
+              <description clientSupport="wc,sc"><![CDATA[Removes a built-in Servoy css reference (see SERVOY_WEB_RESOURCES).]]></description>
1125
+            </descriptions>
1126
+            <summaries>
1127
+              <summary clientSupport="wc,sc"><![CDATA[Removes a built-in Servoy css reference (see SERVOY_WEB_RESOURCES).]]></summary>
1128
+            </summaries>
1129
+            <samples>
1130
+              <sample clientSupport="wc,sc"><![CDATA[// remove Servoy internal CSS style sheets (like Yahoo UI widgets styles)
1131
+// Note that Yahoo UI widgets are only present from Servoy 60 and higer.
1132
+%%elementName%%.removeCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU);
1133
+//remove form reference
1134
+%%elementName%%.removeCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU, forms.myFormWithSpecialCSS);
1135
+//remove form element reference
1136
+%%elementName%%.removeCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU, elements.myElementWithSpecialCSS);]]></sample>
1137
+            </samples>
1138
+            <parameters>
1139
+              <parameter name="webResourceReference" type="org.apache.wicket.ResourceReference" typecode="org.apache.wicket.ResourceReference"/>
1140
+              <parameter name="formOrElement" type="com.servoy.j2db.documentation.scripting.docs.Object" typecode="java.lang.Object"/>
1141
+            </parameters>
1142
+          </function>
1143
+          <function clientSupport="wc,sc" name="removeExtraCssClass">
1144
+            <argumentsTypes>
1145
+              <argumentType typecode="java.lang.Object"/>
1146
+            </argumentsTypes>
1147
+            <return type="void" typecode="void"/>
1148
+            <descriptions>
1149
+              <description clientSupport="wc,sc"><![CDATA[Removes an extra class attribute previously set to an element.]]></description>
1150
+            </descriptions>
1151
+            <summaries>
1152
+              <summary clientSupport="wc,sc"><![CDATA[Removes an extra class attribute previously set to an element.]]></summary>
1153
+            </summaries>
1154
+            <samples>
1155
+              <sample clientSupport="wc,sc"><![CDATA[%%elementName%%.removeExtraCssClass(elements.yourElement);]]></sample>
1156
+            </samples>
1157
+            <parameters>
1158
+              <parameter name="element" type="com.servoy.j2db.documentation.scripting.docs.Object" typecode="java.lang.Object"/>
1159
+            </parameters>
1160
+          </function>
1161
+          <function clientSupport="wc,sc" name="removeJsReference">
1162
+            <argumentsTypes>
1163
+              <argumentType typecode="java.lang.String"/>
1164
+            </argumentsTypes>
1165
+            <return type="void" typecode="void"/>
1166
+            <descriptions>
1167
+              <description clientSupport="wc,sc"><![CDATA[Removes a global (or form/element when the second arg. is provided) javascript url.]]></description>
1168
+            </descriptions>
1169
+            <summaries>
1170
+              <summary clientSupport="wc,sc"><![CDATA[Removes a global (or form/element when the second arg.]]></summary>
1171
+            </summaries>
1172
+            <samples>
1173
+              <sample clientSupport="wc,sc"><![CDATA[// remove global reference
1174
+%%elementName%%.removeJsReference('http://yourserver.com/js/yourscript.js');
1175
+//remove form reference
1176
+%%elementName%%.removeJsReference('http://yourserver.com/js/yourscript.js', forms.myFormWithSpecialJS);
1177
+//remove form element reference
1178
+%%elementName%%.removeJsReference('http://yourserver.com/js/yourscript.js', elements.myElementWithSpecialJS);]]></sample>
1179
+            </samples>
1180
+            <parameters>
1181
+              <parameter name="stringReference" type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
1182
+            </parameters>
1183
+          </function>
1184
+          <function clientSupport="wc,sc" name="removeJsReference">
1185
+            <argumentsTypes>
1186
+              <argumentType typecode="java.lang.String"/>
1187
+              <argumentType typecode="java.lang.Object"/>
1188
+            </argumentsTypes>
1189
+            <return type="void" typecode="void"/>
1190
+            <descriptions>
1191
+              <description clientSupport="wc,sc"><![CDATA[Removes a global (or form/element when the second arg. is provided) javascript url.]]></description>
1192
+            </descriptions>
1193
+            <summaries>
1194
+              <summary clientSupport="wc,sc"><![CDATA[Removes a global (or form/element when the second arg.]]></summary>
1195
+            </summaries>
1196
+            <samples>
1197
+              <sample clientSupport="wc,sc"><![CDATA[// remove global reference
1198
+%%elementName%%.removeJsReference('http://yourserver.com/js/yourscript.js');
1199
+//remove form reference
1200
+%%elementName%%.removeJsReference('http://yourserver.com/js/yourscript.js', forms.myFormWithSpecialJS);
1201
+//remove form element reference
1202
+%%elementName%%.removeJsReference('http://yourserver.com/js/yourscript.js', elements.myElementWithSpecialJS);]]></sample>
1203
+            </samples>
1204
+            <parameters>
1205
+              <parameter name="stringReference" type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
1206
+              <parameter name="formOrElement" type="com.servoy.j2db.documentation.scripting.docs.Object" typecode="java.lang.Object"/>
1207
+            </parameters>
1208
+          </function>
1209
+          <function clientSupport="wc,sc" name="removeJsReference">
1210
+            <argumentsTypes>
1211
+              <argumentType typecode="org.apache.wicket.ResourceReference"/>
1212
+            </argumentsTypes>
1213
+            <return type="void" typecode="void"/>
1214
+            <descriptions>
1215
+              <description clientSupport="wc,sc"><![CDATA[Removes a built-in Servoy javascript reference (see SERVOY_WEB_RESOURCES).]]></description>
1216
+            </descriptions>
1217
+            <summaries>
1218
+              <summary clientSupport="wc,sc"><![CDATA[Removes a built-in Servoy javascript reference (see SERVOY_WEB_RESOURCES).]]></summary>
1219
+            </summaries>
1220
+            <samples>
1221
+              <sample clientSupport="wc,sc"><![CDATA[// remove Servoy internal reference scripts (like Yahoo UI widgets)
1222
+// Note that Yahoo UI widgets are only present from Servoy 60 and higer.
1223
+%%elementName%%.removeJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU);
1224
+//remove form reference
1225
+%%elementName%%.removeJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU, forms.myFormWithSpecialJS);
1226
+//remove form element reference
1227
+%%elementName%%.removeJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU, elements.myElementWithSpecialJS);]]></sample>
1228
+            </samples>
1229
+            <parameters>
1230
+              <parameter name="webResourceReference" type="org.apache.wicket.ResourceReference" typecode="org.apache.wicket.ResourceReference"/>
1231
+            </parameters>
1232
+          </function>
1233
+          <function clientSupport="wc,sc" name="removeJsReference">
1234
+            <argumentsTypes>
1235
+              <argumentType typecode="org.apache.wicket.ResourceReference"/>
1236
+              <argumentType typecode="java.lang.Object"/>
1237
+            </argumentsTypes>
1238
+            <return type="void" typecode="void"/>
1239
+            <descriptions>
1240
+              <description clientSupport="wc,sc"><![CDATA[Removes a built-in Servoy javascript reference (see SERVOY_WEB_RESOURCES).]]></description>
1241
+            </descriptions>
1242
+            <summaries>
1243
+              <summary clientSupport="wc,sc"><![CDATA[Removes a built-in Servoy javascript reference (see SERVOY_WEB_RESOURCES).]]></summary>
1244
+            </summaries>
1245
+            <samples>
1246
+              <sample clientSupport="wc,sc"><![CDATA[// remove Servoy internal reference scripts (like Yahoo UI widgets)
1247
+// Note that Yahoo UI widgets are only present from Servoy 60 and higer.
1248
+%%elementName%%.removeJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU);
1249
+//remove form reference
1250
+%%elementName%%.removeJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU, forms.myFormWithSpecialJS);
1251
+//remove form element reference
1252
+%%elementName%%.removeJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU, elements.myElementWithSpecialJS);]]></sample>
1253
+            </samples>
1254
+            <parameters>
1255
+              <parameter name="webResourceReference" type="org.apache.wicket.ResourceReference" typecode="org.apache.wicket.ResourceReference"/>
1256
+              <parameter name="formOrElement" type="com.servoy.j2db.documentation.scripting.docs.Object" typecode="java.lang.Object"/>
1257
+            </parameters>
1258
+          </function>
1259
+          <function clientSupport="wc,sc" name="setExtraCssClass">
1260
+            <argumentsTypes>
1261
+              <argumentType typecode="java.lang.Object"/>
1262
+              <argumentType typecode="java.lang.String"/>
1263
+            </argumentsTypes>
1264
+            <return type="void" typecode="void"/>
1265
+            <descriptions>
1266
+              <description clientSupport="wc,sc"><![CDATA[Sets an extra class attribute to an element.]]></description>
1267
+            </descriptions>
1268
+            <summaries>
1269
+              <summary clientSupport="wc,sc"><![CDATA[Sets an extra class attribute to an element.]]></summary>
1270
+            </summaries>
1271
+            <samples>
1272
+              <sample clientSupport="wc,sc"><![CDATA[%%elementName%%.setExtraCssClass(elements.yourElement, 'specialClass');]]></sample>
1273
+            </samples>
1274
+            <parameters>
1275
+              <parameter name="element" type="com.servoy.j2db.documentation.scripting.docs.Object" typecode="java.lang.Object"/>
1276
+              <parameter name="classAttribute" type="com.servoy.j2db.documentation.scripting.docs.String" typecode="java.lang.String"/>
1277
+            </parameters>
1278
+          </function>
1279
+          <function clientSupport="wc,sc" name="setMarkupVisible">
1280
+            <argumentsTypes>
1281
+              <argumentType typecode="java.lang.Object"/>
1282
+              <argumentType typecode="boolean"/>
1283
+            </argumentsTypes>
1284
+            <return type="void" typecode="void"/>
1285
+            <descriptions>
1286
+              <description clientSupport="wc,sc"><![CDATA[Sets the visiblity of the element markup.]]></description>
1287
+            </descriptions>
1288
+            <summaries>
1289
+              <summary clientSupport="wc,sc"><![CDATA[Sets the visiblity of the element markup.]]></summary>
1290
+            </summaries>
1291
+            <samples>
1292
+              <sample clientSupport="wc,sc"><![CDATA[var visible = %%elementName%%.isMarkupVisible(elements.yourElement);
1293
+%%elementName%%.setMarkupVisible(elements.yourElement,!visible);]]></sample>
1294
+            </samples>
1295
+            <parameters>
1296
+              <parameter name="element" type="com.servoy.j2db.documentation.scripting.docs.Object" typecode="java.lang.Object"/>
1297
+              <parameter name="visibility" type="com.servoy.j2db.documentation.scripting.docs.Boolean" typecode="boolean"/>
1298
+            </parameters>
1299
+          </function>
1300
+          <function clientSupport="wc,sc" name="setRendered">
1301
+            <argumentsTypes>
1302
+              <argumentType typecode="java.lang.Object"/>
1303
+            </argumentsTypes>
1304
+            <return type="void" typecode="void"/>
1305
+            <descriptions>
1306
+              <description clientSupport="wc,sc"><![CDATA[Marks the element as rendered to avoid the server from re-syncing again upon the next update.]]></description>
1307
+            </descriptions>
1308
+            <summaries>
1309
+              <summary clientSupport="wc,sc"><![CDATA[Marks the element as rendered to avoid the server from re-syncing again upon the next update.]]></summary>
1310
+            </summaries>
1311
+            <samples>
1312
+              <sample clientSupport="wc,sc"><![CDATA[%%elementName%%.setRendered(elements.yourElement);]]></sample>
1313
+            </samples>
1314
+            <parameters>
1315
+              <parameter name="element" type="com.servoy.j2db.documentation.scripting.docs.Object" typecode="java.lang.Object"/>
1316
+            </parameters>
1317
+          </function>
1318
+        </functions>
1319
+      </object>
1320
+    </plugins>
1321
+  </servoydoc>
1322
+</servoyextension>
1323
Index: src/com/servoy/plugins/WebClientPlugin.java
1324
===================================================================
1325
--- src/com/servoy/plugins/WebClientPlugin.java	(revision 54)
1326
+++ src/com/servoy/plugins/WebClientPlugin.java	(working copy)
1327
@@ -16,6 +16,7 @@
1328
 import javax.swing.Icon;
1329
 import javax.swing.ImageIcon;
1330
 
1331
+import com.servoy.j2db.documentation.ServoyDocumented;
1332
 import com.servoy.j2db.plugins.IClientPlugin;
1333
 import com.servoy.j2db.plugins.IClientPluginAccess;
1334
 import com.servoy.j2db.plugins.IServerAccess;
1335
@@ -23,6 +24,7 @@
1336
 import com.servoy.j2db.plugins.PluginException;
1337
 import com.servoy.j2db.preference.PreferencePanel;
1338
 import com.servoy.j2db.scripting.IScriptObject;
1339
+import com.servoy.j2db.scripting.IScriptable;
1340
 
1341
 /**
1342
  * Main plugin entry
1343
@@ -33,9 +35,11 @@
1344
 public class WebClientPlugin implements IClientPlugin, IServerPlugin {
1345
 
1346
 	private IClientPluginAccess app;
1347
-	private IScriptObject provider;
1348
+	private IScriptable provider;
1349
 	private Icon icon;
1350
 	
1351
+	public static final String PLUGIN_NAME = "WebClientUtils";
1352
+
1353
 	// plugin implementations
1354
 	public Icon getImage() {
1355
 		if (icon == null)
1356
@@ -45,7 +49,7 @@
1357
 	}
1358
 
1359
 	public String getName() {
1360
-		return "WebClientUtils";
1361
+		return PLUGIN_NAME;
1362
 	}
1363
 
1364
 	public PreferencePanel[] getPreferencePanels() {
1365
@@ -58,7 +62,7 @@
1366
 		return props;
1367
 	}
1368
 
1369
-	public IScriptObject getScriptObject() {
1370
+	public IScriptable getScriptObject() {
1371
 		if (provider == null) {
1372
 			provider = new WebClientProvider(this);
1373
 		}
1374
Index: src/com/servoy/plugins/WebClientProvider.java
1375
===================================================================
1376
--- src/com/servoy/plugins/WebClientProvider.java	(revision 54)
1377
+++ src/com/servoy/plugins/WebClientProvider.java	(working copy)
1378
@@ -12,10 +12,15 @@
1379
 import org.mozilla.javascript.NativeArray;
1380
 import org.mozilla.javascript.NativeJavaObject;
1381
 import org.mozilla.javascript.Scriptable;
1382
+import org.mozilla.javascript.annotations.JSFunction;
1383
 
1384
+import com.servoy.j2db.IForm;
1385
 import com.servoy.j2db.Messages;
1386
+import com.servoy.j2db.documentation.ServoyDocumented;
1387
 import com.servoy.j2db.plugins.IClientPluginAccess;
1388
 import com.servoy.j2db.server.headlessclient.IWebClientPluginAccess;
1389
+import com.servoy.j2db.ui.IComponent;
1390
+import com.servoy.j2db.ui.IFormUI;
1391
 import com.servoy.j2db.ui.IProviderStylePropertyChanges;
1392
 
1393
 /**
1394
@@ -24,6 +29,7 @@
1395
  * @author sean
1396
  * @author Servoy Stuff
1397
  */
1398
+@ServoyDocumented(publicName = WebClientPlugin.PLUGIN_NAME, scriptingName = "plugins." + WebClientPlugin.PLUGIN_NAME)
1399
 public class WebClientProvider implements IWebClientProvider {
1400
 	
1401
 	private static final String PLUGIN_VERSION = "1.3.6";
1402
@@ -44,32 +50,68 @@
1403
     	}
1404
     	return null;
1405
 	}
1406
-		
1407
-	public String js_getJSONCallbackURL(final Function callback) {
1408
-		return js_getJSONCallbackURL(callback, null);
1409
+	
1410
+	/**
1411
+	 * Creates a URL for a Servoy method returning a JSON object to be used in Ajax calls for example.
1412
+	 * 
1413
+	 * @sample
1414
+	 * var url = %%elementName%%.getJSONCallbackURL(callbackFunction);
1415
+	 * 
1416
+	 * @param function
1417
+	 * @return
1418
+	 */
1419
+	@JSFunction
1420
+	public String getJSONCallbackURL(final Function function) {
1421
+		return getJSONCallbackURL(function, null);
1422
 	}
1423
 	
1424
-	public String js_getJSONCallbackURL(final Function callback, final Scriptable args) {
1425
-		if(getApp() != null && callback != null) {
1426
+	/**
1427
+	 * @clonedesc getJSONCallbackURL(Function)
1428
+	 * @sampleas getJSONCallbackURL(Function)
1429
+	 * @param funtion
1430
+	 * @param parametersObject
1431
+	 * @return
1432
+	 */
1433
+	@JSFunction
1434
+	public String getJSONCallbackURL(final Function function, final Scriptable parametersObject) {
1435
+		if(getApp() != null && function != null) {
1436
 			if(getApp() != null){
1437
 				JSONBehavior bp = getJSONBehavior(); 
1438
-				Map<String, Object> map = getMapFromScriptable(args);
1439
-				if (bp != null) return bp.getUrlForCallback(callback,map);  
1440
+				Map<String, Object> map = getMapFromScriptable(parametersObject);
1441
+				if (bp != null) return bp.getUrlForCallback(function,map);  
1442
 	    	}
1443
     	}
1444
 		return null;
1445
 	}
1446
 	
1447
-	public String js_getXMLCallbackURL(final Function callback) {
1448
-		return js_getXMLCallbackURL(callback, null);
1449
+	/**
1450
+	 * Creates a URL for a Servoy method returning a XML object to be used in Ajax calls for example.
1451
+	 * 
1452
+	 * @sample
1453
+	 * var url = %%elementName%%.getXMLCallbackURL(callbackFunction);
1454
+	 * 
1455
+	 * @param function
1456
+	 * @return
1457
+	 */
1458
+	@JSFunction
1459
+	public String getXMLCallbackURL(final Function function) {
1460
+		return getXMLCallbackURL(function, null);
1461
 	}
1462
 	
1463
-	public String js_getXMLCallbackURL(final Function callback, final Scriptable args) {
1464
-		if(getApp() != null && callback != null) {
1465
+	/**
1466
+	 * @clonedesc getXMLCallbackURL(Function)
1467
+	 * @sampleas getXMLCallbackURL(Function)
1468
+	 * @param function
1469
+	 * @param parametersObject
1470
+	 * @return
1471
+	 */
1472
+	@JSFunction
1473
+	public String getXMLCallbackURL(final Function function, final Scriptable parametersObject) {
1474
+		if(getApp() != null && function != null) {
1475
 			if(getApp() != null){
1476
 				XMLBehavior bp = getXMLBehavior(); 
1477
-				Map<String, Object> map = getMapFromScriptable(args);
1478
-				if (bp != null) return bp.getUrlForCallback(callback, map);  
1479
+				Map<String, Object> map = getMapFromScriptable(parametersObject);
1480
+				if (bp != null) return bp.getUrlForCallback(function, map);  
1481
 	    	}
1482
     	}
1483
 		return null;
1484
@@ -96,55 +138,122 @@
1485
         return null;
1486
 	}
1487
 	
1488
-	public void addCssReference(String url) {
1489
+	public void internalAddCssReference(String url) {
1490
 		BehaviorProvider bp = getBehavior(); 
1491
 		if (bp != null) bp.addCssReference(url);
1492
 	}
1493
 	
1494
-	public void addCssReference(ResourceReference url) {
1495
+	public void internalAddCssReference(ResourceReference url) {
1496
 		BehaviorProvider bp = getBehavior(); 
1497
 		if (bp != null) bp.addCssReference(url);
1498
 	}
1499
 	
1500
-	public void removeCssReference(ResourceReference url) {
1501
+	protected Component getFormUIComponent(IForm form) {
1502
+		if (form != null) {
1503
+			IFormUI formUI = form.getFormUI();
1504
+			return getComponent(formUI);
1505
+		}
1506
+		return null;
1507
+	}
1508
+	
1509
+	protected Component getComponent(IComponent element) {
1510
+		return (element instanceof Component) ? (Component) element : null;
1511
+	}
1512
+
1513
+	public void internalAddCssReference(String url, Component c) {
1514
+		if (c != null) {
1515
+			ReferencesBehaviorProvider bp = getBehavior(c); 
1516
+			if (bp != null) bp.addCssReference(url, c);
1517
+		}
1518
+	}
1519
+
1520
+	public void internalAddCssReference(ResourceReference ref, Component c) {
1521
+		if (c != null) {
1522
+			ReferencesBehaviorProvider bp = getBehavior(c); 
1523
+			if (bp != null) bp.addCssReference(ref, c);
1524
+		}
1525
+	}
1526
+	
1527
+	public void internalRemoveCssReference(ResourceReference url) {
1528
 		BehaviorProvider bp = getBehavior(); 
1529
 		if (bp != null) bp.removeCssReference(url);
1530
 	}
1531
 	
1532
-	public void removeCssReference(String url) {
1533
+	public void internalRemoveCssReference(String url) {
1534
 		BehaviorProvider bp = getBehavior(); 
1535
 		if (bp != null) bp.removeCssReference(url);
1536
 	}
1537
 	
1538
-	public void addJsReference(String url) {
1539
+	public void internalRemoveCssReference(ResourceReference url, Component c) {
1540
+		if (c != null) {
1541
+			ReferencesBehaviorProvider bp = getBehavior(c); 
1542
+			if (bp != null) bp.removeCssReference(url, c);
1543
+		}
1544
+	}
1545
+	
1546
+	public void internalRemoveCssReference(String url, Component c) {
1547
+		if (c != null) {
1548
+			ReferencesBehaviorProvider bp = getBehavior(c); 
1549
+			if (bp != null) bp.removeCssReference(url, c);
1550
+		}
1551
+	}
1552
+	
1553
+	public void internalAddJsReference(String url, Component c) {
1554
+		if (c != null) {
1555
+			ReferencesBehaviorProvider bp = getBehavior(c);
1556
+			if (bp != null) bp.addJsReference(url, c);
1557
+		}
1558
+	}
1559
+	
1560
+	public void internalAddJsReference(ResourceReference url, Component c) {
1561
+		if (c != null) {
1562
+			ReferencesBehaviorProvider bp = getBehavior(c);
1563
+			if (bp != null) bp.addJsReference(url, c);
1564
+		}
1565
+	}
1566
+	
1567
+	public void internalAddJsReference(String url) {
1568
 		BehaviorProvider bp = getBehavior(); 
1569
 		if (bp != null) bp.addJsReference(url);
1570
 	}
1571
 	
1572
-	public void addJsReference(ResourceReference url) {
1573
+	public void internalAddJsReference(ResourceReference url) {
1574
 		BehaviorProvider bp = getBehavior(); 
1575
 		if (bp != null) bp.addJsReference(url);
1576
 	}
1577
 	
1578
-	public void removeJsReference(ResourceReference url) {
1579
+	public void internalRemoveJsReference(ResourceReference url) {
1580
 		BehaviorProvider bp = getBehavior(); 
1581
 		if (bp != null) bp.removeJsReference(url);
1582
 	}
1583
 	
1584
-	public void removeJsReference(String url) {
1585
+	public void internalRemoveJsReference(String url) {
1586
 		BehaviorProvider bp = getBehavior(); 
1587
 		if (bp != null) bp.removeJsReference(url);
1588
 	}
1589
 	
1590
+	public void internalRemoveJsReference(ResourceReference url, Component c) {
1591
+		if (c != null) {
1592
+			ReferencesBehaviorProvider bp = getBehavior(c);
1593
+			if (bp != null) bp.removeJsReference(url, c);
1594
+		}
1595
+	}
1596
 	
1597
+	public void internalRemoveJsReference(String url, Component c) {
1598
+		if (c != null) {
1599
+			ReferencesBehaviorProvider bp = getBehavior(c);
1600
+			if (bp != null) bp.removeJsReference(url, c);
1601
+		}
1602
+	}
1603
+	
1604
 	private BehaviorProvider getBehavior() {
1605
 		if (getApp() != null) {
1606
-			if (getApp().getPageContributor().getBehavior(BehaviorProvider.CALLBACK_BEHAVIOR) == null) {
1607
+			if (getApp().getPageContributor().getBehavior(BehaviorProvider.BEHAVIOR_ID) == null) {
1608
 				behavior = new BehaviorProvider(getApp());
1609
 			}
1610
 			else
1611
 			{
1612
-				behavior =  (BehaviorProvider)getApp().getPageContributor().getBehavior(BehaviorProvider.CALLBACK_BEHAVIOR);
1613
+				behavior =  (BehaviorProvider)getApp().getPageContributor().getBehavior(BehaviorProvider.BEHAVIOR_ID);
1614
 			}
1615
 			return behavior;
1616
 		}
1617
@@ -151,6 +260,16 @@
1618
 		return null;
1619
 	}
1620
 	
1621
+	private ReferencesBehaviorProvider getBehavior(Component c) {
1622
+		if (getApp() == null) return null;
1623
+		
1624
+		List<IBehavior> allBehaviors = c.getBehaviors();
1625
+		for (IBehavior behavior : allBehaviors) {
1626
+			if (behavior instanceof ReferencesBehaviorProvider) return (ReferencesBehaviorProvider) behavior;
1627
+		}
1628
+		return new ReferencesBehaviorProvider(getApp());
1629
+	}
1630
+	
1631
 	private JSONBehavior getJSONBehavior() {
1632
 		if (getApp() != null) {
1633
 			if (getApp().getPageContributor().getBehavior(JSONBehavior.CALLBACK_BEHAVIOR) == null) {
1634
@@ -185,177 +304,158 @@
1635
 		return (SERVOY_WEB_RESOURCES.YUI_CSS_FONTS == null) ? null : new Class[] { SERVOY_WEB_RESOURCES.class };
1636
 	}
1637
 
1638
-	public String[] getParameterNames(String string) {
1639
 
1640
-		if ("executeClientSideJS".equals(string)) {
1641
-			return new String[] { "jsToExecute", "[callbackMethod]",
1642
-					"[argArray]" };
1643
-		} else if ("generateCallbackScript".equals(string)) {
1644
-			return new String[] { "callbackMethod", "[argArray]", "[showIndicator]" };
1645
-		} else if ("getElementMarkupId".equals(string)) {
1646
-			return new String[] { "formElement" };
1647
-		} else if (string.startsWith("remove")) {
1648
-			return new String[] { ((SERVOY_WEB_RESOURCES.YUI_CSS_FONTS == null) ? "stringReference" : "stringOrWebResourceReference") };
1649
-		} else if (string.startsWith("add")) {
1650
-			return new String[] { ((SERVOY_WEB_RESOURCES.YUI_CSS_FONTS == null) ? "stringReference" : "stringOrWebResourceReference") };
1651
-		} else if ("isMarkupVisible".equals(string) || "setRendered".equals(string)) {
1652
-			return new String[] { "element" };
1653
-		} else if ("setMarkupVisible".equals(string)) {
1654
-			return new String[] { "element", "visibility" };
1655
-		} else if ("setExtraCssClass".equals(string)) {
1656
-			return new String[] { "element", "classAttribute" };
1657
-		} else if ("removeExtraCssClass".equals(string)) {
1658
-			return new String[] { "element" };
1659
-		} else if ("getJSONCallbackURL".equals(string)) {
1660
-			return new String[] { "function" ,"[parametersObject]" };
1661
-		} else if ("getXMLCallbackURL".equals(string)) {
1662
-			return new String[] { "function" ,"[parametersObject]" };
1663
-		}
1664
-		return null;
1665
-	}
1666
-
1667
-	public String getSample(String method) {
1668
-
1669
-		if ("executeClientSideJS".equals(method)) {
1670
-			return "// ex 1) Execute simple Client-Side Javascript (Web-Client only)\n"
1671
-					+ "var jsToExecute = \"alert('Hello World: Called From Servoy Method!');\"\n"
1672
-					+ "plugins.WebClientUtils.executeClientSideJS(jsToExecute)\n\n"
1673
-					+ "// ex 2) Execute client-side script w/ callback\n"
1674
-					+ "// Add two numbers on the client and send the result to the server."
1675
-					+ "// You can send an array of literals back to the server and into a callback method."
1676
-					+ "// (Literals will be evaluated on the client first)\n"
1677
-					+ "var jsToExecute = \"var sum = 1 + 2\";\n"
1678
-					+ "%%elementName%%.executeClientSideJS(jsToExecute, myCallBackMethod, ['sum'])\n";
1679
-
1680
-		} else if ("generateCallbackScript".equals(method)) {
1681
-			String str = "var callback = %%elementName%%.generateCallbackScript(myMethod, ['arg1','argN'], true);\n";
1682
-			str += "var script = 'function myFunction(arg1, argN){'+callback+'}';\n";
1683
-			str += "var markup = '<html><head><script type=\"text/javascript\">'+script+'</script></head></html>'";
1684
-			return str;
1685
-		} else if ("getVersion".equals(method)) {
1686
-			return "application.output(%%elementName%%.getVersion());\n";
1687
-		} else if ("getElementMarkupId".equals(method)) {
1688
-			return "var wicketID = %%elementName%%.getElementMarkupId(elements.aField);\n";
1689
-		} else if ("removeJsReference".equals(method)) {
1690
-			return "%%elementName%%.removeJsReference('http://yourserver.com/js/yourscript.js');\n" + ((SERVOY_WEB_RESOURCES.YUI_CSS_FONTS == null) ? "" : 
1691
-				"\t// you can also remove Servoy internal reference scripts (like Yahoo UI widgets):\n\t%%elementName%%.removeJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU)");
1692
-		} else if ("removeCssReference".equals(method)) {
1693
-			return "%%elementName%%.removeCssReference('http://yourserver.com/css/yourstyle.css');\n" + ((SERVOY_WEB_RESOURCES.YUI_CSS_FONTS == null) ? "" : 
1694
-			"\t// you can also remove Servoy internal CSS style sheets (like Yahoo UI widgets styles):\n\t%%elementName%%.removeCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU)");
1695
-		} else if ("addJsReference".equals(method)) {
1696
-			return "%%elementName%%.addJsReference('http://yourserver.com/js/yourscript.js');\n" + ((SERVOY_WEB_RESOURCES.YUI_CSS_FONTS == null) ? "" : 
1697
-			"\t// you can also add Servoy internal reference scripts (like Yahoo UI widgets):\n\t%%elementName%%.addJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU)");
1698
-		} else if ("addCssReference".equals(method)) {
1699
-			return "%%elementName%%.addCssReference('http://yourserver.com/css/yourstyle.css');\n" + ((SERVOY_WEB_RESOURCES.YUI_CSS_FONTS == null) ? "" : 
1700
-			"\t// you can also add Servoy internal CSS style sheets (like Yahoo UI widgets styles):\n\t%%elementName%%.addCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU)");
1701
-		} else if ("isMarkupVisible".equals(method) || "setMarkupVisible".equals(method)) {
1702
-			return "var visible = %%elementName%%.isMarkupVisible(elements.yourElement);\n\t%%elementName%%.setMarkupVisible(elements.yourElement,!visible);\n";
1703
-		} else if ("setRendered".equals(method)) {
1704
-			return "%%elementName%%.setRendered(elements.yourElement);\n";
1705
-		} else if ("setExtraCssClass".equals(method)) {
1706
-			return "%%elementName%%.setExtraCssClass(elements.yourElement, 'specialClass');\n";
1707
-		} else if ("removeExtraCssClass".equals(method)) {
1708
-			return "%%elementName%%.removeExtraCssClass(elements.yourElement);\n";
1709
-		} else if ("getJSONCallbackURL".equals(method)) {
1710
-			return "var url = %%elementName%%.getJSONCallbackURL(callbackFunction);\n";
1711
-		} else if ("getXMLCallbackURL".equals(method)) {
1712
-			return "var url = %%elementName%%.getXMLCallbackURL(callbackFunction);\n";
1713
-		}
1714
-
1715
-		return null;
1716
-	}
1717
-
1718
-	public String getToolTip(String method) {
1719
-
1720
-		if ("executeClientSideJS".equals(method))
1721
-			return "Executes Client-Side Javascript with optional callback on server";
1722
-		else if ("generateCallbackScript".equals(method))
1723
-			return "Adds web-client call-back behavior for a method, passing optional parameters, and optionally hiding the Ajax callback indicator. Returns the javascript for the client.";
1724
-		else if ("getVersion".equals(method))
1725
-			return "Returns the plugin version.";
1726
-		else if ("getElementMarkupId".equals(method))
1727
-			return "Returns a Servoy markup Id to be used in your browser scripts";
1728
-		else if ("removeJsReference".equals(method))
1729
-			return "Removes a javascript url" + ((SERVOY_WEB_RESOURCES.YUI_CSS_FONTS == null) ? "" : " or build in servoy javascript reference (see SERVOY_WEB_RESOURCES)");
1730
-		else if ("removeCssReference".equals(method))
1731
-			return "Removes a css url" + ((SERVOY_WEB_RESOURCES.YUI_CSS_FONTS == null) ? "" : " or build in servoy css reference (see SERVOY_WEB_RESOURCES)");
1732
-		else if ("addJsReference".equals(method))
1733
-			return "Adds a javascript url" + ((SERVOY_WEB_RESOURCES.YUI_CSS_FONTS == null) ? "" : " or build in servoy javascript reference (see SERVOY_WEB_RESOURCES) to the page");
1734
-		else if ("addCssReference".equals(method))
1735
-			return "Adds a css url" + ((SERVOY_WEB_RESOURCES.YUI_CSS_FONTS == null) ? "" : "  or build in servoy css reference (see SERVOY_WEB_RESOURCES) to the page");
1736
-		else if ("isMarkupVisible".equals(method))
1737
-			return "Returns true if the elements markup is visible in the page";
1738
-		else if ("setMarkupVisible".equals(method))
1739
-			return "Set the visiblity of the element markup";
1740
-		else if ("setRendered".equals(method))
1741
-			return "Marks the element as rendered to avoid the server from re-syncing again upon the next update";
1742
-		else if ("setExtraCssClass".equals(method))
1743
-			return "Sets an extra class attribute to an element";
1744
-		else if ("removeExtraCssClass".equals(method))
1745
-			return "Removes an extra class attribute previously set to an element";
1746
-		else if ("getJSONCallbackURL".equals(method))
1747
-			return "Creates a URL for a Servoy method returning a JSON object to be used in Ajax calls for example";
1748
-		else if ("getXMLCallbackURL".equals(method))
1749
-			return "Creates a URL for a Servoy method returning a XML object to be used in Ajax calls for example";
1750
-		return null;
1751
-	}
1752
-
1753
-	public String js_getVersion() {
1754
+	/**
1755
+	 * Returns the plugin version.
1756
+	 * 
1757
+	 * @sample
1758
+	 * application.output(%%elementName%%.getVersion());
1759
+	 * 
1760
+	 * @return
1761
+	 */
1762
+	@JSFunction
1763
+	public String getVersion() {
1764
 		return PLUGIN_VERSION;
1765
 	}
1766
 
1767
-	public boolean isDeprecated(String string) {
1768
-		if ("addCallback".equals(string)) {
1769
-			return true;
1770
-		}
1771
-		return false;
1772
+	/**
1773
+	 * @clonedesc executeClientSideJS(String, Function, String[])
1774
+	 * @sampleas executeClientSideJS(String, Function, String[]) 
1775
+	 * @param jsToExecute
1776
+	 */
1777
+	@JSFunction
1778
+	public void executeClientSideJS(String jsToExecute) {
1779
+		executeJS(jsToExecute, null, null);
1780
 	}
1781
 
1782
-	public void js_executeClientSideJS(String js) {
1783
-		executeJS(js, null, null);
1784
+	/**
1785
+	 * @clonedesc executeClientSideJS(String, Function, String[])
1786
+	 * @sampleas executeClientSideJS(String, Function, String[])
1787
+	 * @param jsToExecute
1788
+	 * @param callbackMethod
1789
+	 */
1790
+	@JSFunction
1791
+	public void executeClientSideJS(String jsToExecute, Function callbackMethod) {
1792
+		executeJS(jsToExecute, callbackMethod, null);
1793
 	}
1794
 
1795
-	public void js_executeClientSideJS(String js, Function callback) {
1796
-		executeJS(js, callback, null);
1797
+	/**
1798
+	 * Executes Client-Side Javascript with optional callback on server.
1799
+	 * @sample
1800
+	 * // ex 1) Execute simple Client-Side Javascript (Web-Client only)
1801
+	 * var jsToExecute = \"alert('Hello World: Called From Servoy Method!');
1802
+	 * plugins.WebClientUtils.executeClientSideJS(jsToExecute)
1803
+	 * // ex 2) Execute client-side script w/ callback
1804
+	 * // Add two numbers on the client and send the result to the server.
1805
+	 * // You can send an array of literals back to the server and into a callback method.
1806
+	 * // (Literals will be evaluated on the client first)
1807
+	 * var jsToExecute = \"var sum = 1 + 2\";
1808
+	 * %%elementName%%.executeClientSideJS(jsToExecute, myCallBackMethod, ['sum']);
1809
+	 * 
1810
+	 * @param jsToExecute
1811
+	 * @param callbackMethod
1812
+	 * @param argArray
1813
+	 */
1814
+	@JSFunction
1815
+	public void executeClientSideJS(String jsToExecute, Function callbackMethod,
1816
+			String[] argArray) {
1817
+		executeJS(jsToExecute, callbackMethod, argArray);
1818
 	}
1819
-
1820
-	public void js_executeClientSideJS(String js, Function callback,
1821
-			String[] args) {
1822
-		executeJS(js, callback, args);
1823
-	}
1824
 	
1825
-	public String js_generateCallbackScript(Function callback) {
1826
-		return js_generateCallbackScript(callback, null);
1827
+	/**
1828
+	 * @clonedesc generateCallbackScript(Function, String[], boolean)
1829
+	 * @sampleas generateCallbackScript(Function, String[], boolean)
1830
+	 * @param callbackMethod
1831
+	 * @return
1832
+	 */
1833
+	@JSFunction
1834
+	public String generateCallbackScript(Function callbackMethod) {
1835
+		return generateCallbackScript(callbackMethod, null);
1836
 	}
1837
 	
1838
-	public String js_generateCallbackScript(Function callback, String[] args) {
1839
-		return addCallback(callback, args,true);
1840
+	/**
1841
+	 * @clonedesc generateCallbackScript(Function, String[], boolean)
1842
+	 * @sampleas generateCallbackScript(Function, String[], boolean)
1843
+	 * @param callbackMethod
1844
+	 * @param argArray
1845
+	 * @return
1846
+	 */
1847
+	@JSFunction
1848
+	public String generateCallbackScript(Function callbackMethod, String[] argArray) {
1849
+		return addCallback(callbackMethod, argArray,true);
1850
 	}
1851
 	
1852
-	public String js_generateCallbackScript(Function callback, String[] args, boolean showLoadingIndicator) {
1853
-		return addCallback(callback, args,showLoadingIndicator);
1854
+	/**
1855
+	 * Adds web-client call-back behavior for a method, passing optional parameters, and optionally hiding the Ajax callback indicator.
1856
+	 * Returns the javascript for the client.
1857
+	 * 
1858
+	 * @sample
1859
+	 * var callback = %%elementName%%.generateCallbackScript(myMethod, ['arg1','argN'], true);
1860
+	 * var script = 'function myFunction(arg1, argN){'+callback+'}';
1861
+	 * var markup = '<html><head><script type=\"text/javascript\">'+script+'</script></head></html>';
1862
+	 * 
1863
+	 * @param callbackMethod
1864
+	 * @param argArray
1865
+	 * @param showIndicator
1866
+	 * @return
1867
+	 */
1868
+	@JSFunction
1869
+	public String generateCallbackScript(Function callbackMethod, String[] argArray, boolean showIndicator) {
1870
+		return addCallback(callbackMethod, argArray,showIndicator);
1871
 	}
1872
 
1873
-
1874
-	/** @deprecated */
1875
-	public String js_addCallback(Function callback) {
1876
-		return js_generateCallbackScript(callback, null);
1877
+	/**
1878
+	 * 
1879
+	 * @param callbackMethod
1880
+	 * @return
1881
+	 */
1882
+	@Deprecated
1883
+	@JSFunction
1884
+	public String addCallback(Function callbackMethod) {
1885
+		return generateCallbackScript(callbackMethod, null);
1886
 	}
1887
 
1888
-	/** @deprecated */
1889
-	public String js_addCallback(Function callback, String[] args) {
1890
-		return js_generateCallbackScript(callback, args);
1891
+	/**
1892
+	 * 
1893
+	 * @param callbackMethod
1894
+	 * @param argArray
1895
+	 * @return
1896
+	 */
1897
+	@Deprecated
1898
+	@JSFunction
1899
+	public String addCallback(Function callbackMethod, String[] argArray) {
1900
+		return generateCallbackScript(callbackMethod, argArray);
1901
 	}
1902
 
1903
-	public String js_getElementMarkupId(Object element) {
1904
-		if (element instanceof Component) {
1905
-			return ((Component) element).getMarkupId();
1906
+	/**
1907
+	 * Returns a Servoy markup Id to be used in your browser scripts.
1908
+	 * 
1909
+	 * @sample
1910
+	 * var wicketID = %%elementName%%.getElementMarkupId(elements.aField);
1911
+	 * 
1912
+	 * @param formElement
1913
+	 * @return
1914
+	 */
1915
+	@JSFunction
1916
+	public String getElementMarkupId(Object formElement) {
1917
+		if (formElement instanceof Component) {
1918
+			return ((Component) formElement).getMarkupId();
1919
 		}
1920
 		return null;
1921
 	}
1922
 	
1923
-	public void js_setExtraCssClass(Object element, String cssClass) {
1924
-		if (cssClass != null && element instanceof Component) {
1925
+	/**
1926
+	 * Sets an extra class attribute to an element.
1927
+	 * 
1928
+	 * @sample
1929
+	 * %%elementName%%.setExtraCssClass(elements.yourElement, 'specialClass');
1930
+	 * 
1931
+	 * @param element
1932
+	 * @param classAttribute
1933
+	 */
1934
+	@JSFunction
1935
+	public void setExtraCssClass(Object element, String classAttribute) {
1936
+		if (classAttribute != null && element instanceof Component) {
1937
 			Component component = (Component) element;
1938
 			List<IBehavior> behaviors = component.getBehaviors();
1939
 			if (behaviors != null) {
1940
@@ -371,7 +471,7 @@
1941
 				if (cssBehavior == null) {
1942
 					cssBehavior = new CssClassBehavior();
1943
 				}
1944
-				cssBehavior.setCssClass(cssClass);
1945
+				cssBehavior.setCssClass(classAttribute);
1946
 				if (!existed) {
1947
 					component.add(cssBehavior);
1948
 				}
1949
@@ -382,7 +482,16 @@
1950
 		}
1951
 	}
1952
 	
1953
-	public void js_removeExtraCssClass(Object element) {
1954
+	/**
1955
+	 * Removes an extra class attribute previously set to an element.
1956
+	 * 
1957
+	 * @sample
1958
+	 * %%elementName%%.removeExtraCssClass(elements.yourElement);
1959
+	 * 
1960
+	 * @param element
1961
+	 */
1962
+	@JSFunction
1963
+	public void removeExtraCssClass(Object element) {
1964
 		if (element instanceof Component) {
1965
 			Component component = (Component) element;
1966
 			List<IBehavior> behaviors = component.getBehaviors();
1967
@@ -404,16 +513,33 @@
1968
 		}
1969
 	}
1970
 	
1971
-	public void js_setRendered(Object element) {
1972
+	/**
1973
+	 * Marks the element as rendered to avoid the server from re-syncing again upon the next update.
1974
+	 * 
1975
+	 * @sample
1976
+	 * %%elementName%%.setRendered(elements.yourElement);
1977
+	 * 
1978
+	 * @param element
1979
+	 */
1980
+	@JSFunction
1981
+	public void setRendered(Object element) {
1982
 		if (element instanceof IProviderStylePropertyChanges) {
1983
 			((IProviderStylePropertyChanges) element).getStylePropertyChanges().setRendered();
1984
 		}
1985
 	}
1986
 	
1987
-	public void js_setMarkupVisible(Object element, boolean visible) {
1988
+	/**
1989
+	 * Sets the visiblity of the element markup.
1990
+	 * 
1991
+	 * @sampleas isMarkupVisible(Object)
1992
+	 * @param element
1993
+	 * @param visibility
1994
+	 */
1995
+	@JSFunction
1996
+	public void setMarkupVisible(Object element, boolean visibility) {
1997
 		if (element instanceof IProviderStylePropertyChanges) {
1998
 			Properties changes = ((IProviderStylePropertyChanges) element).getStylePropertyChanges().getChanges();
1999
-			if (visible) {
2000
+			if (visibility) {
2001
 				changes.remove("display");
2002
 			}
2003
 			else {
2004
@@ -423,7 +549,18 @@
2005
 		}
2006
 	}
2007
 	
2008
-	public boolean js_isMarkupVisible(Object element) {
2009
+	/**
2010
+	 * Returns true if the elements markup is visible in the page.
2011
+	 * 
2012
+	 * @sample
2013
+	 * var visible = %%elementName%%.isMarkupVisible(elements.yourElement);
2014
+	 * %%elementName%%.setMarkupVisible(elements.yourElement,!visible);
2015
+	 * 
2016
+	 * @param element
2017
+	 * @return
2018
+	 */
2019
+	@JSFunction
2020
+	public boolean isMarkupVisible(Object element) {
2021
 		if (element instanceof IProviderStylePropertyChanges) {
2022
 			Properties changes = ((IProviderStylePropertyChanges) element).getStylePropertyChanges().getChanges();
2023
 			return !changes.containsKey("display");
2024
@@ -431,38 +568,253 @@
2025
 		return false;
2026
 	}
2027
 
2028
-	public void js_addCssReference(String url) {
2029
-		addCssReference(url);
2030
+	/**
2031
+	 * @clonedesc addCssReference(String, Object)
2032
+	 * @sampleas addCssReference(String, Object)
2033
+	 * @param stringReference
2034
+	 */
2035
+	@JSFunction
2036
+	public void addCssReference(String stringReference) {
2037
+		internalAddCssReference(stringReference);
2038
 	}
2039
 
2040
-	public void js_addCssReference(ResourceReference url) {
2041
-		addCssReference(url);
2042
+	/**
2043
+	 * @clonedesc addCssReference(ResourceReference, Object)
2044
+	 * @sampleas addCssReference(ResourceReference, Object)
2045
+	 * @param webResourceReference
2046
+	 */
2047
+	@JSFunction
2048
+	public void addCssReference(ResourceReference webResourceReference) {
2049
+		internalAddCssReference(webResourceReference);
2050
 	}
2051
 
2052
-	public void js_removeCssReference(String url) {
2053
-		removeCssReference(url);
2054
+	/**
2055
+	 * @clonedesc removeCssReference(String, Object)
2056
+	 * @sampleas removeCssReference(String, Object)
2057
+	 * @param stringReference
2058
+	 */
2059
+	@JSFunction
2060
+	public void removeCssReference(String stringReference) {
2061
+		internalRemoveCssReference(stringReference);
2062
 	}
2063
 
2064
-	public void js_removeCssReference(ResourceReference url) {
2065
-		removeCssReference(url);
2066
+	/**
2067
+	 * @clonedesc removeCssReference(ResourceReference, Object)
2068
+	 * @sampleas removeCssReference(ResourceReference, Object)
2069
+	 * @param webResourceReference
2070
+	 */
2071
+	@JSFunction
2072
+	public void removeCssReference(ResourceReference webResourceReference) {
2073
+		internalRemoveCssReference(webResourceReference);
2074
 	}
2075
 
2076
-	public void js_addJsReference(String url) {
2077
-		addJsReference(url);
2078
+	protected Component getWicketComponentFromFormOrElement(Object formOrElement) {
2079
+		Component c = null;
2080
+		if (formOrElement instanceof IForm) c = getFormUIComponent((IForm) formOrElement);
2081
+		else if (formOrElement instanceof IComponent) c = getComponent((IComponent) formOrElement);
2082
+		return c;
2083
 	}
2084
+	
2085
+	/**
2086
+	 * Adds a global (or form/element when the second arg. is provided) css url.
2087
+	 * Note: up to plugin version v1.3.6, global references had a bug - they were only added to current request's page (each time the API was used).
2088
+	 * 
2089
+	 * @sample
2090
+	 * // add global reference (to all pages)
2091
+	 * %%elementName%%.addCssReference('http://yourserver.com/css/yourstyle.css');
2092
+	 * //add form reference
2093
+	 * %%elementName%%.addCssReference('http://yourserver.com/css/yourstyle.css', forms.myFormWithSpecialCSS);
2094
+	 * //add form element reference
2095
+	 * %%elementName%%.addCssReference('http://yourserver.com/css/yourstyle.css', elements.myElementWithSpecialCSS);
2096
+	 * 
2097
+	 * @param stringReference
2098
+	 * @param formOrElement
2099
+	 */
2100
+	@JSFunction
2101
+	public void addCssReference(String stringReference, Object formOrElement) {
2102
+		internalAddCssReference(stringReference, getWicketComponentFromFormOrElement(formOrElement));
2103
+	}
2104
 
2105
-	public void js_addJsReference(ResourceReference url) {
2106
-		addJsReference(url);
2107
+	/**
2108
+	 * Adds a built-in servoy css reference (see SERVOY_WEB_RESOURCES) to all pages (when global) or only to pages containing that form/element (when the second arg. is provided).
2109
+	 * Note: up to plugin version v1.3.6, global references had a bug - they were only added to current request's page (each time the API was used).
2110
+	 * 
2111
+	 * @sample
2112
+	 * // add Servoy internal CSS style sheets (like Yahoo UI widgets styles)
2113
+	 * // Note that Yahoo UI widgets are only present from Servoy 60 and higer.
2114
+	 * %%elementName%%.addCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU)
2115
+	 * //add form reference
2116
+	 * %%elementName%%.addCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU, forms.myFormWithSpecialCSS);
2117
+	 * //add form element reference
2118
+	 * %%elementName%%.addCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU, elements.myElementWithSpecialCSS);
2119
+	 * 
2120
+	 * @param webResourceReference
2121
+	 * @param formOrElement
2122
+	 */
2123
+	@JSFunction
2124
+	public void addCssReference(ResourceReference webResourceReference, Object formOrElement) {
2125
+		internalAddCssReference(webResourceReference, getWicketComponentFromFormOrElement(formOrElement));
2126
 	}
2127
 
2128
-	public void js_removeJsReference(String url) {
2129
-		removeJsReference(url);
2130
+	/**
2131
+	 * Removes a built-in Servoy css reference (see SERVOY_WEB_RESOURCES).
2132
+	 * 
2133
+	 * @sample
2134
+	 * // remove Servoy internal CSS style sheets (like Yahoo UI widgets styles)
2135
+	 * // Note that Yahoo UI widgets are only present from Servoy 60 and higer.
2136
+	 * %%elementName%%.removeCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU);
2137
+	 * //remove form reference
2138
+	 * %%elementName%%.removeCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU, forms.myFormWithSpecialCSS);
2139
+	 * //remove form element reference
2140
+	 * %%elementName%%.removeCssReference(SERVOY_WEB_RESOURCES.YUI_CSS_MENU, elements.myElementWithSpecialCSS);
2141
+	 * 
2142
+	 * @param webResourceReference
2143
+	 * @param formOrElement
2144
+	 */
2145
+	@JSFunction
2146
+	public void removeCssReference(ResourceReference webResourceReference, Object formOrElement) {
2147
+		internalRemoveCssReference(webResourceReference, getWicketComponentFromFormOrElement(formOrElement));
2148
 	}
2149
 
2150
-	public void js_removeJsReference(ResourceReference url) {
2151
-		removeJsReference(url);
2152
+	/**
2153
+	 * Removes a global (or form/element when the second arg. is provided) css url.
2154
+	 * 
2155
+	 * @sample
2156
+	 * // remove global reference
2157
+	 * %%elementName%%.removeCssReference('http://yourserver.com/css/yourstyle.css');
2158
+	 * //remove form reference
2159
+	 * %%elementName%%.removeCssReference('http://yourserver.com/css/yourstyle.css', forms.myFormWithSpecialCSS);
2160
+	 * //remove form element reference
2161
+	 * %%elementName%%.removeCssReference('http://yourserver.com/css/yourstyle.css', elements.myElementWithSpecialCSS);
2162
+	 * 
2163
+	 * @param stringReference
2164
+	 * @param formOrElement
2165
+	 */
2166
+	@JSFunction
2167
+	public void removeCssReference(String stringReference, Object formOrElement) {
2168
+		internalRemoveCssReference(stringReference, getWicketComponentFromFormOrElement(formOrElement));
2169
 	}
2170
 
2171
+	/**
2172
+	 * @clonedesc addJsReference(String, Object)
2173
+	 * @sampleas addJsReference(String, Object)
2174
+	 * @param stringReference
2175
+	 */
2176
+	@JSFunction
2177
+	public void addJsReference(String stringReference) {
2178
+		internalAddJsReference(stringReference);
2179
+	}
2180
+
2181
+	/**
2182
+	 * @clonedesc addJsReference(ResourceReference, Object)
2183
+	 * @sampleas addJsReference(ResourceReference, Object)
2184
+	 * @param webResourceReference
2185
+	 */
2186
+	@JSFunction
2187
+	public void addJsReference(ResourceReference webResourceReference) {
2188
+		internalAddJsReference(webResourceReference);
2189
+	}
2190
+
2191
+	/**
2192
+	 * @clonedesc removeJsReference(String, Object)
2193
+	 * @sampleas removeJsReference(String, Object)
2194
+	 * @param stringReference
2195
+	 */
2196
+	@JSFunction
2197
+	public void removeJsReference(String stringReference) {
2198
+		internalRemoveJsReference(stringReference);
2199
+	}
2200
+
2201
+	/**
2202
+	 * @clonedesc removeJsReference(ResourceReference, Object)
2203
+	 * @sampleas removeJsReference(ResourceReference, Object)
2204
+	 * @param webResourceReference
2205
+	 */
2206
+	@JSFunction
2207
+	public void removeJsReference(ResourceReference webResourceReference) {
2208
+		internalRemoveJsReference(webResourceReference);
2209
+	}
2210
+
2211
+	/**
2212
+	 * Adds a global (or form/element when the second arg. is provided) javascript url.
2213
+	 * Note: up to plugin version v1.3.6, global references had a bug - they were only added to current request's page (each time the API was used).
2214
+	 * 
2215
+	 * @sample
2216
+	 * // add global reference (to all pages)
2217
+	 * %%elementName%%.addJsReference('http://yourserver.com/js/yourscript.js');
2218
+	 * //add form reference
2219
+	 * %%elementName%%.addJsReference('http://yourserver.com/js/yourscript.js', forms.myFormWithSpecialJS);
2220
+	 * //add form element reference
2221
+	 * %%elementName%%.addJsReference('http://yourserver.com/js/yourscript.js', elements.myElementWithSpecialJS);
2222
+	 * 
2223
+	 * @param stringReference
2224
+	 * @param formOrElement
2225
+	 */
2226
+	@JSFunction
2227
+	public void addJsReference(String stringReference, Object formOrElement) {
2228
+		internalAddJsReference(stringReference, getWicketComponentFromFormOrElement(formOrElement));
2229
+	}
2230
+
2231
+	/**
2232
+	 * Adds a built-in servoy javascript reference (see SERVOY_WEB_RESOURCES) to all pages (when global) or only to pages containing that form/element (when the second arg. is provided).
2233
+	 * Note: up to plugin version v1.3.6, global references had a bug - they were only added to current request's page (each time the API was used).
2234
+	 * 
2235
+	 * @sample
2236
+	 * // add Servoy internal reference scripts (like Yahoo UI widgets)
2237
+	 * // Note that Yahoo UI widgets are only present from Servoy 60 and higer.
2238
+	 * %%elementName%%.addJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU);
2239
+	 * //add form reference
2240
+	 * %%elementName%%.addJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU, forms.myFormWithSpecialJS);
2241
+	 * //add form element reference
2242
+	 * %%elementName%%.addJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU, elements.myElementWithSpecialJS);
2243
+	 * 
2244
+	 * @param webResourceReference
2245
+	 * @param formOrElement
2246
+	 */
2247
+	@JSFunction
2248
+	public void addJsReference(ResourceReference webResourceReference, Object formOrElement) {
2249
+		internalAddJsReference(webResourceReference, getWicketComponentFromFormOrElement(formOrElement));
2250
+	}
2251
+
2252
+	/**
2253
+	 * Removes a global (or form/element when the second arg. is provided) javascript url.
2254
+	 * 
2255
+	 * @sample
2256
+	 * // remove global reference
2257
+	 * %%elementName%%.removeJsReference('http://yourserver.com/js/yourscript.js');
2258
+	 * //remove form reference
2259
+	 * %%elementName%%.removeJsReference('http://yourserver.com/js/yourscript.js', forms.myFormWithSpecialJS);
2260
+	 * //remove form element reference
2261
+	 * %%elementName%%.removeJsReference('http://yourserver.com/js/yourscript.js', elements.myElementWithSpecialJS);
2262
+	 * 
2263
+	 * @param stringReference
2264
+	 * @param formOrElement
2265
+	 */
2266
+	@JSFunction
2267
+	public void removeJsReference(String stringReference, Object formOrElement) {
2268
+		internalRemoveJsReference(stringReference, getWicketComponentFromFormOrElement(formOrElement));
2269
+	}
2270
+
2271
+	/**
2272
+	 * Removes a built-in Servoy javascript reference (see SERVOY_WEB_RESOURCES).
2273
+	 * 
2274
+	 * @sample
2275
+	 * // remove Servoy internal reference scripts (like Yahoo UI widgets)
2276
+	 * // Note that Yahoo UI widgets are only present from Servoy 60 and higer.
2277
+	 * %%elementName%%.removeJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU);
2278
+	 * //remove form reference
2279
+	 * %%elementName%%.removeJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU, forms.myFormWithSpecialJS);
2280
+	 * //remove form element reference
2281
+	 * %%elementName%%.removeJsReference(SERVOY_WEB_RESOURCES.YUI_JS_MENU, elements.myElementWithSpecialJS);
2282
+ 	 * 
2283
+	 * @param webResourceReference
2284
+	 * @param formOrElement
2285
+	 */
2286
+	@JSFunction
2287
+	public void removeJsReference(ResourceReference webResourceReference, Object formOrElement) {
2288
+		internalRemoveJsReference(webResourceReference, getWicketComponentFromFormOrElement(formOrElement));
2289
+	}
2290
+
2291
 	private IWebClientPluginAccess getApp() {
2292
 		IClientPluginAccess app = plugin.getApp();
2293
 		if (app != null && app instanceof IWebClientPluginAccess) {
    (1-1/1)