Home Dynamic pass value in a Play2 scala template
Reply: 0

Dynamic pass value in a Play2 scala template

user5154
1#
user5154 Published in September 21, 2018, 8:04 am

I try to dynamically change value of its variable. Once onclick (Change Ticket ID ) button then execute onClickSendEmail and variable value should be change of tickedId. Its unable to update with newTickedId. I tried while create variable using @defining and individual calling by function also. So, Basically I got stuck. how it will be solve.

@(sender: String)
<!--@{var tickedId = "tickedId"}-->


@defining(sender.contains("@")) {isEmail =>
@main((if(isEmail) "Email" else "Chat") + " Messages - " + sender) {

    ...
    ...
    ...
<div>
 <a onclick="onClickSendEmail();return false;">
            Change Ticket ID
     </a>
</div>

@defining("getTicketId()") { tickedId =>

        @views.html.common.form.panel("Reply",controllers.routes.ChatMessageController.sendEmail(tickedId,sender),"Send"){
                <textarea id="emailArea" cols="100" rows="4" name="emailArea"></textarea>
        }


<script type="text/javascript">
            function onClickSendEmail() {
                tickedId= "NewUpdatedTicketId";
            }
     function getTicketId() {
             return "NewUpdatedTicketId";
            }
    </script>
 }
}
}
share|improve this question

1 Answer 1

active oldest votes
up vote 1 down vote accepted
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.29633 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO