Search Results

Search found 2613 results on 105 pages for 'undefined'.

Page 12/105 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • undefined GET id?

    - by Azzyh
    <?php $s = $_GET["s"]; if($s) { $hent_b = mysql_query("SELECT * FROM member_battles WHERE state = '1' ORDER BY id DESC LIMIT 0,200") or die(mysql_error()); }else{ $hent_b = mysql_query("SELECT * FROM member_battles WHERE state = '0' ORDER BY id DESC LIMIT 0,200") or die(mysql_error()); } while($vis = mysql_Fetch_array($hent_b)) { ?> I have this now i want when i enter my site (index.php) it should not come up undefined $_GET["s"]; how do i do this? but i want when you do index.php?s then it should change the query

    Read the article

  • RSpec "undefined local variable or method `user'"

    - by Justin
    I have the following test written in RSpec: describe '#create' do ... it 'redirects users to profile page' do response.should redirect_to user_path(user) end ... ... And the following in my UsersController: def create @user = User.new(params[:user]) if @user.save redirect_to user_path(@user) end end Does anyone know why this is returning the following error: NameError: undefined local variable or method 'user' I also tried changing this to be root_url in both cases instead of user_path(user) and it gave a different error saying: Expected response to be a <:redirect>, but was <200> Does anyone know what the issue might be? I have double-checked my code and have seen similar questions posted online, but haven't been able to find a solution. Thanks in advance for any help!

    Read the article

  • PHP Undefined index - Occuring when the variable has a value in it

    - by Adam
    I have the following code that is being used to successfully upload images: $fileName = $_FILES['file']['name']; $fileSize = $_FILES['file']['size']; $fileType = $_FILES['file']['type']; $fileTmp = $_FILES['file']['tmp_name']; list($origWidth, $origHeight) = getimagesize($fileTmp); The catch is I'm getting an 'Undefined index' on each line. I have print_r($_FILES) just before this code and each array variable exists and I've echo out varibles like $fileName and can see each has a value. Also I have put this before this code block and it makes no difference: $fileName = $fileSize = $fileType = $fileTmp = ''; Any suggestions how I can ensure these variables are defined? thankyou

    Read the article

  • Silverlight ScriptableMember in Firefox 'Content is undefined' error.

    - by Sergey Mirvoda
    Recently I'm learned how to call SIlverlight methods from JavaScript. All works fine (even in Chrome !). But in FireFox 3 (3.6.4) registered Page object is undefined. My Code is very simple silverlight [ScriptableMember] public bool HasFilter() { return true; } And in MainPage constructor public MainPage() { InitializeComponent(); HtmlPage.RegisterScriptableObject("Page",this); LayoutRoot.DataContext = viewModel; Loaded += OnLoaded; } JavaScript <head> <script type="text/javascript"> function UpdateFilter() { var sl = document.getElementById('SilverlightChartControl'); alert(sl); alert(sl.Content.Page.HasFilter()); } </script> </head> <body> <a href="#" id="resize" onclick="UpdateFilter(); return false;">TEST</a> </body>

    Read the article

  • jQuery UI Dialog Error: b("<div></div>").addClass("ui-widget-overlay") is undefined

    - by Mithun
    I have the below code for my a Dialog box for a which contains a dropdown field KPMS.ServiceRequests.Status = { showOptions : function(requestId, userId, requestType) { var url = BASE_URL+'service_requests/status_options/'; $("#dialog-modal").dialog("destroy"); $("#dialog-modal").load(url, {"request_id": requestId, "user_id": userId, "request_type":requestType}).dialog( { modal: true, title: "Update Status", buttons: { Cancel : function() { $(this).dialog('close'); }, Update: function() { alert(1); } } } ); } } There is an anchor tag to populate the Dialog <a onclick="KPMS.ServiceRequests.Status.showOptions(9, 11, 'SR'); return false;" title="Update status" href="http://localhost/kitco/pms/#9"><img alt="[E]" title="Update" src="http://localhost/kitco/pms/images/edit.png"></a> My problem is When i click the link for the first time the dialog box is populating properly. Then I closed the dialog using the cancel button, then again clicked the link to open the dialog and closed it. For the third click on the link I'm getting the below Javascript error, and Dialog box is not opened Error: b("<div></div>").addClass("ui-widget-overlay") is undefined Source File: http://localhost/kitco/pms/js/jquery-ui-1.8rc3.custom.min.js Line: 199 How to solve this problem?

    Read the article

  • findViewById undefined

    - by areyling
    Eclipse is marking findViewById(int) as undefined; it was doing the same thing for getResources(), but I was able to get around that by calling context.getResources() instead (as seen below) and can't seem to find a similar workaround for findViewById. Here is the code: package com.myapp.android.MyWidget; import android.appwidget.AppWidgetProvider; import android.appwidget.AppWidgetManager; import android.content.Context; import android.content.ComponentName; import android.content.pm.PackageManager; import android.content.res.Resources; import android.util.Log; import android.view.View; import android.widget.RemoteViews; import android.widget.Button; import android.os.Bundle; public class MyWidget extends AppWidgetProvider { private static String[] states; @Override public void onEnabled(Context context) { final Button button = (Button) findViewById(R.id.widget_state_button); states = context.getResources().getStringArray(R.array.states); } Is there another package I need to import for findViewById? Thanks in advance.

    Read the article

  • Microsoft JScript runtime error: 'ShowDatePicker' is undefined

    - by dbobrow
    Working around an issue where my jquery datepicker does not display after postback within an update panel. The textbox (trigger) for the calendar is contained within a control, which is contained within an update panel. I found an article assisting with this issue, and it informed me to do the following Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim tScript As String = "$(function(){ Sys.WebForms.PageRequestManager.getInstance().add_endRequest(ShowDatePicker); });" Page.ClientScript.RegisterStartupScript(Me.GetType(), "async_" & Me.txtAquisition.ClientID, tScript, True) Then on the ascx I have <script type="text/javascript"> function showDatePicker(sender, args) { var control = document.getElementById("<%=txtAquisition.ClientID %>") alert(control); $(control).each(function() { $(this).datepicker({ showOn: 'focus' }); }); } </script> but am getting an undefined error. Am I approaching this in the correct manner? Any other suggestions to ensure my datepicker remains usable within the update panel? Thinking this may be due to the fact that I have the controls nested within an update panel... several of them in fact. Any help on this is greatly appreciated.

    Read the article

  • error C2504: 'BASECLASS' : base class undefined

    - by numerical25
    I checked out a post similar to this but the linkage was different the issue was never resolved. The problem with mine is that for some reason the linker is expecting there to be a definition for the base class, but the base class is just a interface. Below is the error in it's entirety c:\users\numerical25\desktop\intro todirectx\godfiles\gxrendermanager\gxrendermanager\gxrendermanager\gxdx.h(2) : error C2504: 'GXRenderer' : base class undefined Below is the code that shows how the headers link with one another GXRenderManager.h #ifndef GXRM #define GXRM #include <windows.h> #include "GXRenderer.h" #include "GXDX.h" #include "GXGL.h" enum GXDEVICE { DIRECTX, OPENGL }; class GXRenderManager { public: static int Ignite(GXDEVICE); private: static GXRenderer *renderDevice; }; #endif at the top of GxRenderManager, there is GXRenderer , windows, GXDX, GXGL headers. I am assuming by including them all in this document. they all link to one another as if they were all in the same document. correct me if I am wrong cause that's how a view headers. Moving on... GXRenderer.h class GXRenderer { public: virtual void Render() = 0; virtual void StartUp() = 0; }; GXGL.h class GXGL: public GXRenderer { public: void Render(); void StartUp(); }; GXDX.h class GXDX: public GXRenderer { public: void Render(); void StartUp(); }; GXGL.cpp and GXDX.cpp respectively #include "GXGL.h" void GXGL::Render() { } void GXGL::StartUp() { } //...Next document #include "GXDX.h" void GXDX::Render() { } void GXDX::StartUp() { } Not sure whats going on. I think its how I am linking the documents, I am not sure.

    Read the article

  • jquery Ajax call resulting in Undefined Error in Firefox

    - by Kamal
    Hi I've been pulling my hair out for the last few hours with this problem. And the googling has been hampered by the very vagueness of this. So let me apologise for that first. Basically I'm using jquery and ajax (with C#) to return data from the backend and display that to the screen. The code works perfectly for firefox and IE. But when the data gets too large (??) (1500+ table rows) all I get is an undefined popup. Debugging in firefox (3.6) it doesn't even go into the success method. Worse still it doesn't even go into the error method. A lot of superfluous information there, but I'd rather show everything I'm doing. The Code $j.ajax( { type: "POST", url: "AdminDetails.aspx/LoadCallDetails", data: "{" + data + "}", contentType: "application/json;charset=utf-8", dataType: "json", success: function(msg) { $j("#CallDetailsHolder").html(msg.d); $j(".pointingHand").hide(); var oTable = $j('#dt').dataTable({ "bProcessing": true, "bPaginate": true, "bSort": true, "bAutoWidth": false, "aoColumns": [ { "sType": 'html' }, { "sType": 'custdate' }, { "sType": 'html-numeric' }, { "sType": 'ariary' }, { "sType": 'html' }, { "sType": 'html' } ], "oLanguage": { "sProcessing": "Traitement...", "sLengthMenu": "_MENU_ Montrer", "sZeroRecords": "Aucun enregistrement", "sInfo": "_START_ à _END_ de _TOTAL_", "sInfoEmpty": "0 à 0 de 0", "sInfoFiltered": "(filtrée à partir de _MAX_ )", "sInfoPostFix": "", "sSearch": "Rechercher", "sUrl": "", "oPaginate": { "sFirst": "premier", "sPrevious": "Précédent", "sNext": "suivant", "sLast": "dernier" } }, "sDom": 'T<"clear">lfrtip' }); $j('#CompteBlocRight0').unblock(); $j('#btnRangeSearch').click(function() { oTable.fnDraw(); }); }, error: function(msg) { DisplayError(msg); $j('#CompteBlocRight0').unblock(); } }); //$.ajax } The code definitely works. And even displays in IE without any issues. Any help???

    Read the article

  • Call to undefined function query() - using PDO in PHP

    - by webworm
    I have a written a script in PHP that reads from data from a MySQL database. I am new to PHP and I have been using the PDO library. I have been developing on a Windows machine using the WAMP Server 2 and all has been working well. However, when I uploaded my script to the LINUX server where it will be used I get the following error when I run my script. Fatal error: Call to undefined function query() This is the line where the error is occuring ... foreach($dbconn->query($sql) as $row) The variable $dbconn is first defined in my dblogin.php include file which I am listing below. <?php // Login info for the database $db_hostname = 'localhost'; $db_database = 'MY_DATABASE_NAME'; $db_username = 'MY_DATABASE_USER'; $db_password = 'MY_DATABASE_PASSWORD'; $dsn = 'mysql:host=' . $db_hostname . ';dbname=' . $db_database . ';'; try { $dbconn = new PDO($dsn, $db_username, $db_password); $dbconn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { echo 'Error connecting to database: ' . $e->getMessage(); } ?> Inside the function where the error occurs I have the database connection defined as a superglobal as such ... global $dbconn; I am a bit confused as to what is happening since all worked well on my development machine. I was wondering if the PDO library was installed but from what I thought it was installed by default as part of PHP v5. The script is running on an Ubuntu (5.0.51a-3ubuntu5.4) machine and the PHP version is 5.2.4. Thank you for any suggestions. I am really lost on this.

    Read the article

  • phusion_passenger/plugin.r b:37:in `load': undefined method `dir' for nil:NilClass (NoMethodError)

    - by dohkoos
    gem install passenger # version 3.0.2 run the command 'passenger start' then I got the error: c:/Ruby187/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passenger/plugin.r b:37:in `load': undefined method `dir' for nil:NilClass (NoMethodError) from c:/Ruby187/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passe nger/plugin.rb:34:in `each' from c:/Ruby187/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passe nger/plugin.rb:34:in `load' from c:/Ruby187/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passe nger/plugin.rb:72:in `initialize' from c:/Ruby187/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passe nger/standalone/start_command.rb:52:in `new' from c:/Ruby187/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passe nger/standalone/start_command.rb:52:in `initialize' from c:/Ruby187/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passe nger/standalone/main.rb:93:in `new' from c:/Ruby187/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passe nger/standalone/main.rb:93:in `run_command' from c:/Ruby187/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passe nger/standalone/main.rb:48:in `each_command' from c:/Ruby187/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passe nger/standalone/main.rb:43:in `each' from c:/Ruby187/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passe nger/standalone/main.rb:43:in `each_command' from c:/Ruby187/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passe nger/standalone/main.rb:91:in `run_command' from c:/Ruby187/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passe nger/standalone/main.rb:62:in `run!' from c:/Ruby187/lib/ruby/gems/1.8/gems/passenger-3.0.2/lib/phusion_passe nger/standalone/main.rb:39:in `run!' from c:/Ruby187/lib/ruby/gems/1.8/gems/passenger-3.0.2/bin/passenger:32 from c:/Ruby187/bin/passenger:19:in `load' from c:/Ruby187/bin/passenger:19 Any ideas would be greatly appreciated.

    Read the article

  • undefined method `build_users' with nested models

    - by Cédric
    I've got into trouble with nested attributes. Here is my Account model : class Account < ActiveRecord::Base has_many :products has_many :blogs has_many :openings has_many :users has_one :logo, :class_name => "AccountPicture" has_one :address, :class_name => "AccountAddress" has_and_belongs_to_many :options accepts_nested_attributes_for :logo, :allow_destroy => true accepts_nested_attributes_for :address, :allow_destroy => true accepts_nested_attributes_for :users, :allow_destroy => true end And here is my User model : class User < ActiveRecord::Base belongs_to :account end As you can see, Account accepts nested attributes for logo, address, and users. While testing, i can use nested attributes for logo and address, but not for user. a = Account.new => #<Account id: nil, hostname: nil, subdomain: nil, name: nil, description: nil, base_line: nil, footer: nil, phone_number: nil, mobile_number: nil, email_address: nil, created_at: nil, updated_at: nil> # building the address works fine >> a.build_address => #<AccountAddress id: nil, account_id: nil, country: nil, state: nil, county: nil, city: nil, suburb: nil, zipcode: nil, street: nil, streetno: nil, longitude: nil, latitude: nil, error_code: nil> # building the users fails >> a.build_users NoMethodError: undefined method `build_users' for #<Account:0x7f6862a5f948> from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/attribute_methods.rb:260:in `method_missing' from (irb):2 Thus, in my views, when i use the nested forms, i got this error back : User(#69850615730460) expected, got Array(#69850664775200) Any help would be appreciated. Thanks.

    Read the article

  • extjs - 'Store is undefined'

    - by Jamie
    Hi all, I'm pretty sure this a trivial problem and i'm just being a bit stupid. Your help would be hugely appreciated. In controls/dashboard.js I have: Ext.ill.WCSS.controls.dashboard = { xtype:'portal', region:'center', margins:'35 5 5 0', items:[{ columnWidth: 1, style:'padding:10px', items:[{ title: 'My Cluster Jobs', layout:'fit', html: "test" }] },{ columnWidth: 1, style:'padding:10px', items:[{ title: 'All Cluster Jobs', iconCls: 'icon-queue', html: "test", items: new Ext.grid.GridPanel({ title: 'Cluster Job Queue', store: Ext.ill.WCSS.stores.dashboardClusterJobs, width: 791, height: 333, frame: true, loadMask: true, stateful: false, autoHeight: true, stripeRows: true, floating: false, footer: false, collapsible: false, animCollapse: false, titleCollapse: false, columns:[ { xtype: 'gridcolumn', header: 'Job ID', sortable: true, resizable: true, width: 100, dataIndex: 'JB_job_number', fixed: false }, { xtype: 'gridcolumn', header: 'Priority', sortable: true, resizable: true, width: 100, dataIndex: 'JAT_prio', fixed: false }, { xtype: 'gridcolumn', header: 'User', sortable: true, resizable: true, width: 100, dataIndex: 'JB_owner' }, { xtype: 'gridcolumn', header: 'State', sortable: true, resizable: true, width: 100, dataIndex: 'state' }, { xtype: 'gridcolumn', header: 'Date Submitted', sortable: true, resizable: true, width: 100, dataIndex: 'JAT_start_time' }, { xtype: 'gridcolumn', header: 'Queue', sortable: true, resizable: true, width: 100, dataIndex: 'queue_name' }, { xtype: 'gridcolumn', header: 'CPUs', sortable: true, resizable: true, width: 100, dataIndex: 'slots' } ], bbar: { xtype: 'paging', store: 'storeClusterQueue', displayInfo: true, refreshText: 'Retrieving queue status...', emptyMsg: 'No jobs to retrieve', id: 'clusterQueuePaging' } }) }] }] }; Simple enough, note the reference to 'Ext.ill.WCSS.stores.dashboardClusterJobs' So in stores/dashboard.js I just have this: Ext.ill.WCSS.stores.dashboardClusterJobs = new Ext.data.XmlStore({ storeId: 'storeClusterJobs', record: 'job_list', autoLoad: true, url: 'joblist.xml', idPath: 'job_info', remoteSort: false, fields: [ { name: 'JB_job_number' }, { name: 'JAT_prio' }, { name: 'JB_name' }, { name: 'JB_owner' }, { name: 'state' }, { name: 'JAT_start_time' }, { name: 'slots' }, { name: 'queue_name' } ] }); I run the code and I get 'store is undefined' :S It's confusing me a lot. All of the javascripts have been included in the correct order. i.e. <script type="text/javascript" src="/js/portal.js"></script> <script type="text/javascript" src="/js/stores/dashboard.js"></script> <script type="text/javascript" src="/js/controls/dashboard.js"></script> Thanks guys!

    Read the article

  • Qt Object Linker Problem " undefined reverence to vtable"

    - by Thomas
    This is my header: #ifndef BARELYSOCKET_H #define BARELYSOCKET_H #include <QObject> //! The First Draw of the BarelySocket! class BarelySocket: public QObject { Q_OBJECT public: BarelySocket(); public slots: void sendMessage(Message aMessage); signals: void reciveMessage(Message aMessage); private: // QVector<Message> reciveMessages; }; #endif // BARELYSOCKET_H This is my class: #include <QTGui> #include <QObject> #include "type.h" #include "client.h" #include "server.h" #include "barelysocket.h" BarelySocket::BarelySocket() { //this->reciveMessages.clear(); qDebug("BarelySocket::BarelySocket()"); } void BarelySocket::sendMessage(Message aMessage) { } void BarelySocket::reciveMessage(Message aMessage) { } I get the Linker Problem : undefined reference to 'vtable for barelySocket' This should mean, i have a virtual Function not implemented. But as you can see, there is non. I comment the vector cause that should solve the Problem, but i does not. The Message is a complex struct, but even converting it to int did not solve it. I searched Mr G but he could not help me. Thank you for your support, Thomas

    Read the article

  • TinyMCE + jQuery + custom plugin = tinymce is undefined?

    - by user368691
    The problem occurs when I try to create small plugin to allow me toggle on and off WYSIWYG on all textareas in the website. //$('form.default textarea').each(function(){ // console.log( $('<a href="#">Enable WYSIWYG editor</a>').insertAfter('form.default textarea').prev('textarea.wysiwyg').tinymce().hide() ); //}); The full (a bit simplified) code looks like this: $('textarea.wysiwyg').tinymce({ skin : 'cirkuit', theme : 'advanced', plugins : 'pagebreak,style,layer,advlink,inlinepopups,contextmenu,paste,directionality,noneditable,nonbreaking,xhtmlxtras,template', // Theme options theme_advanced_buttons1 : 'formatselect,fontsizeselect,forecolor,|,bold,italic,strikethrough,|,bullist,numlist,|,justifyleft,justifycenter,justifyright,|,link,unlink,|,image,|,code,paste,pastetext,pasteword,removeformat,|,backcolor,|,underline,justifyfull,sup,|,outdent,indent,|,hr,charmap,|,undo,redo', theme_advanced_buttons2 : '', theme_advanced_buttons3 : '', theme_advanced_toolbar_location : 'top', theme_advanced_toolbar_align : 'left', theme_advanced_statusbar_location: 'bottom', theme_advanced_resizing : true, theme_advanced_resize_horizontal : false, height : 500, theme_advanced_resizing_min_height : 500, document_base_url : 'http://static.<?=$settings['system_host']?>/' }); $('textarea.wysiwyg').each(function() { $(this).tinymce().hide(); }); What is the error? FireBug says that tinymce() in undefined; this message occurs in each() loop. Thus, tinymce() is actually initialized. I am really lost towards, what could be causing this.

    Read the article

  • Probably an easy one - PHP/CodeIgniter 'Undefined Variable'

    - by Jack W-H
    Morning y'all This is probably an easy one but I barely got any sleep last night and am struggling to comprehend anything. I've got a CodeIgniter library I've made called Points.php. Here's the contents of Points: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Points { function __construct() { $this->ci =& get_instance(); $this->ci->load->database(); } function getpoints($params) { echo $userid; } } /* End of file Points.php */ /* Location: ./application/libraries/Points.php */ ?> As you can see, I'm building it up slowly and it's being kept simple. In one of my views, I want it to display the number of 'points' (which for the time being is simply the third segment of the URI). I call it like this: <p>Points: <?php $params['user_id']=$this->uri->segment(3,1); echo $this->points->getpoints($params); ?></p> The warning I get back in the view is this: A PHP Error was encountered Severity: Notice Message: Undefined variable: userid Filename: libraries/Points.php Yes I know it's such a simple problem but I've tried lots of things. Some variations include echoing in Points.php $params['userid']; etc. But I don't see what I'm doing wrong? This is my first CodeIgniter class and I've fallen at the first step, haha...

    Read the article

  • undefined method `user_sessions_path' for #<ActionView::Base:0xdb3158>

    - by mrbernz
    I'm getting this error that's driving me up the wall. I don't see what's going on... I've followed instructions to the T and it's still complaining - help please!! I've got extracts of the error message, controller file, login page and routes file. Error message NoMethodError in User_sessions#new Showing app/views/user_sessions/new.html.erb where line #4 raised: undefined method `user_sessions_path' for # Extracted source (around line #4): 1: 2: User Login 3: 4: <% form_for @user_session do |f| % 5: <%= f.error_messages % 6: 7: controller/user_sessions_controller.rb class UserSessionsController < ApplicationController before_filter :require_no_user, :only = [:new, :create] before_filter :require_user, :only = :destroy def new @user_session = UserSession.new end def create @user_session = UserSession.new(params[:user_session]) if @user_session.save flash[:notice] = "Login successful!" redirect_to root_url #redirect_back_or_default account_url else render :action = :new end end def destroy current_user_session.destroy flash[:notice] = "Logout successful!" redirect_to root_url #redirect_back_or_default account_url end end user_sessions/new.html.erb User Login <% form_for @user_session do |f| % <%= f.error_messages % <%= f.label :Email % <%= f.text_field :email % <%= f.label :Password % <%= f.password_field :password % <%= f.submit "Submit" % <% end % routes.rb file ActionController::Routing::Routes.draw do |map| map.login "login", :controller = "user_sessions", :action = "new" Am I look in in the wrong place??

    Read the article

  • Get "term is undefined” error when trying to assign arrayList to List component dataSource

    - by user1814467
    I'm creating an online game where people log in and then have the list of current players displayed. When the user enters a "room" it dispatches an SFSEvent which includes a Room object with the list of users as User objects in that room. As that event's callback function, I get the list of current users which is an Array, switch the View Stack child index, and then I wrap the user list array in an ArrayList before I assign it to the MXML Spark List component's dataSource. Here's my code: My Actionscript Code Section (PreGame.as): private function onRoomJoin(event:SFSEvent):void { const room:Room = this._sfs.getRoomByName(PREGAME_ROOM); this.selectedChild = waitingRoom; /** I know I should be using event listeners * but this is a temporary fix, otherwise * I keep getting null object errors * do to the li_users list not being * created in time for the dataProvider assignment **/ setTimeout(function ():void { const userList:ArrayList = new ArrayList(room.userList); this.li_users.dataProvider = userList; // This is where the error gets thrown },1000); } My MXML Code: <?xml version="1.0" encoding="utf-8"?> <mx:ViewStack xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" initialize="preGame_initializeHandler(event)" > <fx:Script source="PreGame.as"/> <s:NavigatorContent id="nc_loginScreen"> /** Login Screen Code **/ </s:NavigatorContent> /** Start of Waiting Room code **/ <s:NavigatorContent id="waitingRoom"> <s:Panel id="pn_users" width="400" height="400" title="Users"> /** This is the List in question **/ <s:List id="li_users" width="100%" height="100%"/> </s:Panel> </s:NavigatorContent> </mx:ViewStack> However, I keep getting this error: TypeError: Error #1010: A term is undefined and has no properties Any ideas what I'm doing wrong? The arrayList has data, so I know it's not empty/null.

    Read the article

  • PHP - warning - Undefined property: stdClass - fix?

    - by Phill Pafford
    I get this warning in my error logs and wanted to know how to correct this issues in my code. Warning: PHP Notice: Undefined property: stdClass::$records in script.php on line 440 Some Code: // Parse object to get account id's // The response doesn't have the records attribute sometimes. $role_arr = getRole($response->records); // Line 440 Response if records exists stdClass Object ( [done] => 1 [queryLocator] => [records] => Array ( [0] => stdClass Object ( [type] => User [Id] => [any] => stdClass Object ( [type] => My Role [Id] => [any] => <sf:Name>My Name</sf:Name> ) ) ) [size] => 1 ) Response if records does not exist stdClass Object ( [done] => 1 [queryLocator] => [size] => 0 ) I was thinking something like array_key_exists() functionality but for objects, anything? or am I going about this the wrong way?

    Read the article

  • twitter bootstrap typeahead (method 'toLowerCase' of undefined)

    - by mmoscosa
    I am trying to use twitter bootstrap to get the manufacturers from my DB. Because twitter bootstrap typeahead does not support ajax calls I am using this fork: https://gist.github.com/1866577 In that page there is this comment that mentions how to do exactly what I want to do. The problem is when I run my code I keep on getting: Uncaught TypeError: Cannot call method 'toLowerCase' of undefined I googled around and came tried changing my jquery file to both using the minified and non minified as well as the one hosted on google code and I kept getting the same error. My code currently is as follows: $('#manufacturer').typeahead({ source: function(typeahead, query){ $.ajax({ url: window.location.origin+"/bows/get_manufacturers.json", type: "POST", data: "", dataType: "JSON", async: false, success: function(results){ var manufacturers = new Array; $.map(results.data.manufacturers, function(data, item){ var group; group = { manufacturer_id: data.Manufacturer.id, manufacturer: data.Manufacturer.manufacturer }; manufacturers.push(group); }); typeahead.process(manufacturers); } }); }, property: 'name', items:11, onselect: function (obj) { } }); on the url field I added the window.location.origin to avoid any problems as already discussed on another question Also before I was using $.each() and then decided to use $.map() as recomended Tomislav Markovski in a similar question Anyone has any idea why I keep getting this problem?! Thank you

    Read the article

  • 'JQuery' is undefined

    - by Raja
    I am working on a ASP.net project created with local file system settings. I am using MVC and Jquery. Jquery is working fine when I run the application in debug mode i.e. in ASP.net Development server. I am trying to host the application in IIS 7. In hosted mode, it does not recognize Jquery and gives scripting error 'Jquery is undefined'. The locations of the script files is unchanged in both modes. Can anybody have any clue what can be the reason and how to solve this. My code look like this; <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <script src="../../Scripts/MicrosoftAjax.debug.js" type="text/javascript"></script> <script src="../../Scripts/MicrosoftMvcAjax.debug.js" type="text/javascript"></script> <script src="../../Scripts/jquery-1.2.6.js" type="text/javascript"></script> <!-- YUI Styles --> <link href="../../Content/reset.css" rel="stylesheet" type="text/css" /> <link href="../../Content/fonts.css" rel="stylesheet" type="text/css" /> <link href="../../Content/grids.css" rel="stylesheet" type="text/css" /> <!-- /YUI Styles --> <link href="../../Content/knowledgebase.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> //this hides the javascript warning if javascript is enabled (function($) { $(document).ready(function() { $('#jswarning').hide(); }); })(jQuery); </script> <asp:ContentPlaceHolder ID="ScriptContent" runat="server" /> ....

    Read the article

  • undefined references

    - by Brandon
    Hello, I'm trying to compile some fortran code and I'm running into some confusing linking errors. I have some code that I compile and place into a static library: >gfortran -c -I../../inc -o bdout.o bdout.F >ar rv libgeo.a bdout.o I then try to compile against that library with some simple test code and get the following: >gfortran -o mytest -L -lgeo mytest.F /tmp/cc4uvcsj.o: In function `MAIN__': mytest.F:(.text+0xb0): undefined reference to `ncwrite1_' collect2: ld returned 1 exit status It's not in the object naming because everything looks fine: >nm -u libgeo.a bdout.o: U _gfortran_exit_i4 U _gfortran_st_write U _gfortran_st_write_done U _gfortran_transfer_character U _gfortran_transfer_integer U ncobjcl_ U ncobjwrp_ U ncopencr_ U ncopenshcr_ U ncopenwr_ U ncwrite1_ U ncwrite2_ U ncwrite3_ U ncwrite4_ U ncwritev_ I can check the original object file too: >nm -u bdout.o U _gfortran_exit_i4 U _gfortran_st_write U _gfortran_st_write_done U _gfortran_transfer_character U _gfortran_transfer_integer U ncobjcl_ U ncobjwrp_ U ncopencr_ U ncopenshcr_ U ncopenwr_ U ncwrite1_ U ncwrite2_ U ncwrite3_ U ncwrite4_ U ncwritev_ The test code simply contains a single call to a function defined in bdout.o: program hello print *,"Hello World!" call ncwrite1( istat, f, ix2, ix3, ix4, ix5, ih ) end program hello I can't figure out what the problem is. Does anyone have any suggestions? Maybe even just a way to track the problem down? Cheers.

    Read the article

  • jQuery ajaxForm "h is undefined" problem

    - by Simon
    I have a form that is brought up in a ajaxed modal which I am using for updating user details. When the modal loads I call a js function: teamCreate: function() { $j("#step1,form#createEditTeam").show(); $j("#step2").hide(); var options = { type: "get", dataType: 'json', beforeSubmit: before, // pre-submit callback success: success // post-submit callback }; $j("form#createEditTeam").ajaxForm(options); function before(formData, jqForm, options){ var valid = $j("form#createEditTeam").valid(); if (valid === true) { $j(".blockMsg").block({ message: $j('#panelLoader') }); return true; // submit the form } else { $j("form#createEditTeam").validate(); return false; // prevent form from submitting } }; function success(data){ if (data.status == "success") { $j(".blockMsg").unblock(); } else { // } }; function error(xhr, ajaxOptions, thrownError){ alert("Error code: " + xhr.statusText); }; } This works just fine when I first submit the form, regardless how many times the modal is opened and closed. However, if I submit the form and then open the modal again and try to submit the form again I get a js error: h is undefined

    Read the article

  • Error while trying to install Community Engine: NameError - "Undefined local variable or method 'map

    - by floatingfrisbee
    I'm trying to install Community Engine using the instructions here: http://github.com/bborn/communityengine At first I thought it might be because I had Rails 2.3.5 and desert 0.5.3 which were higher versions than what was mentioned on the installation site. However moving to rails 2.3.4 and desert 0.5.2 did not work. Any ideas as to what might be going on? $ script/generate plugin_migration /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecat ed and will be removed on or after August 2010. Use #requirement /cygdrive/c/users/me/jesse/projects/ceng1/config/routes.rb:2: undefined local variable or method `map' for main:Object (NameError ) from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:147:in `load_without_new_constant _marking' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:147:in `load_without_desert' from /usr/lib/ruby/gems/1.8/gems/desert-0.5.2/lib/desert/ruby/object.rb:18:in `load' from /usr/lib/ruby/gems/1.8/gems/desert-0.5.2/lib/desert/ruby/object.rb:32:in `__each_matching_file' from /usr/lib/ruby/gems/1.8/gems/desert-0.5.2/lib/desert/ruby/object.rb:17:in `load' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:286:in `load_routes!' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:286:in `each' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:286:in `load_routes!' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:266:in `reload!' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:537:in `initialize_routing' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:188:in `process' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `send' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `run' from /cygdrive/c/users/me/jesse/projects/ceng1/config/environment.rb:6 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/generate.rb:1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from script/generate:3

    Read the article

  • Rails undefined method 'generated_methods' for nil:NilClass

    - by mike
    Okay so I was just starting this rails app and generated my first model ruby script/generate model Grid req:string class:string ctitle:string credits:float grade:string pass:boolean created my table rake db:migrate (in C:/Users/Michael/InstantRails/rails_apps/studentGrid) == CreateGrids: migrating ==================================================== -- create_table(:grids) - 0.0150s == CreateGrids: migrated (0.0150s) =========================================== and went to the console to add some data to my table Grid = Grid(id: integer, req: string, class: string, ctitle: string, credits: float, grade: string, pass: boolean, created_at: datetime, updated_at: datetime) Grid.create(:req="Math Elective", :class="Math 111", :ctitle="Calculus I", :credits=3.0) Pretty standard I thought, but then I get this error and I don't understand why NoMethodError: undefined method 'generated_methods' for nil:NilClass from C:/Users/Michael/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesup port-2.3.5/lib/active_support/whiny_nil.rb:52:inmethod_missing' from C:/Users/Michael/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerec ord-2.3.5/lib/active_record/attribute_methods.rb:352:in respond_to?' from C:/Users/Michael/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerec ord-2.3.5/lib/active_record/base.rb:2746:inattributes=' from C:/Users/Michael/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerec ord-2.3.5/lib/active_record/base.rb:2742:in each' from C:/Users/Michael/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerec ord-2.3.5/lib/active_record/base.rb:2742:inattributes=' from C:/Users/Michael/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerec ord-2.3.5/lib/active_record/base.rb:2438:in initialize' from C:/Users/Michael/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerec ord-2.3.5/lib/active_record/base.rb:721:innew' from C:/Users/Michael/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerec ord-2.3.5/lib/active_record/base.rb:721:in `create' from (irb):2 from :0

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >