PDA

View Full Version : how to escape taglibs in extjs



MmarcoM
12 May 2010, 6:25 AM
Hello all
i have following piece of js which uses spring taglib
the problem is that apparently extjs think is a javascript code and it gives me an error like 'missing closing character ']'

How can i escape the taglib instruction in extjs?

w/kindest regards
marco

Condor
12 May 2010, 7:23 AM
Tags in .jsps are processed before they are sent to the client, where the javascript runs.

So if you get a missing ']' error, then you are really missing a ']' (either in your .jsp or in the content generated by the tags).

MmarcoM
13 May 2010, 3:00 AM
Hello Condor
thanks for reply..
i have this code though (which appears correct to me) and stillg etting teh ']' error



"-"

<sec:authorize access="hasRole('ROLE_SUPERVISOR')">
, {
text: 'Skip To Latest',
id: 'skipAllBtn',
xtype: 'button',
tooltip: 'Skip all updates up to the latest',
icon: '../images/control_fastforward.png',
disabled: true,
handler: function () {
if (selectionModel.hasSelection()) {
skipAll(selectionModel.getSelected().get('productId'), selectionModel.getSelected().get('esmQueueStateId'), queueStore);
}
else {
showWarning('Unable to perform skip to latest', 'Please select a row');
}
}
},
"-",{
text: 'Approve All',
id: 'submitAll',
xtype: 'button',
tooltip: 'Approve All Items in PENDING state',
icon: '../images/asterisk_orange.png',
handler: function () {
submitAll(queueStore);
}
}

</sec:authorize>

]




how can i check what is being outputted in the page? viewPageSource does nt help

Animal
13 May 2010, 3:05 AM
If that error is being thrown by Javascript, then grab the javascript code, pass it through http://jsbeautifier.org/ and check it for errors.

You should be able to find the syntax error, then go back to your code generation JSP. You are just generating erroneous Javascript, and need to fix that.

CrazyEnigma
13 May 2010, 12:22 PM
The most likely culprit is a comma "," Think of the compiler, it's repeating its operation for every comma, but if no comma, then end terminate. If you didn't use a comma, it is expecting a "]" in an array.