Added HopObject.getById() as proposed by Juerg Lehni
http://helma.org/bugs/show_bug.cgi?id=269 Added JavaDoc comments
This commit is contained in:
parent
2b9cee82da
commit
976db3a463
1 changed files with 32 additions and 10 deletions
|
@ -174,10 +174,10 @@ public class HopObject extends ScriptableObject implements Wrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Render a skin to the response buffer.
|
||||||
*
|
*
|
||||||
*
|
* @param skin The skin object or name
|
||||||
* @param skin ...
|
* @param param An optional parameter object
|
||||||
* @param param ...
|
|
||||||
*
|
*
|
||||||
* @return ...
|
* @return ...
|
||||||
*/
|
*/
|
||||||
|
@ -203,10 +203,10 @@ public class HopObject extends ScriptableObject implements Wrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Render a skin and return its output as string.
|
||||||
*
|
*
|
||||||
*
|
* @param skin The skin object or name
|
||||||
* @param skin ...
|
* @param param An optional parameter object
|
||||||
* @param param ...
|
|
||||||
*
|
*
|
||||||
* @return ...
|
* @return ...
|
||||||
*/
|
*/
|
||||||
|
@ -235,9 +235,9 @@ public class HopObject extends ScriptableObject implements Wrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Get the href (URL path) of this object within the application.
|
||||||
*
|
*
|
||||||
*
|
* @param action the action name, or null/undefined for the "main" action.
|
||||||
* @param action ...
|
|
||||||
*
|
*
|
||||||
* @return ...
|
* @return ...
|
||||||
*/
|
*/
|
||||||
|
@ -260,9 +260,9 @@ public class HopObject extends ScriptableObject implements Wrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Get a childObject by name/id or index
|
||||||
*
|
*
|
||||||
*
|
* @param id The name/id or index, depending if the argument is a String or Number.
|
||||||
* @param id ...
|
|
||||||
*
|
*
|
||||||
* @return ...
|
* @return ...
|
||||||
*/
|
*/
|
||||||
|
@ -286,6 +286,28 @@ public class HopObject extends ScriptableObject implements Wrapper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a child object by ID
|
||||||
|
*
|
||||||
|
* @param id the child id.
|
||||||
|
*
|
||||||
|
* @return ...
|
||||||
|
*/
|
||||||
|
public Object jsFunction_getById(Object id) {
|
||||||
|
if ((node == null) || (id == null) || id == Undefined.instance) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Object n = node.getSubnode(id.toString());
|
||||||
|
|
||||||
|
if (n == null) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return Context.toObject(n, core.global);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue