Grails notification

20 views
Skip to first unread message

Jagriti Srivastava

unread,
Jun 11, 2018, 2:18:51 AM6/11/18
to Grails Dev Discuss
Hello all 
I am using grails 2.5.2. and I got some problems with sending notifications. I am trying to send notification to every user who is loggedin . So I have some codes in view as 
$.ajax({
async: false,
url: "${g.createLink( controller: 'enquiry', action:'savePhoneCalls')}",
data:$.param(values),
cache:false,
dataType: 'json',
contentType: 'application/json; charset=utf-8',
success: showPhoneCalls(id)
});
 this is my codes in view after some click of check box and the controlller code is 
def savePhoneCalls(){
println "got value from ajax"
println "params values are "+params
def users = Users.findAllByUsrName(params.'phonecalls[]'[1])
println users
Users.executeUpdate("update Users u set u.active=:actv where u.id=:uid",[actv:java.lang.Boolean.TRUE,uid:users.id])
List<String> test=new LinkedList<String>()
def user = Users.executeQuery("select u.id,u.usrId from Users u")
for(def u:user){
test.add(u[0]+"("+u[1]+")")
}
println "json value is "+(test as JSON)
render (test as JSON)
}
and now i want to send the value from json to every user who is logged in but I am not getting any idea to push notification without page reload .Please help. 
Reply all
Reply to author
Forward
0 new messages