Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am in the process to create a new component. I am able to retrieve all parameters as strings except for a Parameter closed list, which gets pickup as a variable and not a string.
The METHOD parameters is the only CLOSED_LIST parameter. Please see XML below.
I used a standard ElementParameterParser.getValue to retrieve the set value.
Here I set my string Variable with the value I just retrieved.
As you see, when I try to run it, I get a message that the system cannot resolve the POST variable, but it is not a variable but a value of the httpMethod_<%=cid%> value.
When I look at the code, I can see all my other variable were set properly but for myhttpMethod_<%=cid%> variable value. The POST was set without the quotation mark. When I hard code the POST value, than the component works as expected.
Any help to resolve this would be very much appreciated.
Regards,
Joseph
I realized that I had to append the quotes as I was reading in the variable. Here is the line I changed that got me the result I was looking for.
String method = "\""+ElementParameterParser.getValue(node,"__METHOD__")+"\"";
Thank you for your support.
Not sure (not much experience creating components), but while generating the code, it resolves to a var name in stead of a string value, "\"POST\"" escape your quotes.
Why not use default and set it to POST
I realized that I had to append the quotes as I was reading in the variable. Here is the line I changed that got me the result I was looking for.
String method = "\""+ElementParameterParser.getValue(node,"__METHOD__")+"\"";
Thank you for your support.