Search Results

Search found 10381 results on 416 pages for 'delegate and events'.

Page 133/416 | < Previous Page | 129 130 131 132 133 134 135 136 137 138 139 140  | Next Page >

  • onclick event not working after ie7 reload

    - by Charles
    I am using Javascript to dynamically create part of my page content. A routine that generates a set of img tags is called from the window.onload event. Those img tags are assigned attributes, including an onclick event. The img tags host thumbnail images that, when clicked, change the src property of the image in the main view div. Everything works properly in FF 3.5. I can reload the page and the dynamically generated onclick events continue to fire as expected. In IE7 everything works normally until I reload the page. At that point events that were hard coded into the xhtml section continue to work as expected, and the dynamically generated img tags are shown on the page, but their onclick events fail to work. How can I get IE7 to implement the dynamically generated click events on reload?

    Read the article

  • Date javascript object from IE cannot be automatically bound to Datetime in ASP.NET MVC

    - by Sergio
    Hi There, I have a site that uses a jquery calendar to display events. I have noticed than when using the system from within IE (all versions) ASP.NET MVC will fail to bind the datetime to the action that send back the correct events. The sequence of events goes as follows. Calendar posts to server to get events Server ActionMethod accepts start and end date, automatically bound to datetime objects In every browser other than IE the start and end date come through as: Mon, 10 Jan 2011 00:00:00 GMT When IE posts the date, it comes through as Mon, 10 Jan 2011 00:00:00 UTC ASP.NET MVC 2 will then fail to automatically bind this to the action method parameter. Is there a reason why this is happening? The code that posts to the server is as follows: data: function (start, end, callback) { $.post('/tracker/GetTrackerEvents', { start: start.toUTCString(), end: end.toUTCString() }, function (result) { callback(result); }); },

    Read the article

  • rails 3.0.3 - ActiveRecord::Relation, undefined method error

    - by brg
    I am having this unexplained ActiveRecord::Relation, undefined method error . I don't know why, since my model association are well defined and the event table has the foreign keys for the user table. I tried using this fix but it failed: Rails 3 ActiveRecord::Relation random associations behavior event.rb class Event < ActiveRecord::Base belongs_to :user attr_accessible :event_name, :Starts_at, :finish, :tracks end user.rb class User < ActiveRecord::Base has_many :events, :dependent = :destroy attr_accessible :name, :event_attributes accepts_nested_attributes_for :events, :allow_destroy = true end schema.rb ActiveRecord::Schema.define(:version = 20101201180355) do create_table "events", :force = true do |t| t.string "event_name" t.string "tracks" t.datetime "starts_at" t.datetime "finish" t.datetime "created_at" t.datetime "updated_at" t.integer "user_id" end end error message NoMethodError in Users#index undefined method `events' for # Extracted source (around line #10): 7: <%= sortable "Tracks" % 8: 10: <% @users.events.each do |event| % 11: <% debugger % 12: 13: <%= event.starts_at % Trace of template inclusion: app/views/users/index.html.erb Rails.root: C:/rails_project1/events_manager Application Trace | Framework Trace | Full Trace app/views/users/_event_user.html.erb:10:in _app_views_users__event_user_html_erb__412443848_34308540_1390678' app/views/users/index.html.erb:7:in_app_views_users_index_html_erb___603337143_34316016_0'

    Read the article

  • How do I 'donut cache' in ASP.NET MVC for something more than a date

    - by Simon_Weaver
    All the examples for donut caching I've seen are just like this : <%= Html.Substitute( c => DateTime.Now.ToString() )%> Thats fine if I just want the date, but what other options are there? I know there is a delegate 'MvcSubstitutionCallback' which has the following signature : public delegate string MvcSubstitutionCallback(HttpContextBase httpContext); but RenderAction and RenderPartial returns void so i cant just return them from the delegate method. How can I effectively use this callback for more complex situations. I've looked at both of Phil Haacked's articles here and here, but neither seems to do exactly what I want.

    Read the article

  • Should I define a single "DataContext" and pass references to it around or define muliple "DataConte

    - by Nate Bross
    I have a Silverlight application that consists of a MainWindow and several classes which update and draw images on the MainWindow. I'm now expanding this to keep track of everything in a database. Without going into specifics, lets say I have a structure like this: MainWindow Drawing-Surface Class1 -- Supports Drawing DataContext + DataServiceCollection<T> w/events Class2 -- Manages "transactions" (add/delete objects from drawing) Class3 Each "Class" is passed a reference to the Drawing Surface so they can interact with it independently. I'm starting to use WCF Data Services in Class1 and its working well; however, the other classes are also going to need access to the WCF Data Services. (Should I define my "DataContext" in MainWindow and pass a reference to each child class?) Class1 will need READ access to the "transactions" data, and Class2 will need READ access to some of the drawing data. So my question is, where does it make the most sense to define my DataContext? Does it make sense to: Define a "global" WCF Data Service "Context" object and pass references to that in all of my subsequent classes? Define an instance of the "Context" for each Class1, Class2, etc Have each method that requires access to data define its own instance of the "Context" and use closures handle the async load/complete events? Would a structure like this make more sense? Is there any danger in keeping an active "DataContext" open for an extended period of time? Typical usecase of this application could range from 1 minute to 40+ minutes. MainWindow Drawing-Surface DataContext Class1 -- Supports Drawing DataServiceCollection<DrawingType> w/events Class2 -- Manages "transactions" (add/delete objects from drawing) DataServiceCollection<TransactionType> w/events Class3 DataServiceCollection<T> w/events

    Read the article

  • iPhone - finding items in current entity that share related item

    - by Pedro
    G'day Folks My core data driven app has an Events entity, essentially a list of times & venues, with a related Acts entity, the names & bios of the acts appearing at those events. I have a table view that shows the event time & venue (as a table section with 1 row), the act name & act bio that works nicely. If that act is appearing at more than one event I'd like to include another table section that lists those events. I think could get that with event.act.events except that it would include the event I'm currently displaying. Can anyone suggest how to get the data I want & exclude the current record? Cheers & TIA, Pedro :) PS... I have not quite 18 hours until the promised time for a prototype of my app to be available for some testers to download.

    Read the article

  • NewBie Question, jQuery: How can we implement if...else logic and call function

    - by Rachel
    I am new to jQuery and so don't mind this question if it sounds stupid but here is something that I am trying to do : I have 3 functions like: AddToCart Function which adds item to the shopping cart: //offer_id is the offer which we are trying to add to cart. addToCart: function(offer_id) { this.submit({action: 'add', 'offer_id': offer_id}, {'app_server_url': this.app_server_url}); }, RemoveFromCart which removes data from the cart //target is link clicked and event is the click event. removeFromCart: function(target, event) { this.uniqueElmt('cart_table').find('.sb_item_remove').unbind('click'); var offer_id = $(target).parent().find('.offer_id').html(); this.submit({action: 'remove', 'offer_id': offer_id, 'next_action': this.config.current_action}, {'app_server_url': this.app_server_url}); }, Get the current state of the cart //return string which represents current state of cart. getCartItems: function() { return this.contents; } Now I am trying to do 3 things: if there is no content in cart and addToCart is called than some action, so basically here we need to check the current state of cart and that is obtained by calling getCartItems and if it is Null and than if addToCart is called than we perform some action if there is content in the cart and addToCart is called than some action,so basically here we need to check the current state of cart and that is obtained by calling getCartItems and check if it is Null or not and than if addToCart is called than we perform some action if we had some content in the cart. if there is content in the cart and removeFromCart is called some action, so basically here we need to check the current state of cart and that is obtained by calling getCartItems and if it is not Null and if removeFromCart is called than we perform some action Pseudocode of what I am trying to do: if there is no content in cart and addToCart is called than $(document).track( { 'module' : 'Omniture', 'event' : 'instant', 'args' : { 'linkTrackVars' : 'products,events', 'linkTrackEvents' : 'scAdd,scOpen', 'linkType' : 'o', 'linkName' : 'Cart : First Product Added' // could be blank, but can include event name as added feature 'svalues' : { 'products' : ';OFFERID1[,;OFFERID2]', 'events' : 'scAdd,scOpen', }, } 'defer' : '0' } ); if there is content in the cart and addToCart is called than $(document).track( { 'module' : 'Omniture', 'event' : 'instant', 'args' : { 'linkTrackVars' : 'products,events', 'linkTrackEvents' : 'scAdd', 'linkType' : 'o', 'linkName' : 'Cart : Product Added' // could be blank, but can include event name as added feature 'svalues' : { 'products' : ';OFFERID1[,;OFFERID2]', 'events' : 'scAdd', }, }, 'defer' : '0' } ); if there is content in the cart and removeFromCart is called $(document).track( { 'module' : 'Omniture', 'event' : 'instant', 'args' : { 'linkTrackVars' : 'products,events', 'linkTrackEvents' : 'scRemove', 'linkType' : 'o', 'linkName' : 'Cart : Product Removed' // could be blank, but can include event name as added feature 'svalues' : { 'products' : ';OFFERID1[,;OFFERID2]', 'events' : 'scRemove', }, } 'defer' : '0' } ); My basic concern is that am complete newbie to jQuery and JavaScript and so am not sure how can I implement if...else logic and how can I call a funtion using jQuery/JavaScript.

    Read the article

  • Predicate<INT> match question

    - by Petr
    Hi, I do not understand how following code works. Specifically, I do not understand using of "return i<3". I would expect return i IF its < than 3. I always though that return just returns value. I could not even find what syntax is it. Second question, it seems to me like using anonymous method (delegate(int i)) but could be possible to write it with normal delegate pointing to method elsewere? Thanks List<int> listOfInts = new List<int> { 1, 2, 3, 4, 5 }; List<int> result = listOfInts.FindAll(delegate(int i) { return i < 3; });

    Read the article

  • How to implement buffering with timeout in RX

    - by Gaspar Nagy
    I need to implement an event processing, that is done delayed when there are no new events arriving for a certain period. (I have to queue up a parsing task when the text buffer changed, but I don't want to start the parsing when the user is still typing.) I'm new in RX, but as far as I see, I would need a combination of BufferWithTime and the Timeout methods. I imagine this to be working like this: it buffers the events until they are received regularly within a specified time period between the subsequent events. If there is a gap in the event flow (longer than the timespan) it should return propagate the events buffered so far. Having a look at how Buffer and Timeout is implemented, I could probably implement my BufferWithTimeout method (if everyone have one, please share with me), but I wonder if this can be achieved just by combining the existing methods. Any ideas?

    Read the article

  • Interoperability when returning derived class by base class in WCF

    - by mt_serg
    I have some simple code: [DataContract] [KnownType(typeof(SpecialEvent))] public class Event { //data } [DataContract] public class SpecialEvent : Event { //data } [ServiceContract] public interface IService { [OperationContract] List<Event> GetEvents(); } [ServiceBehavior] public class Service : IService { public List<Event> GetEvents() { List<Event> events = new List<Event>(); events.Add(new Event()); events.Add(new SpecialEvent()); return events; } } I know that it works fine in case wcf to wcf. but what about interoperability? is it generate standart wsdl and any client can use the service or no?

    Read the article

  • How to avoid timestamp issue in a long query?

    - by pingi
    Hi, I have the following 2 tables: items: id int primary key bla text events: id_items int num int when timestamp without time zone ble text composite primary key: id_items, num and want to select to each item the most recent event (the newest 'when'). I wrote an request, but I don't know if it could be written more efficiently. Also on PostgreSQL there is a issue with comparing Timestamp objects: 2010-05-08T10:00:00.123 == 2010-05-08T10:00:00.321 so I select with 'MAX(num)' Any thoughts how to make it better? Thanks. SELECT i.*, ea.* FROM items AS i JOIN ( SELECT t.s AS t_s, t.c AS t_c, max(e.num) AS o FROM events AS e JOIN ( SELECT DISTINCT id_item AS s, MAX(when) AS c FROM events GROUP BY s ORDER BY c ) AS t ON t.s = e.id_item AND e.when = t.c GROUP BY t.s, t.c ) AS tt ON tt.t_s = i.id JOIN events AS ea ON ea.id_item = tt.t_s AND ea.cas = tt.t_c AND ea.num = tt.o;

    Read the article

  • iPhone - UITableViewController not loading table

    - by RyanJM
    I'm pushing a UITableViewController onto a navigationController. The title (set in the viewDidLoad) shows up but not the table. numberOfSectionsInTableView is called. But tableView:numberOfRowsInSection: is not called. I'm passing in 1 so it should be looking for number of rows. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } I'm setting up the view in the following manner: SelectUserViewController *nextController = [[SelectUserViewController alloc] initWithStyle:UITableViewStyleGrouped]; nextController.managedObjectContext = managedObjectContext; OrangeQCAppDelegate *delegate = [[UIApplication sharedApplication] delegate]; [delegate.navigationController pushViewController:nextController animated:YES]; Again, the viewDidLoad method is called. And my class is set up as follows: @interface SelectUserViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource> {...} What else should I be looking at? When I go through the debugger, after it looks at numberOfSectionsInTableView it just disappears (I think it is in the UITableViewController class) and never comes back.

    Read the article

  • Keyboard- and mouse-event transparent widget

    - by Gajender
    When i click a button my main window i want it to become transparent to keyboard and mouse events, i.e. all keyboard and mouse events should pass to any windows below it as if that window is not present there. "Qt::WA_TransparentForMouseEvents" does not work here as this only make child windows transparent to keyboard and mouse events i guess. And my window is main window and i want to pass all event to any window on desktop not just parent window.

    Read the article

  • DRYing up Rails Views with Nested Resources

    - by viatropos
    What is your solution to the problem if you have a model that is both not-nested and nested, such as products: a "Product" can belong_to say an "Event", and a Product can also just be independent. This means I can have routes like this: map.resources :products # /products map.resources :events do |event| event.resources :products # /events/1/products end How do you handle that in your views properly? Note: this is for an admin panel. I want to be able to have a "Create Event" page, with a side panel for creating tickets (Product), forms, and checking who's rsvp'd. So you'd click on the "Event Tickets" side panel button, and it'd take you to /events/my-new-event/tickets. But there's also a root "Products" tab for the admin panel, which could list tickets and other random products. The 'tickets' and 'products' views look 90% the same, but the tickets will have some info about the event it belongs to. It seems like I'd have to have views like this: products/index.haml products/show.haml events/products/index.haml events/products/show.haml But that doesn't seem DRY. Or I could have conditionals checking to see if the product had an Event (@product.event.nil?), but then the views would be hard to understand. How do you deal with these situations? Thanks so much.

    Read the article

  • Is System.nanoTime() consistent across threads?

    - by obvio171
    I want to count the time elapsed between two events in nanoseconds. To do that, I can use System.nanoTime() as mentioned here. The problem is that the two events are happening in different threads. Since nanoTime() doesn't return an absolute timestamp but instead can only be used to calculate time differences, I'd like to know if the values I get on the two different threads are consistent with the physical time elapsed between the two events.

    Read the article

  • UIDatePicker inside UIScrollView with pages

    - by Jason Martens
    I have a UIScrollView with 2 pages, and I can scroll horizontally between them. However, on one of my pages, I have a UIDatePicker, and the scroll view is intercepting the vertical touch events so I can no longer manipulate the date picker (except by clicking or tapping). Is there some way to tell the ScrollView to send the vertical touch events to the date picker, but send the horizontal touch events to the scroll view to switch pages?

    Read the article

  • SQLAlchemy declarative syntax with autoload in Pylons

    - by Juliusz Gonera
    I would like to use autoload to use an existings database. I know how to do it without declarative syntax (model/_init_.py): def init_model(engine): """Call me before using any of the tables or classes in the model""" t_events = Table('events', Base.metadata, schema='events', autoload=True, autoload_with=engine) orm.mapper(Event, t_events) Session.configure(bind=engine) class Event(object): pass This works fine, but I would like to use declarative syntax: class Event(Base): __tablename__ = 'events' __table_args__ = {'schema': 'events', 'autoload': True} Unfortunately, this way I get: sqlalchemy.exc.UnboundExecutionError: No engine is bound to this Table's MetaData. Pass an engine to the Table via autoload_with=<someengine>, or associate the MetaData with an engine via metadata.bind=<someengine> The problem here is that I don't know where to get the engine from (to use it in autoload_with) at the stage of importing the model (it's available in init_model()). I tried adding meta.Base.metadata.bind(engine) to environment.py but it doesn't work. Anyone has found some elegant solution?

    Read the article

  • How to get right values from Views touch event

    - by Pinker
    I have a problem with implementing touch events on GLSurfaceView. Views size is 1280x696, because of android (tablet) status bar at bottom with soft keys, time etc.., (screen resolution is 1280x800), but OnTouchListener is receiving touch events with coords [646.0,739.0], and thus my gluunproject method fails to return correct values is there any way to return events that respect these boundaries? or how should I recalculate the position?

    Read the article

  • UIViewScrollviw UITableView subview scrolling. IOS

    - by user1484810
    I have a UIScrollview with a UITableview subview. The UIScrollview scrolls the UITableView horizontally. The UITable view naturally scrolls up and down. If a user places their finger on the UitableView, and moves (swipes) horizontally, The delegate method below is invoked (void)scrollViewDidScroll:(UIScrollView *)scrollView with scrollView isEqual theUIScrollView If the user lifts their finger and places it back down on the UITableView and moves in a vertical direction The delegate method below is invoked (void)scrollViewDidScroll:(UIScrollView *)scrollView with scrollView isEqual = theUITable If however the user places their finger and moves in a horizontally (void)scrollViewDidScroll:(UIScrollView *)scrollView with scrollView isEqual theUIScrollView If the user then moves the finger (without lifting it) in a vertical direction. delegate method scrollViewDidScroll is not invoked at all. (The reverse is true too.) I note that the "Pulse News" app seems to behave in the above manner.. Ultimately I want to figure out how to get the UITableView and UIScrollview moving in a "unidirectional" fashion, with one finger kept on the screen. Thanks...

    Read the article

  • Drupal : Custom views filter

    - by Joseph
    Hi, First thing I would say is that I am a Drupal newbie. So, I would appreciate your answer in a detailed step by step process. I am using Drupal 6 and location module. There are two main content types - user profile (using content profile module) and event content type. Both have one field for location. Now, lets suppose in his profile, user is selecting city as Toronto and province as Ontario. And some events have been added for Toronto city. I need one Views, which will display events from user city. So, if user is from Vancouver, and they click on "my city events", they will see list of events from their city. Someone told me that I can achieve this using arguments/ relationships, but I don't know how to do that. Can someone please help me out? I am not good at PHP either :(

    Read the article

  • Mock a void method which change the input value

    - by Kar
    Hi, How could I mock a void method with parameters and change the value parameters? My void method looks like this: public interface IFoo { void GetValue(int x, object y) // takes x and do something then access another class to get the value of y } I prepared a delegate class: private delegate void GetValueDelegate(int x, object y); private void GetValue(int x, object y) { // process x // prepare a new object obj if (y == null) y = new Object(); if (//some checks) y = obj; } I wrote something like this: Expect.Call(delegate {x.GetValue(5, null);}).Do (new GetValueDelegate(GetValue)).IgnoreArguments().Repeat.Any(); But seems like it's not working. Any clue on what could be wrong?

    Read the article

  • Mvc Cocoa: How to get controller object for UIBarButtonItem target in view?

    - by plehoux
    I got a basic application where I want the action method of UIBarButtonItem to be in the parent controller. My view has been created programmatically, so I can't use IBAction. RootViewController - NavigationViewController - NavigationView - UIBarButtonItem Here's how have done it for the moment, it works for now... but it's not a really scalable technic (in NavigationView.m): BookAppDelegate *delegate = [[UIApplication sharedApplication] delegate]; UIBarButtonItem *soundEffects = [[UIBarButtonItem alloc] initWithTitle:@"Sound Effects" style:UIBarButtonItemStyleBordered target:[delegate.rootViewController navigationViewController] action:@selector(soundEffectsClicked:)]; What would be a better technic to get the NavigationViewController object?

    Read the article

  • C++ Code Clarification Needed..

    - by ke3pup
    Hi guys I'm trying to understand what the code below says: struct compare_pq; struct compare_pq { bool operator() (Events *& a, Events *& b); }; std::priority_queue<Events *, std::vector<Events *>, compare_pq> eventList; i looked at what priority_queue is and how its declared but can't quit understand what compare_pq is doing in the priority_queue eventList. Also what does operator() do since i've never seen *& before and empty operator overloading operator()! any help would be appreciated. Thank you

    Read the article

< Previous Page | 129 130 131 132 133 134 135 136 137 138 139 140  | Next Page >