Not to get new data from server with Ember.js - ember.js

I has a site based on Ember.js. This site has a textarea where models' field message is set. When user changes this field I make model.save(). Everything is ok but one thing: if I write something while save API request is not finished, text will be flushed to the version been saved to server.
How to explain to Ember that I want to use client version of this field, not server version?
Sorry for my english :(

I think ember-changeset would solve that.
Check this video out in emberscreencasts, it is a good explanation of what the problem it solves and how it works: https://www.emberscreencasts.com/posts/168-introduction-to-ember-changeset

Related

How to use react-router and Django templates

Folks,
I am pretty sure I am not the first one to stumble on this problem. But somehow I am unable to find any relevant resources out there.
Here is my issue, I have a backend in Django and my front completely written in Reactjs- React Router - Redux (nice combo right).
when entering the url webhost.com/, django provides me with a page with links to a bundle that is my whole react application and different stylesheets
The problem arise when I want to refresh a page, the browser still tries to query the server even though a route exists in my react-router configuration.
I had a look at the answer here (catch-all option) React-router urls don't work when refreshing or writting manually , but I don't quite understand it and I am afraid to have a new redux state everytime Django will provide the user with a new page.
You can setup up a wildcard url pattern that will render the same view that gets rendered when a request is sent to webhost.com. I don't know if that's going to retain your store though.

websockets with ember js

I'm having some difficulty figuring out how to integrate websockets with my ember js app. I don't know how to emulate websocket behavior in jsbin, so here's the nonfunctional example --
http://jsbin.com/iFUZoza/1/edit
Imagine this working up to the point where I log "finding..." (It does. I get the object I'm looking for from the socket.) Unfortunately from there, I'm not sure how to get the contact model in question out of Ember. Basically, I've listed all of the contacts in the UI, and I want to retrieve a single model from the controller and update it in real time. I've got as far as getting the sockets functional, but I don't know how to get that model back. I'm not even sure if I've inserted the socket code at the right place to do this. Can someone help or point me in the right direction?
Thanks.
I believe the route its a good place to create the socket connection and the controllers are the place to react according to what happened in the socket.
I'd do something that resembles this JSBin:
http://jsbin.com/iFUZoza/4/edit?js,output
Hope this helps you!

Missing Webforms for Marketers Data

I'm attempting to troubleshoot a Sitecore system that has the Webforms for Marketers module installed.
I have submitted a contact form from the front-end but when I look at the form reports, there is only legacy data on the "Data" tab. If I look in the "Usability Report" tab, I can indeed see my submitted data.
There are several save actions set up, one of which is the Save to Database, and another is Send Mail. Neither seem to be firing.
Since the data is under the Usability report, it would seem that something is working but I'm not sure how to troubleshoot where the issue originates from.
One key piece of info is the site has recently been moved from one server to another. The connection strings work as far as I can tell, however. Also, there is no CD/CM separation, just a Master => Web publishing setup, though it seems like at one time before I got my hands on it, there was a staging server. Like I said though, the connection strings seem in order.
Any ideas?
Turns out I think it did have to do with a previous staging server. I removed the following from ConnectionStrings.config
<add name="remoteWfmService" connectionString="url=http://{mysite}/sitecore%20modules/shell/Web%20Forms%20for%20Marketers/Staging/WfmService.asmx;user={myuser};password={mypass};timeout=60000"/>
Once that came out, everything started working as expected.

QWebFrame load() not sending cookies upon initial page load

I am using QtWebkit to implement a browser in C++/Qt. When I open a new tab in it with a QWebView instance and load a URL using load() the page loads normally, but when it's a site where I'm logged in using cookies, it'll appear as though I'm not logged in at all, due to the cookies for that page not being sent along with the HTTP request (verified using SocketSniff).
The only thing I think that might make a difference would be the custom cookiejar I created, but I'm unsure what it might be since the cookiejar works fine otherwise. You can find the full source code at the Github link on the project page for the browser: http://www.mayaposch.com/wildfox.php and the Github link: https://github.com/MayaPosch/WildFox
Any clues are welcome :)
Well, I at last found out what the problem was. I narrowed it down to the custom cookiejar I implemented, which has an in-memory structure containing new and accessed cookies, and stores non-session cookies in an SQLite structure on disk. The problem was that after first loading a site, it'd find cookies in the SQLite database, load them into the in-memory structure, but not use them.
Small glitch with big consequences and very easy to figure out once you get down to it. My sincere apologies for wasting your time with this question. Hopefully this answer will help someone, though :)

create an object using the form django

Thank you for looking into this!
I doing one of those django tutorials from their official website, creating a poll. The poll app and everything is working.
The problem is that after I have created authentication for the users to log in they should be able to create the polls, aka they're given the fields with questions/choices, fil it in and from that data(form) it should a new poll object into the db. I have set up everything, but I cannot figure out how do I write the view for this, as in how do I extract data from the form and add it all as a new poll.
I am using three models, as in tutorial: polls, choices and user (user isn't recognisable either, i mean in the model 'user' i have a variable name = models.ForeignKey(User), I was using django-registration to register the them, but that's not the main problem at the moment).
I hope I am more or less clear, if not, I will be glad to explain again:)
thanks, blargie-bla
I'd recommend you starting with generic views.
https://docs.djangoproject.com/en/1.3/topics/class-based-views/#decorating-class-based-views
https://docs.djangoproject.com/en/1.3/ref/class-based-views/#editing-views