Home > Contents > Index >
SEARCHSTATE.TOSTRING
Converts a searchstate object into its string representation that is suitable for various uses, such as saving in a session variable or packing into a URL.
Syntax
<SEARCHSTATE
.TOSTRING NAME="objname
" VARNAME="varname
"/>Parameters
NAME
(required)- Input parameter. Name of the object.
VARNAME
(required)- Input and output parameter. As input, name of the string that is assigned the string representation on output.
Error Numbers
The possible values of
errno
include:
Value Description -10004 A required parameter is missing. -13050 General error.Example
This code serializes a
SEARCHSTATE
"origSS" containing a simple constraint and creates a variable which contains the string representation.<SEARCHSTATE.CREATE NAME="ss" /> <SEARCHSTATE.ADDSIMPLESTANDARDCONSTRAINT NAME="ss" ATTRIBUTE="productdesc" VALUE="LU50/90/27"/> <SEARCHSTATE.TOSTRING NAME="ss" VARNAME="searchstring"/> <CSVAR NAME="searchstring"/><br/>The following code which would probably be in a page called by the above code then uses the variable searchstring passed on the URL to set a new searchstate "newSS" from the string representation. This code then sets this
SEARCHSTATE
into anASSETSET.SETSEARCHEDASSETS
tag to constrain theASSETSET
to be used when searching with otherASSETSET
tags. The last tag uses this constrained assetset to search for matching assets and fetch a list of values for a different attribute of the returned assets:<SEARCHSTATE.CREATE NAME="newSS" /> <SEARCHSTATE.FROMSTRING NAME="newSS" VALUE="Variables.searchstring"/> <ASSETSET.SETSEARCHEDASSETS NAME="as" CONSTRAINT="newSS" ASSETTYPES="Products"/> <ASSETSET.GETATTRIBUTEVALUES NAME="as" ATTRIBUTE="cat2" LISTVARNAME="resultlist"/> <LOOP LIST="resultlist"> <CSVAR NAME="resultlist.value"/><br/> </LOOP>See Also
SEARCHSTATE.CREATE
SEARCHSTATE.ADDSIMPLESTANDARDCONSTRAINT
SEARCHSTATE.FROMSTRING
Home > Contents > Index > ![]()
Oracle XML Tag Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.