# Class BrowserComponent.JSProxy

java.lang.Object
com.codename1.ui.BrowserComponent.JSProxy

Enclosing class:
  `BrowserComponent`

public class BrowserComponent.JSProxy extends Object
A thin wrapper around a Javascript variable that makes it easier to call methods on that variable.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `call(int timeout, String method, Object[] args, SuccessCallback<BrowserComponent.JSRef> callback)`
  Calls a method on this javascript object.
  `void`
  `call(String method, Object[] args, SuccessCallback<BrowserComponent.JSRef> callback)`
  Calls a method on this javascript object.
  `BrowserComponent.JSRef`
  `callAndWait(int timeout, String method, Object[] args)`
  Calls method on this javascript object and waits for the result using invokeAndBlock.
  `BrowserComponent.JSRef`
  `callAndWait(String method, Object[] args)`
  Calls method on this javascript object and waits for the result using invokeAndBlock.
  `void`
  `get(int timeout, String property, SuccessCallback<BrowserComponent.JSRef> callback)`
  Gets a property of this javascript object.
  `void`
  `get(int timeout, Collection<String> properties, SuccessCallback<Map<String, BrowserComponent.JSRef>> callback)`
  Gets multiple properties as a batch.
  `void`
  `get(String property, SuccessCallback<BrowserComponent.JSRef> callback)`
  Gets a property of this javascript object.
  `void`
  `get(Collection<String> properties, SuccessCallback<Map<String, BrowserComponent.JSRef>> callback)`
  Gets a property of this javascript object and waits for the result using invokeAndBlock.
  `BrowserComponent.JSRef`
  `getAndWait(int timeout, String property)`
  Gets a property of this javascript object and waits for the result using invokeAndBlock.
  `Map<String, BrowserComponent.JSRef>`
  `getAndWait(int timeout, Collection<String> properties)`
  Gets multiple properties on this object in a batch.
  `BrowserComponent.JSRef`
  `getAndWait(String property)`
  Gets a property of this javascript object and waits for the result using invokeAndBlock.
  `Map<String, BrowserComponent.JSRef>`
  `getAndWait(Collection<String> properties)`
  Gets multiple properties on this object in a batch.
  `void`
  `set(int timeout, String property, Object value)`
  Sets a property.
  `void`
  `set(int timeout, String property, Object value, SuccessCallback<BrowserComponent.JSRef> callback)`
  Sets a property on this javascript object.
  `void`
  `set(int timeout, Map<String,Object> properties, SuccessCallback<BrowserComponent.JSRef> callback)`
  Sets multiple properties in a single batch.
  `void`
  `set(String property, Object value)`
  Sets a property.
  `void`
  `set(String property, Object value, SuccessCallback<BrowserComponent.JSRef> callback)`
  Sets a property on this javascript object.
  `void`
  `set(Map<String,Object> properties, SuccessCallback<BrowserComponent.JSRef> callback)`
  Sets multiple properties in a single batch.
  `void`
  `setAndWait(int timeout, String property, Object value)`
  Sets a property on this javascript object and waits for it to complete using invokeAndBlock.
  `void`
  `setAndWait(int timeout, Map<String,Object> properties)`
  Sets multiple properties in a single batch.
  `void`
  `setAndWait(String property, Object value)`
  Sets a property on this javascript object and waits for it to complete using invokeAndBlock.
  `void`
  `setAndWait(Map<String,Object> properties)`
  Sets multiple properties in a single batch.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### call

    public void call(int timeout, String method, Object[] args, SuccessCallback<BrowserComponent.JSRef> callback)

    Calls a method on this javascript object.

    ###### Parameters

    - `timeout`: The timeout in ms

    - `method`: The method name.

    - `args`: Arguments to pass to the method.

    - `callback`: Callback with the result of the method.

  - ### call

    public void call(String method, Object[] args, SuccessCallback<BrowserComponent.JSRef> callback)

    Calls a method on this javascript object.

    ###### Parameters

    - `method`: The method name.

    - `args`: Arguments to pass to the method.

    - `callback`: Callback with the result of the method.

  - ### callAndWait

    public BrowserComponent.JSRef callAndWait(int timeout, String method, Object[] args)

    Calls method on this javascript object and waits for the result using invokeAndBlock.

    ###### Parameters

    - `timeout`: The timeout in ms

    - `method`: The method name.

    - `args`: Arguments for the method.

    ###### Returns

    JSRef with the result of the method call.

  - ### callAndWait

    public BrowserComponent.JSRef callAndWait(String method, Object[] args)

    Calls method on this javascript object and waits for the result using invokeAndBlock.

    ###### Parameters

    - `method`: The method name.

    - `args`: Arguments for the method.

    ###### Returns

    JSRef with the result of the method call.

  - ### get

    public void get(int timeout, String property, SuccessCallback<BrowserComponent.JSRef> callback)

    Gets a property of this javascript object.

    ###### Parameters

    - `timeout`: Timeout in ms

    - `property`: The property name.

    - `callback`: Callback with the property value.

  - ### get

    public void get(String property, SuccessCallback<BrowserComponent.JSRef> callback)

    Gets a property of this javascript object.

    ###### Parameters

    - `property`: The property name.

    - `callback`: Callback with the property value.

  - ### get

    public void get(int timeout, Collection<String> properties, SuccessCallback<Map<String, BrowserComponent.JSRef>> callback)

    Gets multiple properties as a batch.

    ###### Parameters

    - `timeout`: Timeout in ms

    - `properties`: List of property names to retrieve.

    - `callback`

  - ### get

    public void get(Collection<String> properties, SuccessCallback<Map<String, BrowserComponent.JSRef>> callback)

    Gets a property of this javascript object and waits for the result using invokeAndBlock.

    ###### Parameters

    - `property`: The property to retrieve.

    ###### Returns

    The property value.

  - ### getAndWait

    public BrowserComponent.JSRef getAndWait(int timeout, String property)

    Gets a property of this javascript object and waits for the result using invokeAndBlock.

    ###### Parameters

    - `timeout`: The timeout in ms

    - `property`: The property to retrieve.

    ###### Returns

    The property value.

  - ### getAndWait

    public BrowserComponent.JSRef getAndWait(String property)

    Gets a property of this javascript object and waits for the result using invokeAndBlock.

    ###### Parameters

    - `property`: The property to retrieve.

    ###### Returns

    The property value.

  - ### getAndWait

    public Map<String, BrowserComponent.JSRef> getAndWait(int timeout, Collection<String> properties)

    Gets multiple properties on this object in a batch.

    ###### Parameters

    - `timeout`: The timeout in ms

    - `properties`: The property names to get.

  - ### getAndWait

    public Map<String, BrowserComponent.JSRef> getAndWait(Collection<String> properties)

    Gets multiple properties on this object in a batch.

    ###### Parameters

    - `properties`

  - ### set

    public void set(int timeout, String property, Object value)

    Sets a property.

    ###### Parameters

    - `timeout`: The timeout in ms

    - `property`: The property name.

    - `value`: The property value.

  - ### set

    public void set(String property, Object value)

    Sets a property.

    ###### Parameters

    - `property`: The property name.

    - `value`: The property value.

  - ### set

    public void set(int timeout, String property, Object value, SuccessCallback<BrowserComponent.JSRef> callback)

    Sets a property on this javascript object.

    ###### Parameters

    - `timeout`: The timeout in ms.

    - `property`: The property name to set.

    - `value`: The property value.

    - `callback`: Callback which is called when complete

  - ### set

    public void set(String property, Object value, SuccessCallback<BrowserComponent.JSRef> callback)

    Sets a property on this javascript object.

    ###### Parameters

    - `property`: The property name to set.

    - `value`: The property value.

    - `callback`: Callback which is called when complete

  - ### set

    public void set(int timeout, Map<String,Object> properties, SuccessCallback<BrowserComponent.JSRef> callback)

    Sets multiple properties in a single batch.

    ###### Parameters

    - `timeout`: The timeout in ms

    - `properties`: The properties to set.

    - `callback`: Callback called when operation is completed.

  - ### set

    public void set(Map<String,Object> properties, SuccessCallback<BrowserComponent.JSRef> callback)

    Sets multiple properties in a single batch.

    ###### Parameters

    - `properties`: The properties to set.

    - `callback`: Callback called when operation is completed.

  - ### setAndWait

    public void setAndWait(int timeout, Map<String,Object> properties)

    Sets multiple properties in a single batch.

    ###### Parameters

    - `timeout`: Timeout in ms

    - `properties`: The properties to set on this object.

  - ### setAndWait

    public void setAndWait(Map<String,Object> properties)

    Sets multiple properties in a single batch.

    ###### Parameters

    - `properties`: The properties to set on this object.

  - ### setAndWait

    public void setAndWait(int timeout, String property, Object value)

    Sets a property on this javascript object and waits for it to complete using invokeAndBlock.

    ###### Parameters

    - `timeout`: The timeout in ms.

    - `property`: The property name to set.

    - `value`: The value to set.

  - ### setAndWait

    public void setAndWait(String property, Object value)

    Sets a property on this javascript object and waits for it to complete using invokeAndBlock.

    ###### Parameters

    - `property`: The property name to set.

    - `value`: The value to set.