Reputation: 177
any idea for this
var elemVal = $("#element").val();
var finalVal = "${someTagLib(attr: elemVal)}";
The element is a select option, so I am getting the value that the user selected to pass into a taglib function. It seems that search isn't being passed into the taglib. Anyone have a suggestion?
Upvotes: 0
Views: 734
Reputation: 25797
This is not possible at all. You are trying to mix server side code with client side code which is a common mistake.
When you use gsp's they first compiled on server i.e. in JVM, but there javascript can not be executed. Similarly when compiled gsp content is rendered as html in the browser, there will be no ${}
since that is an groovy expression.
So the thing you are trying to achieve is not possible.
Upvotes: 1