Reputation: 173
I am working on a older project that uses the framework: Dojo Toolkit. I have a jsp-file with the following code:
dojo.style(dojo.byId('nameContainer'), 'display', 'none');
I am getting the id of the element in my DOM and setting the css-style to display:none. Now I want to do set it dynamically based on a request-parameter. Something like this:
if (request.getAttribute("testAttributes").get("newName") === "test"){
dojo.style(dojo.byId('nameContainer'), 'display', '');
} else {
dojo.style(dojo.byId('nameContainer'), 'display', 'none');
}
I debugged the code and I am getting the attributeValue correctly, however I don't know how to compare two Strings in DOJO. I have tried several ways and cannot find anything useful in the documentation. The code above doesnt do anything..the debuggers jumps in the if-condition and the else-condition
Upvotes: 1
Views: 237