<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1443021860739_3613">It's nothing special :</div><div id="yui_3_16_0_1_1443021860739_3634" dir="ltr">$( "#City" ).selectmenu({<br class="" id="yui_3_16_0_1_1443021860739_3615"> select: function( event, ui ) {<br class="" id="yui_3_16_0_1_1443021860739_3617"> $.ajax({ url: '/cities',<br class="" id="yui_3_16_0_1_1443021860739_3621"> type: "POST",<br class="" id="yui_3_16_0_1_1443021860739_3623"> data: {'City':$("#City" ).val()}}).success(function(data){<br class="" id="yui_3_16_0_1_1443021860739_3625"> $("#display").html(data);});<br class="" id="yui_3_16_0_1_1443021860739_3627"> },<br class="" id="yui_3_16_0_1_1443021860739_3629"> <br class="" id="yui_3_16_0_1_1443021860739_3631"> <br class="" id="yui_3_16_0_1_1443021860739_3633"> });</div><div id="yui_3_16_0_1_1443021860739_3638" dir="ltr"><br></div><div id="yui_3_16_0_1_1443021860739_3696" dir="ltr">I don't know how related it can be,as I've just reverted to the old pre Plugin code and everything works fine.When I use the Plugin I get those side effects<br></div><div id="yui_3_16_0_1_1443021860739_3575"><span></span></div> <br><div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"> <font face="Arial" size="2"> On Wednesday, September 23, 2015 3:13 PM, Stefan Hornburg (Racke) <racke@linuxia.de> wrote:<br> </font> </div> <br><br> <div class="y_msg_container">On 09/23/2015 01:28 PM, Mike Cu wrote:<div class="yqt6028595056" id="yqtfd30089"><br clear="none">> I've replaced all my<br clear="none">> $dbh = DBI->connect, $sth = $dbh->prepare calls with<br clear="none">> the Dancer2::Plugin::Database equivalents<br clear="none">> Before that, when there was interaction with the UI, I would explicitly connect, run all my sql and then disconnect, on every Ajax call .<br clear="none">> <br clear="none">> After I switched to Dancer2::Plugin::Database,I have to do the same interaction, for example, clicking a button which invokes an Ajax call which in turn calls the database retrieving the new data and updates the UI, does not have an immediate effect ,the UI is not being updated. So I have to do the same move (click a second time) for getting the desirable outcome<br clear="none">> <br clear="none">> Has that something to do with caching and reusing the connection?</div><br clear="none">> <br clear="none"><br clear="none">It shouldn't - how does your code for the Ajax call looks like?<br clear="none"><br clear="none">Regards<br clear="none"> Racke<br clear="none"><br clear="none">-- <br clear="none">Perl and Dancer Development<br clear="none"><br clear="none">Visit our Perl::Dancer conference 2015.<br clear="none">More information on https://www.perl.dance.<br clear="none"><br clear="none">_______________________________________________<br clear="none">dancer-users mailing list<br clear="none"><a shape="rect" ymailto="mailto:dancer-users@dancer.pm" href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br clear="none"><a shape="rect" href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><div class="yqt6028595056" id="yqtfd46230"><br clear="none"></div><br><br></div> </div> </div> </div></div></body></html>