fidoandfido / blackswan

Blackswan Stock Game
Other
2 stars 0 forks source link

Forms for buying and selling shares is lame #13

Closed fidoandfido closed 13 years ago

fidoandfido commented 13 years ago

Forms for buying and selling shares should use an AJAX request rather than submit (and full page reload). This could be done simply using the jQuery library. This would require a change to the BuySharesServlet and SellSharesServlet classes (or creation of new ones...) to support the new convention; ie sending a redirect as a response.

At the same time, there should be some validation on the form before it is submitted.

See reference: http://en.wikipedia.org/wiki/Jquery

$.ajax({ type: "POST", url: "buysharesservlet", data: "companycode=AAAA&price=500&count=100", success: function(msg){ alert( "Data Saved: " + msg ); // Call some java script function to update the div showing the portfolio & current value } });

sherhan commented 13 years ago

I was thinking about this, as well as doing a div update for the portfolio and current value, the function should launch a pop up asking to confirm the trade.

fidoandfido commented 13 years ago

The buy and sell pages have been removed, will create a new issue for confirmation dialog.