Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8329615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:51:00+00:00 2026-06-09T01:51:00+00:00

In my index.html I have the following template <script type=text/x-handlebars> {{#with ChatApp.messagesController}} {{view Ember.TextArea

  • 0

In my index.html I have the following template

<script type="text/x-handlebars">
    {{#with ChatApp.messagesController}}
      {{view Ember.TextArea valueBinding="content.message" rows="12" cols="70"}}
    {{/with}}
  </script>

My messages model looks like this

ChatApp.Message = Ember.Object.extend({
  message: null
});

My messages view and controller look like this

ChatApp.messagesView = Ember.View.extend({});

ChatApp.messagesController = Ember.ArrayController.create({                                                                                           
  content: [],
  text: '',
  sendMessage: function() {
    var newChatText = this.get('text');
    socket.emit('sendchat', newChatText);
  },
  updateChat: function(username, text) {
    var controller = this;
    var content = this.get('content');
    var newMessage = ChatApp.Message.create({ message: text });

    content.push(newMessage);
    console.log("update " + controller.get('content'));
    controller.set('content', content);
  }
});

I can see in the console.log that with each update another model object is being added to the content, yet the text area isn’t being updated

Here is the jsFiddle url http://jsfiddle.net/eDfKJ/

Thank you in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:51:02+00:00Added an answer on June 9, 2026 at 1:51 am

    What I would do instead is to have a computed property which binds to the content and returns an aggregated string of all the messages, and I would bind the textarea to that.

    Something like:

    messages: function() {
        var content = this.get('content');
        var messages = "";
    
        ... loop the content and combine the messages string... 
    
        return messages;
    
    }.property('content.@each')
    

    and in your template:

      <script type="text/x-handlebars">
        {{#with ChatApp.messagesController}}
          {{view Ember.TextArea valueBinding="content.messages" rows="12" cols="70"}}
        {{/with}}
      </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

js undefined error we have the following widget code : index.html <script type=text/javascript language=javascript>
In my rails view(index.html.erb), i have following structure <div> <%= render :partial => create
I have the following html text. <ol class=otherstufflinks> <li> <a href=./pythonNotes/index.html>Python notes</a> </li> <li>
I have the following directory structure : /script/x.js /includes/x.txt /1/2/index.html After hooking a webpage
I have the following code <xsl:result-document href=output1/output3/index.html format=html> <html> <head> <SCRIPT LANGUAGE=JavaScript> function getParams()
I have the following file structure: |- index.html vendor |- jquery.min.js (some libraries) js
I have the following jQueryMobile page anatomy at index.html: <div data-role=page> <div data-role=header>...</div> <div
I have the following form: @model Teesa.Models.SearchModel @using (Html.BeginForm(Index, Search, FormMethod.Get, new { id
I have in my app/views/bar/index.html.haml the following %p= render partial: 'foo', collection: @foos the
I have a template in joomla without index.php I only have index.html, css file,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.