Package org.wicketstuff.urlfragment
Class UrlFragment
- java.lang.Object
-
- org.wicketstuff.urlfragment.UrlFragment
-
public class UrlFragment extends Object
Encapsulates the JavaScripts used to edit the URL fragment in the browser.- Author:
- Martin Knopf
-
-
Constructor Summary
Constructors Constructor Description UrlFragment(IPartialPageRequestHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UrlFragment
putParameter(String parameterName, Object parameterValue)
Puts the given key-value-pair into window.location.hash.UrlFragment
putParameter(String parameterName, Object parameterValue, String valueDelimiter)
Puts the given key-value-pair into window.location.hash.UrlFragment
removeParameter(String parameterName)
Removes the key-value-pair from window.location.hash that is identified by the given parameter name.UrlFragment
set(Object urlFragment)
Sets the value of window.location.hash to the given String.UrlFragment
set(String parameterName, Object parameterValue)
Sets the value of window.location.hash to the given key-value-pair.
-
-
-
Constructor Detail
-
UrlFragment
public UrlFragment(IPartialPageRequestHandler handler)
-
-
Method Detail
-
set
public UrlFragment set(Object urlFragment)
Sets the value of window.location.hash to the given String.- Parameters:
urlFragment
- JS function to handle location hash- Returns:
- this for chaining
-
set
public UrlFragment set(String parameterName, Object parameterValue)
Sets the value of window.location.hash to the given key-value-pair.- Parameters:
parameterName
- the name to be setparameterValue
- the value of the parameter being set- Returns:
- this for chaining
-
putParameter
public UrlFragment putParameter(String parameterName, Object parameterValue)
Puts the given key-value-pair into window.location.hash.- Parameters:
parameterName
- the name to be setparameterValue
- the value of the parameter being set- Returns:
- this for chaining
-
putParameter
public UrlFragment putParameter(String parameterName, Object parameterValue, String valueDelimiter)
Puts the given key-value-pair into window.location.hash. If the key already exists the value will be appended to the existing value with the given delimiter.- Parameters:
parameterName
- the name to be setparameterValue
- the value of the parameter being setvalueDelimiter
- parameter value delimiter to set multiple values- Returns:
- this for chaining
-
removeParameter
public UrlFragment removeParameter(String parameterName)
Removes the key-value-pair from window.location.hash that is identified by the given parameter name.- Parameters:
parameterName
- the name to be removed- Returns:
- this for chaining
-
-