Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Hi!
Sometimes I need to send some value from UI to the bean that will handle this value. As I Inderstand I can do it through commandBean. For example I can set parameter to the request: request.addParameter("par1", "val1"). But when I want to get it in formProcessor like request.getParameter("par1") I get null value.
What is wrong? Thanks!
In your FormProcessor, try getting the parameter like this:
HashMap<String,Object> params = ((ObjectBean)list.get(i)).getParameterMap();
String[] operations = (String[])params.get("operation");
Or if you don't know the exact name of the parameter, like this:
String valueString = null;
Iterator<String> iterator = params.keySet().iterator();
while (iterator. hasNext()) {
String keyName = (String) iterator.next();
if (keyName.contains("myParam___textbox") && !keyName.contains("___old")) {
String[] valueArray = (String[])params.get(key);
valueString = valueArray[0];
}
}
Something like that.