Search Results

Search found 28345 results on 1134 pages for 'custom event'.

Page 10/1134 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • MooTools - Programmatically fired events not working with event delegation

    - by Anurag
    Would really appreciate if anyone can help me figure out why I am unable to fire events programmatically when using event delegation in MooTools (from the Element.Delegation class). There is a parent <div> that has a change listener on some child <input> elements. When the change event is triggered by user actions, the handler on the parent div gets triggered, but when I fire it programmatically with fireEvent on any child input, nothing happens. The basic setup is: html <div id="listener"> <input type="text" id="color" class="color" /> ????????????????????????????????????????????????????????????????</div>??????????? js $("listener").addEvent("change:relay(.color)", function() { alert("changed!!"); }); $("color").fireEvent("change"); // nothing happens The event handler on the parent div does not get called. Any help is appreciated. Cheers!

    Read the article

  • Using threads and event handlers within a WCF Web Service

    - by user368984
    While making a WCF Web Service, I came across a problem while using a method with a webbrowser control. The method starts a thread and uses a webbrowser control to fill in some forms and click further, waiting for a event handler to fire and return a answer I need. The method is tested and works within its own enviroment, but used in a WCF Web Service enviroment, the event handlers just won't fire. A result of that is the waiting manualresetevent not ending. Is this because of the new thread or because of the bad event handling of the web service? If yes, what is a reasonable solution?

    Read the article

  • Trigger Event after values have been commited for validation purposes

    - by www.jefferyfernandez.id.au
    I have a Flex component with a form and on creationComplete, I load some data onto the form textInputs. After the Form TextInputs have got their values, I want to trigger an event so the Parent of the component can validate the values on the TextInputs and based on the validation results, I perform some enable/disable of other interfaces. I have the following dispatch code: this.dispatchEvent(new PersonalDetailsEvent(PersonalDetailsEvent.LOADED_DATA_EVENT)); The event is dispatched and is captured by the parent. But upon performing the validation, some TextInputs always fail the validation. I thought it could be because of a race condition and so I used callLater() with same results. So in the end I am now using a timer to dispatch the event which is not ideal. Does anyone have a solution to this problem. It is really annoying that a timer needs to be used for this scenario.

    Read the article

  • Workflow Foundation (WF) -- Why does Visual Studio's designer not use my custom ActivityDesignerThem

    - by stakx
    Problem: I am trying to customize a custom Workflow Foundation activity (called CustomActivity) so that it will display with a specific background color. What I've got so far: First, I'm defining a custom ActivityDesignerTheme as follows: public class CustomActivityTheme : ActivityDesignerTheme { public CustomActivityTheme(WorkflowTheme theme) : base(theme) { this.BackColorStart = Color.FromArgb(0xff, 0xf4, 0xf4, 0xf4); this.BackColorEnd = Color.FromArgb(0xff, 0xc0, 0xc0, 0xc0); this.BackgroundStyle = LinearGradientMode.Horizontal; } } Then, I am applying this theme to a custom ActivityDesigner (apparently the theme must be applied to a designer, and not to an activity): [ActivityDesignerTheme(typeof(CustomActivityTheme))] public class CustomActivityDesigner : SequentialActivityDesigner { ... } Ultimately, I am applying the custom designer to my custom Activity: [Designer(typeof(CustomActivityDesigner))] public partial class CustomActivity : SequenceActivity { ... } Now, according to some code examples that I've seen, this should do the trick. However, when I include an instance of my CustomActivity in a workflow, my custom theme is not applied and it is displayed in the Visual Studio Designer as any standard activity would (white background etc.). I tried re-compiling and even re-starting Visual Studio a couple of times, just to make sure the used assembly is up-to-date, but to no avail. My question: What am I missing? Why does Visual Studio's Workflow Designer not respect the CustomActivityTheme when it displays a CustomActivity?

    Read the article

  • Magento - Show Custom Attributes in Grouped Product table.

    - by greencoconut
    I need to find a way to show the value of a custom attribute in place of the "Product Name" shown in the image below. I'm working with /app/design/frontend/default/defaultx/template/catalog/product/view/type/grouped.php The code below doesn't work(the custom attribute is yearmade): <?php if (count($_associatedProducts)): ?> <?php foreach ($_associatedProducts as $_item): ?> <tr> <td><?php echo $this->htmlEscape($_item->getYearmade()) ?></td> Any help would be appreciated. EDIT: So the answer turned out to be quite simple. You see what I failed to mention above was that there was indeed output... but that it was just a number (eg: 52). Turns out this was the ID for that custom attribute value (It was a Dropdown type of custom attribute). So in summary This works for custom attributes of type text: echo $this->htmlEscape($_item->getYearmade()) But for all other types of custom attribute (I think), the following should be used: echo $this->htmlEscape($_item->getAttributeText('yearmade')) I would not have discovered this without the most excellent answer provided by Alan Storm, below. Thank you sir.

    Read the article

  • What are the caveats of the event system built on Messenger rather than on classic .NET events?

    - by voroninp
    MVVM Light and PRISM offer messenger to implement event system. the approximate interface looks like the following one: interface Messanger { void Subscribe<TMessageParam>(Action<TMessageParam> action); void Unsubscribe<TMessageParam>(Action<TMessageParam> action); void Unsubscribe<TMessageParam>(objec actionOwner); void Notify<TMessageParam>(TMessageParam param); } Now this model seems beneficial comparing to classic .net events. It works well with Dependency Injection. Actions are stored as weak references so memory leaks are avioded and unsubscribe is not a must. The only annoyance is the need to declare new TMessageParam for each specific message. But everything comes at a cost. And what I'm really worried about is that I see no shortcomings of this approach. Has anoyne the experience of some troubles with this design pattern?

    Read the article

  • ASP.NET Creating a Rich Repeater, DataBind wiping out custom added controls...

    - by tonyellard
    So...I had this clever idea that I'd create my own Repeater control that implements paging and sorting by inheriting from Repeater and extending it's capabilities. I found some information and bits and pieces on how to go about this and everything seemed ok... I created a WebControlLibrary to house my custom controls. Along with the enriched repeater, I created a composite control that would act as the "pager bar", having forward, back and page selection. My pager bar works 100% on it's own, properly firing a paged changed event when the user interacts with it. The rich repeater databinds without issue, but when the databind fires (when I call base.databind()), the control collection is cleared out and my pager bars are removed. This screws up the viewstate for the pager bars making them unable to fire their events properly or maintain their state. I've tried adding the controls back to the collection after base.databind() fires, but that doesn't solve the issue. I start to get very strange results including problems with altering the hierarchy of the control tree (resolved by adding [ViewStateModeById]). Before I go back to the drawing board and create a second composite control which contains a repeater and the pager bars (so that the repeater isn't responsible for the pager bars viewstate) are there any thoughts about how to resolve the issue? In the interest of share and share alike, the code for the repeater itself is below, the pagerbars aren't as significant as the issue is really the maintaining of state for any additional child controls. (forgive the roughness of some of the code...it's still a work in progress) using System; using System.Collections.Generic; using System.ComponentModel; using System.Text; using System.Data; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; [ViewStateModeById] public class SortablePagedRepeater : Repeater, INamingContainer { private SuperRepeaterPagerBar topBar = new SuperRepeaterPagerBar(); private SuperRepeaterPagerBar btmBar = new SuperRepeaterPagerBar(); protected override void OnInit(EventArgs e) { Page.RegisterRequiresControlState(this); InitializeControls(); base.OnInit(e); EnsureChildControls(); } protected void InitializeControls() { topBar.ID = this.ID + "__topPagerBar"; topBar.NumberOfPages = this._currentProperties.numOfPages; topBar.CurrentPage = this.CurrentPageNumber; topBar.PageChanged += new SuperRepeaterPagerBar.PageChangedEventHandler(PageChanged); btmBar.ID = this.ID + "__btmPagerBar"; btmBar.NumberOfPages = this._currentProperties.numOfPages; btmBar.CurrentPage = this.CurrentPageNumber; btmBar.PageChanged += new SuperRepeaterPagerBar.PageChangedEventHandler(PageChanged); } protected override void CreateChildControls() { EnsureDataBound(); this.Controls.Add(topBar); this.Controls.Add(btmBar); //base.CreateChildControls(); } private void PageChanged(object sender, int newPage) { this.CurrentPageNumber = newPage; } public override void DataBind() { //pageDataSource(); //DataBind removes all controls from control collection... base.DataBind(); Controls.Add(topBar); Controls.Add(btmBar); } private void pageDataSource() { //Create paged data source PagedDataSource pds = new PagedDataSource(); pds.PageSize = this.ItemsPerPage; pds.AllowPaging = true; // first get a PagedDataSource going and perform sort if possible... if (base.DataSource is System.Collections.IEnumerable) { pds.DataSource = (System.Collections.IEnumerable)base.DataSource; } else if (base.DataSource is System.Data.DataView) { DataView data = (DataView)DataSource; if (this.SortBy != null && data.Table.Columns.Contains(this.SortBy)) { data.Sort = this.SortBy; } pds.DataSource = data.Table.Rows; } else if (base.DataSource is System.Data.DataTable) { DataTable data = (DataTable)DataSource; if (this.SortBy != null && data.Columns.Contains(this.SortBy)) { data.DefaultView.Sort = this.SortBy; } pds.DataSource = data.DefaultView; } else if (base.DataSource is System.Data.DataSet) { DataSet data = (DataSet)DataSource; if (base.DataMember != null && data.Tables.Contains(base.DataMember)) { if (this.SortBy != null && data.Tables[base.DataMember].Columns.Contains(this.SortBy)) { data.Tables[base.DataMember].DefaultView.Sort = this.SortBy; } pds.DataSource = data.Tables[base.DataMember].DefaultView; } else if (data.Tables.Count > 0) { if (this.SortBy != null && data.Tables[0].Columns.Contains(this.SortBy)) { data.Tables[0].DefaultView.Sort = this.SortBy; } pds.DataSource = data.Tables[0].DefaultView; } else { throw new Exception("DataSet doesn't have any tables."); } } else if (base.DataSource == null) { // don't do anything? } else { throw new Exception("DataSource must be of type System.Collections.IEnumerable. The DataSource you provided is of type " + base.DataSource.GetType().ToString()); } if (pds != null && base.DataSource != null) { //Make sure that the page doesn't exceed the maximum number of pages //available if (this.CurrentPageNumber >= pds.PageCount) { this.CurrentPageNumber = pds.PageCount - 1; } //Set up paging values... btmBar.CurrentPage = topBar.CurrentPage = pds.CurrentPageIndex = this.CurrentPageNumber; this._currentProperties.numOfPages = btmBar.NumberOfPages = topBar.NumberOfPages = pds.PageCount; base.DataSource = pds; } } public override object DataSource { get { return base.DataSource; } set { //init(); //reset paging/sorting values since we've potentially changed data sources. base.DataSource = value; pageDataSource(); } } protected override void Render(HtmlTextWriter writer) { topBar.RenderControl(writer); base.Render(writer); btmBar.RenderControl(writer); } [Serializable] protected struct CurrentProperties { public int pageNum; public int itemsPerPage; public int numOfPages; public string sortBy; public bool sortDir; } protected CurrentProperties _currentProperties = new CurrentProperties(); protected override object SaveControlState() { return this._currentProperties; } protected override void LoadControlState(object savedState) { this._currentProperties = (CurrentProperties)savedState; } [Category("Status")] [Browsable(true)] [NotifyParentProperty(true)] [DefaultValue("")] [Localizable(false)] public string SortBy { get { return this._currentProperties.sortBy; } set { //If sorting by the same column, swap the sort direction. if (this._currentProperties.sortBy == value) { this.SortAscending = !this.SortAscending; } else { this.SortAscending = true; } this._currentProperties.sortBy = value; } } [Category("Status")] [Browsable(true)] [NotifyParentProperty(true)] [DefaultValue(true)] [Localizable(false)] public bool SortAscending { get { return this._currentProperties.sortDir; } set { this._currentProperties.sortDir = value; } } [Category("Status")] [Browsable(true)] [NotifyParentProperty(true)] [DefaultValue(25)] [Localizable(false)] public int ItemsPerPage { get { return this._currentProperties.itemsPerPage; } set { this._currentProperties.itemsPerPage = value; } } [Category("Status")] [Browsable(true)] [NotifyParentProperty(true)] [DefaultValue(1)] [Localizable(false)] public int CurrentPageNumber { get { return this._currentProperties.pageNum; } set { this._currentProperties.pageNum = value; pageDataSource(); } } }

    Read the article

  • Class as an Event Observer

    - by emi
    I want to do something like this... var Color = Class.create({ initialize: function() { this._color = "white"; this.observe("evt: colorChanged", this.colorChanged.bind(this)); }, changeColor: function(color) { this._color = color; this.fire("evt: colorChanged"); }, colorChanged: function(event) { alert("You change my color!"); } }); var a = new Color().changeColor("blue"); Why the colorChange custom event will never be dispatched and I need to use, instead of this, a DOM element like document.observe? In my code I'd like to know which class dispatches the event using event.target and I can't if I must use document or some other DOM element. :( I've been working in Actionscript 3 and that's the methodology I learned to work with custom events in classes. What about Javascript?

    Read the article

  • Assign an existing click event function to another click event using jquery

    - by Peter Delahunty
    Ok so i have some html like this: <div id="navigation"> <ul> <li> <a>tab name</a> <span class="delete-tab">X</span> </li> <li> <a>tab name</a> <span class="delete-tab">X</span> </li> <li> <a>tab name</a> <span class="delete-tab">X</span> </li> <li class="selected"> <a>tab name</a> <span class="tab-del-btn">X</span> </li> </ul> </div> I then have javascript that is excuted on the page that i do not control (this is in liferay portal). I want to then manipulate things afterwards with my own custom javascript. SO... For each of the span.delete-tab elements an on-click event function has been assign earlier. It is the same function call for each span. I want to take that function (any) and call it from the click event of the span.tab-del-btn ? This is what i tried to do: var navigation = jQuery('#navigation'); var navTabs = navigation.find('.delete-tab'); var existingDeleteFunction = null; navTabs.each(function (i){ var tab = jQuery(this); existingDeleteFunction = tab.click; }); var selectedTab = jQuery('#navigation li.selected'); var deleteBtn = selectedTab.find('.tab-del-btn'); deleteBtn.click(function(event){ existingDeleteFunction.call(this); }); It does not work though. existingDeleteFunction is not the original function it is some jquery default function. Any ideas?

    Read the article

  • jQuery event trigger - cancelable event

    - by Dismissile
    I have created a jquery plugin which is triggering an event: $.fn.myplugin = function(options) { this.on("foo.myplugin", options.foo); this.on("bar.myplugin", options.bar); }; I want to check if foo has been canceled by a user and prevent bar from being triggered: // trigger foo this.trigger("foo.myplugin"); // how do I check if foo was canceled if( !fooCanceled ) { this.trigger("bar.myplugin"); } How can I check if foo was canceled to prevent bar from being triggered? jQuery UI does something similar to this, but it did not work when I tried: if (this._trigger("search", event) === false) { return; } I tried something similar to this: if( this.trigger("foo.myplugin") === false ) { return; } this.trigger("bar.myplugin"); But bar was still being triggered.

    Read the article

  • Drupal Event/Calendar Module not storing event time

    - by Selino
    Hello, all. I have installed a fresh copy of Drupal on an Xampp server. Within that install is a collection of modules for creating an event calendar. There's actually a great instructional video at http://www.youtube.com/watch?v=qO4TeEydtMs for getting all the necessary fields up. So far everything is working except... the events won't store the time as stated in the edit field. No matter what I do in the edit mode as admin or otherwise the time always says 12pm and the event on the calendar says "All Day". I know this is pretty obscure but I figured why not try and ask. Thanks.

    Read the article

  • Event-based interaction between two custom classes

    - by Antenka
    Hello everybody. I have such problem: I have 2 custom components, which have their own nesting hierarchy ... One is container for another. I have to "familiarize them" with each other. The way I'm trying to achieve that is using global events (one side is firing and the other one is catching): Application.application.addEventListener("Hello", function (data:Event):void{ // .. some actions }); //and Application.application.dispatchEvent(new Event(Hello)); Everything is pretty good, but there's one thingy .. when I'm trying to catch the event, I can't access the class, who is catching it. E.g.: Container fires the event. Child caughts it. Then should be created the connection between container and it's child. BUT, the only thing I could acheive is passing a reference to the Container in the DynamicEvent. Is there any chance that I could access the child at the event-handler function. Or maybe there's more elegant way to solve this problem ... Any help would be greately appreciated :)

    Read the article

  • Forward event from custom UIControl subclass

    - by ggould75
    My custom subclass extend UIControl (MyCustomUIControl) Basically it contains 3 subviews: UIButton (UIButtonTypeCustom) UIImageView UILabel All the class works great but now I want to connect some events generated from this class to another. In particular when the button is pressed I want to forward the event to the owner viewcontroller so that I can handle the event. The problem is that I can't figure out how to implement this behaviour. Within EditableImageView I can catch the touch event using [button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside] but I don't know how to forward it inside of the buttonPressed selector. I also tried to implement touchesBegan but it seems never called... I'd like to capture the button press event from the viewcontroller in this way: - (void)viewDidLoad { [super viewDidLoad]; self.imageButton = [[EditableImageView alloc] initWithFrame:CGRectMake(50.0f, 50.0f, 80.0f, 80.0f)]; [imageButton addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:imageButton]; [imageButton setEditing:NO]; } This is my UIControl subclass initialization method: - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { [self setBackgroundColor:[UIColor clearColor]]; button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(0.0f, 0.0f, frame.size.width, frame.size.height); [button setImage:[UIImage imageNamed:@"nene_70x70.png"] forState:UIControlStateNormal]; [button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside]; [self addSubview:button]; transparentLabelBackground = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"editLabelBackground.png"]]; transparentLabelBackground.hidden = YES; [self addSubview:transparentLabelBackground]; // create edit status label editLabel = [[UILabel alloc] initWithFrame:CGRectZero]; editLabel.hidden = YES; editLabel.userInteractionEnabled = NO; // without this assignment the button will not be clickable editLabel.textColor = [UIColor whiteColor]; editLabel.backgroundColor = [UIColor clearColor]; editLabel.textAlignment = UITextAlignmentLeft; UIFont *labelFont = [UIFont systemFontOfSize:16.0]; editLabel.font = labelFont; editLabel.text = @"edit"; labelSize = [@"edit" sizeWithFont:labelFont]; [self addSubview:editLabel]; } return self; } Thanks.

    Read the article

  • ItemAdded Event for document library in sharepoint 2007

    - by Azra
    hi I am having a document library in share point 2007, I want to validate certain custom properties before a document is uploaded Or Properties are entered when Edit properties event is cliked. I am trying to validate the fields at ItemAdding event whne a documetn is uploaded , however when EditForm.aspx opens up for editing properties, no events firs. How can I troubleshoot the issue? thanks azra

    Read the article

  • event for textbox update

    - by Richard
    I have a textbox and want an event triggered whenever it is updated, whether through key presses, pasted from clipboard, or whatever else is possible. Is binding to the keyup event sufficient or is there a better way?

    Read the article

  • Customizing Mail Message in SSIS Event Handler

    - by Eric Ness
    I want to add an email notification to an SSIS 2005 package event handler. I've added a Send Mail task to the event handler. I'd like to customize the email body to include things like the error description. I've tried including @[System::ErrorDescription] in the MessageSource field, but the mail message doesn't include the value of ErrorDescription only the name of the variable.

    Read the article

  • How to add a SaveOrUpdateCopy event listener in NHibernate

    - by skrishna
    How can I add a event listener for SaveOrUpdateCopy in NHibernate ? I see that the ListenerType enumeration does not have a 'SaveOrUpdateCopy' type. I tried using the 'Merge' type, but that adds it to the MergeEventListeners collection. The SaveOrUpdateCopy invokes the events from the SaveOrUpdateCopyEventListeners collection. How can I add my event class to the SaveOrUpdateCopyEventListeners collection in NHibernate? Any help is appreciated.

    Read the article

  • Writing exceptions in multihreaded windows service to event log

    - by Ziplin
    I have a multithreaded windows service that will unpredictably stop running once every 24 hours or so. I am writing to the event log and that's going through just fine, but whenever the service crashes there are no messages in the event log (even that the service stopped, despite having AutoLog=true). Is there a way to have uncaught exceptions written straight to the log, even if they aren't in the original thread?

    Read the article

  • C# wpf: Need to add mouseclick event to certain text within a textbox

    - by Michael
    I have a textbox with a paragraph of information. There are certain words in the paragraph that i want the user to be able to click on, and when clicked, a different textbox is populated with more information. I know that you can have the event for the whole textbox, but that isn't want i want. I only want to call that event when certain words within the box are clicked.

    Read the article

  • where store event handler method in WPF - MVVM

    - by netmajor
    Hey, Where should I store event methods for button Click event ?Normally it's store in code behind of wpf page, <Button Name="myButton" Click="myButton_Click">Click Me</Button> but in MVVM it should be store in other view-model class and bind to click property of button like that?? <Button Name="myButton" Click="{Binding StaticResouces myButton_Click}">Click Me</Button>

    Read the article

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