Search Results

Search found 2670 results on 107 pages for 'trigger'.

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

  • MVC/HTML - input submit won't trigger when HTML is in a text area

    - by cw
    Any idea why the below code doesn't trigger if I were to put some HTML inside the textarea? It works fine it I don't have HTML in it, but I'm not sure why it doesn't work with it. Here is the code. <form action="/Home/AddPost" method="post"> <table> <tr> <td>Post Title:</td> <td><input id="Title" type="text" name="title" /></td> </tr> <tr> <td>Post Description:</td> <td><textarea id="Description" rows="10" cols="60" name="description"></textarea></td> </tr> </table> <input type="submit" value="Save" /> </form>

    Read the article

  • trigger config transformation in TFS 2010 or msbuild

    - by grenade
    I'm attempting to make use of configuration transformations in a continuous integration environment. I need a way to tell the TFS build agent to perform the transformations. I was kind of hoping it would just work after discovering the config transform files (web.qa-release.config, web.production-release.config, etc...). But it doesn't. I have a TFS build definition that builds the right configurations (qa-release, production-release, etc...) and I have some specific .proj files that get built within these definitions and those contain some environment specific parameters eg: <PropertyGroup Condition=" '$(Configuration)'=='production-release' "> <TargetHost Condition=" '$(TargetHost)'=='' ">qa.web</TargetHost> ... </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)'=='qa-release' "> <TargetHost Condition=" '$(TargetHost)'=='' ">production.web</TargetHost> ... </PropertyGroup> I know from the output that the correct configurations are being built. Now I just need to learn how to trigger the config transformations. Is there some hocus pocus that I can add to the final .proj in the build to kick off the transform and blow away the individual transform files?

    Read the article

  • Load external script dynamic, and access it, so I can trigger its domready function

    - by Didier
    I am trying to load the Zopim chat client. Normally it is included with a document write action. This causes it to be loaded before the domReady function is triggered, as it needs this to start itself. I want to load it later, and this works by using prototype (framework determined by Magento) to create a new script element and attaching it to the head. The script is loaded perfectly, but the domReady doesn't fire, so the script is never started. The script is a nameless class, by this I mean that all its functions are encapsulated in {} UPDATE: Sorry, I got it wrong, it is as self invoking function, the same syntax as the first answer suggest. (function C(){ })(); This function call when run sets up listening events for the domReady event under various browsers and then waits. When the domready event fires, it calls a function (that is within the self-invoked function) that starts everything. What I need, is a way to access this function somehow. END UPDATE Within that is a function named C. How can I call this function directly? Or put another way, how can I start an external javascript file that depends on domready going off, when that event doesn't happen? Can I load an external javascript file into a variable, so I can name the class? Can I access the nameless class {} somehow maybe via the script tag? Is there a way to alter the external file/javascript so I can have it look for another event, one that I can trigger? About the only solution I can think of at the moment is to create a iframe and load the script in that.

    Read the article

  • Setting up a button to trigger both modalPopupExtender and his Click Method

    - by Vitor Reis
    Hey guys, I have this modalPopupExtender, I want it to show a CheckBoxList with some data. I have set up a button to call both the method to fill the CheckBoxes and trigger the modalPopup (TargetControlID). they're all inside an UpdatePanel. with the right triggers. The problem is that when I click the button it shows the modalPopup but doesn't load the method to fill my CheckBoxes... Also, a linkButton inside the poup (linkButtonCheckAll) just closes the popup when clicked. When I remove the modalPopup the code works just fine and the list is loaded dinamically with the UpdatePanel. <asp:UpdatePanel ID="uppLote" runat="server"> <ContentTemplate> <ajaxToolkit:ModalPopupExtender ID="modalLote" runat="server" BehaviorID="popup" TargetControlID="buttonViewLote" PopupControlID="panelLote" /> <asp:Panel ID="panelLote" runat="server" CssClass="modalpopup"> <asp:LinkButton ID="linkButtonCheckAll" runat="server" Text="Check All Items" onclick="linkButtonCheckAll_Click"></asp:LinkButton> <asp:CheckBoxList ID="checkListLote" runat="server"> </asp:CheckBoxList> </asp:Panel> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="linkButtonViewLote" EventName="Click" /> <asp:AsyncPostBackTrigger ControlID="linkButtonCheckAll" EventName="Click" /> </Triggers> </asp:UpdatePanel> If I completely remove the modalPopupExtender, the code works fine, showing me the list I want with the method "linkButonViewLote_Click" (so, the problem is occurring due to the button triggering the modalPopupExtender is the same that I'm using to get my data, right? Any solutions?

    Read the article

  • window.onload seems to trigger before the DOM is loaded (JavaScript)

    - by Dr. Monkey
    I am having trouble with the window.onload and document.onload events. Everything I read tells me these will not trigger until the DOM is fully loaded with all its resources, it seems like this isn't happening for me: I tried the following simple page in Chrome 4.1.249.1036 (41514) and IE 8.0.7600.16385 with the same result: both displayed the message "It failed!", indicating that myParagraph is not loaded (and so the DOM seems incomplete). <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <script type="text/javascript"> window.onload = doThis(); // document.onload gives the same result function doThis() { if (document.getElementById("myParagraph")) { alert("It worked!"); } else { alert("It failed!"); } } </script> </head> <body> <p id="myParagraph">Nothing is here.</p> </body> </html> I am using more complex scripts than this, in an external .js file, but this illustrates the problem. I can get it working by having window.onload set a timer for half a second to run doThis(), but this seems like an inelegant solution, and doesn't answer the question of why window.onload doesn't seem to do what everyone says it does. Another solution would be to set a timer that will check if the DOM is loaded, and if not it will just call itself half a second later (so it will keep checking until the DOM is loaded), but this seems overly complex to me. Is there a more appropriate event to use?

    Read the article

  • Correct way to trigger object clone/memento when property changes

    - by Jay
    Hi, I have a big doubt about the correct way to save an object state (clone object), if necessary to rollback the changes, when a property has changed. I know that the IEditableObject interface exists for those cases but during some tests the BeginEdit would just fire like crazy (I have a DataGrid whose values can be edited but I won't need to keep the state of the object in these cases). I'm following the MVP design pattern in my project and the view's DataContext is a wrapper of my presenter.Let's say I have a CheckBox/TextBox in my UI and when that textbox's value changes, the property bound in the wrapper gets set.Currently, before setting the new value i'm raising an event to the presenter (something like PropertyChanging) that clones my wrapper. I'm doing this because I don't think that job should be done by the wrapper itself but by the presenter.Is this a correct approach? Raising the event is an acceptable solution? I thought of other possible ideas: Interface between presenter and wrapper; Use explicit binding and trigger the binding after saving object's state; What is your opinion about the best way to do this? Should I just keep IEditableObject, is this the best way? Best Regards

    Read the article

  • is there an equivalent of a trigger for general stored procedure execution on sql server

    - by Arj
    Hi All, Hope you can help. Is there a way to detect when a stored proc is being run on SQL Server without altering the SP itself? Here's the requirement. We need to track users running reports from our enterprise data warehouse as the core product we use doesn't allow for this. Both core product reports and a slew of in-house ones we've added all return their data from individual stored procs. We don't have a practical way of altering the parts of the product webpages where reports are called from. We also can't change the stored procs for the core product reports. (It would be trivial to add a logging line to the start/end of each of our inhouse ones). What I'm trying to find therefore, is whether there's a way in SQL Server (2005 / 2008) to execute a logging stored proc whenever any other stored procedure runs, without altering those stored procedures themselves. We have general control over the SQL Server instance itself as it's local, we just don't want to change the product stored procs themselves. Any one have any ideas? Is there a kind of "stored proc executing trigger"? Is there an event model for SQL Server that we can hook custom .Net code into? (Just to discount it from the start, we want to try and make a change to SQL Server rather than get into capturing the report being run from the products webpages etc) Thoughts appreciated Thanks

    Read the article

  • Google Script / Spreadsheet -- Shared permissions with Installed Trigger onEdit

    - by user1761852
    Using an installed trigger inside spreadsheet to call onUpdateBilling(). Purpose of this script is on edit, based on content of column "billed" (i.e. "d") will highlight the entire column the predetermined color. Page running script is shared with collaborators and they have been given edit access. My expectation at this point is the script should be run with owner permissions. My shared users are unable to run the script with the given error "You don't have permission for this action." Reached my limited knowledge and googlefu for this workaround. Any help to allow operation to my collaborators is appreciated. Script: function onUpdateBilling(e) { var statusCol = 16; // replace with the column index of Status column A=1,B=2,etc var sheetName = "Temple Log"; // replace with actual name of sheet containing Status var cell = SpreadsheetApp.getActiveSheet().getActiveCell(); var sheet = cell.getSheet(); if(cell.getColumnIndex() != statusCol || sheet.getName() != sheetName) return; var row = cell.getRowIndex(); var status = cell.getValue(); // change colors to meet your needs var color; if (status == "D" || status == "d") { color = "red";} else if (status >= 1) { color = "yellow";} else if (status == "X" || status == "x") { color = "black";} else if (status == "") { color = "white";} else { color = "white"; } sheet.getRange(row + ":" + row ).setBackgroundColor(color); }

    Read the article

  • MySQL db Audit Trail Trigger

    - by Natkeeran
    I need to track changes (audit trail) in certain tables in a MySql Db. I am trying to implement the solution suggested here. I have an AuditLog Table with the following columns: AuditLogID, TableName, RowPK, FieldName, OldValue, NewValue, TimeStamp. The mysql stored procedure is the following (this executes fine, and creates the procedure): The call to the procedure such as: CALL addLogTrigger('ProductTypes', 'ProductTypeID'); executes, but does not create any triggers (see the image). SHOW TRIGGERS returns empty set. Please let me know what could be the issue, or an alternate way to implement this. DROP PROCEDURE IF EXISTS addLogTrigger; DELIMITER $ CREATE PROCEDURE addLogTrigger(IN tableName VARCHAR(255), IN pkField VARCHAR(255)) BEGIN SELECT CONCAT( 'DELIMITER $\n', 'CREATE TRIGGER ', tableName, '_AU AFTER UPDATE ON ', tableName, ' FOR EACH ROW BEGIN ', GROUP_CONCAT( CONCAT( 'IF NOT( OLD.', column_name, ' <=> NEW.', column_name, ') THEN INSERT INTO AuditLog (', 'TableName, ', 'RowPK, ', 'FieldName, ', 'OldValue, ', 'NewValue' ') VALUES ( ''', table_name, ''', NEW.', pkField, ', ''', column_name, ''', OLD.', column_name, ', NEW.', column_name, '); END IF;' ) SEPARATOR ' ' ), ' END;$' ) FROM information_schema.columns WHERE table_schema = database() AND table_name = tableName; END$ DELIMITER ;

    Read the article

  • SQL-Server: Is there an equivalent of a trigger for general stored procedure execution

    - by Arj
    Hi All, Hope you can help. Is there a way to reliably detect when a stored proc is being run on SQL Server without altering the SP itself? Here's the requirement. We need to track users running reports from our enterprise data warehouse as the core product we use doesn't allow for this. Both core product reports and a slew of in-house ones we've added all return their data from individual stored procs. We don't have a practical way of altering the parts of the product webpages where reports are called from. We also can't change the stored procs for the core product reports. (It would be trivial to add a logging line to the start/end of each of our inhouse ones). What I'm trying to find therefore, is whether there's a way in SQL Server (2005 / 2008) to execute a logging stored proc whenever any other stored procedure runs, without altering those stored procedures themselves. We have general control over the SQL Server instance itself as it's local, we just don't want to change the product stored procs themselves. Any one have any ideas? Is there a kind of "stored proc executing trigger"? Is there an event model for SQL Server that we can hook custom .Net code into? (Just to discount it from the start, we want to try and make a change to SQL Server rather than get into capturing the report being run from the products webpages etc) Thoughts appreciated Thanks

    Read the article

  • Manually Trigger or Prevent Javascript Lazy Loading in Website from Bookmarklet

    - by stwhite
    One of the problems with using a bookmarklet for grabbing images on a page is that if a website uses lazy loading, the bookmarklet won't detect the image because it will have a placeholder, e.g. "grey.gif" and not the actual source of the image. Javascript on page load, is run to replace these urls. I'm looking for a solution to retrieve those images that are not being displayed by either triggering or preventing Lazy Loading from running. This bookmarklet isn't limited to one specific domain. So far some ideas I've had are: Ping the domain and retrieve the page html if no images are found the first time around: Problem: this then requires parsing the actual html. Problem: with lazy loading, a few images will always show, just none below the fold. Scroll page to initiate lazy loading when bookmarklet is clicked, then scroll back to top. Trigger Lazy Loading from inside bookmarklet using script. Lazy Loader adds the "original" attribute, potentially could check if attribute exists w/ value. Problem: ???

    Read the article

  • Trigger JavaScript action after Datatable is loaded

    - by perissf
    In a JSF 2.1 + PrimeFaces 3.2 web application, I need to trigger a JavaScript function after a p:dataTable is loaded. I know that there is no such event in this component, so I have to find a workaround. In order to better understand the scenario, on page load the dataTable is not rendered. It is rendered after a successful login: <p:commandButton value="Login" update=":aComponentHoldingMyDataTable" action="#{loginBean.login}" oncomplete="handleLoginRequest(xhr, status, args)"/> As you can see from the above code, I have a JavaScript hook after the successful login, if it can be of any help. Immediately after the oncomplete action has finished, the update attribute renders the dataTable: <p:dataTable var="person" value="#{myBean.lazyModel}" rendered="#{p:userPrincipal() != null}" /> After the datatable is loaded, I need to run a JavaScript function on each row item, in order to subscribe to a cometD topic. In theory I could use the oncomplete attribute of the login Button for triggering a property from myBean in order to retrieve once again the values to be displayed in the dataTable, but it doesn't seem very elegant. The JavaScript function should do something with the rowKey of each row of the dataTable: function javaScriptFunctionToBeTriggered(rowKey) { // do something }

    Read the article

  • Oracle Forms on-button-pressed trigger to solve three scenarios

    - by DBase486
    Hello, I'm writing a when-button-pressed trigger on a save button for an Oracle Forms 6i form, and it has to fulfill a couple of scenarios. Here's some background information: the fields we're primarily concerned with are: n_number, alert_id, end_date For all three scenarios we are comparing candidate records against the following records in the database (for the sake of argument, let's assume they're the only records in the database so far): alert_id|| n_number|| end_date ------------------------------------- 1|| 5|| _______ 2|| 6|| 10/25/2009 Scenario 1: The user enters a new record: alert_id 1 n_number 5 end_date NULL Objective: prevent the user from committing duplicate rows Scenario 2: The user enters a new record: alert_id 1 n_number 10 end_date NULL Objective: Notify the user that this alert_id already exists, but allow the user the ability to commit the row, if desired. Scenario 3: The user enters a new record: alert_id 2 n_number 6 end_date NULL Objective: Notify the user that this alert_id has occurred in the past (i.e. it has a not-null end_date), but allow the user to commit the row, if desired. I've written the code, which seems to comply with the first two scenarios, but prevents me from fulfilling the third. Issues: When I enter the third scenario case, I am prompted to commit the record, but when I attempt this, the "duplicate_stop" alert pops up, preventing me. Issues: I'm getting the following error: ORA-01843: not a valid month. While testing the code for the third scenario in Toad (hard-coding the values, etc) things seemed to be fine. Why would I encounter these problems at run-time? Help is very much appreciated. Thank you

    Read the article

  • Identifying the GeoPoint that trigger an onTap call

    - by Akroy
    I'm developing a Google Maps app on Android. I have a number of GeoPoints that I'm displaying by adding them as OverlayItems to an ItemizedOverlay. This works well for displaying them and bringing up a nice box when I click them, however I'm trying to put info in the box it brings up. Thus, I've extended ItemizedOverlay with my own class, and I'm overriding onTap (final GeoPoint p, final MapView mapView). At first I thought that this would be very simple, as one of the parameters is the GeoPoint, so I would know exactly which GeoPoint was clicked. However, from what I can tell, the GeoPoint argument there is the GeoPoint for where the user actually touched. Given the range the user can touch and still trigger the onTap, that GeoPoint isn't very helpful for knowing precisely which GeoPoint was actually touched. I'm currently checking the parameter GeoPoint against all my existing GeoPoints and seeing which it's closest to. This seems like a super hacky abstraction inversion. Is there a better way to know what was actually tapped?

    Read the article

  • Use MySQL trigger to update another table when duplicate key found

    - by Jason
    Been scratching my head on this one, hoping one of you kind people and direct me towards solving this problem. I have a mysql table of customers, it contains a lot of data, but for the purpose of this question, we only need to worry about 4 columns 'ID', 'Firstname', 'Lastname', 'Postcode' Problem is, the table contains a lot of duplicated customers. A new table is being created where each customer is unique and for us, we decide a unique customer is based on 'Firstname', 'Lastname' and 'Postcode' However, (this is the important bit) we need to ensure each new "unique" customer record also can be matched to the original multiple entries of that customer in the original table. I believe the best way to do this is to have a third table, that has 'NewUniqueID', 'OldCustomerID'. So we can search this table for 'NewUniqueID' = '123' and it would return multiple 'OldCustomerID' values where appropriate. I am hoping to make this work using a trigger and the on duplicate key syntax. So what would happen is as follows: An query is run taking the old customer table and inserting it in to the new unique table. (A standard Insert Select query) On duplicate key continue adding records, but add one entry in to the third table noting the 'NewUniqueID' that duped along with the 'OldCustomerID' of the record we were trying to insert. Hope this makes sense, my apologies if it isn't clear. I welcome and appreciate any thoughts on this one! Many thanks Jason

    Read the article

  • WPF MVVM Trigger Animation on MainWindow close

    - by Scott
    I'm using trying to implement MVVM in my app. I have a MainWindow.xaml and a MainWindowViewModel. I'm in the process of removing all of the code-behind code from the MainWindow.xaml but I'm stuck on one final piece. In my pre-MVVM setup I started an animation in the MainWindow.xaml.cs that would fade out the form before closing it. Since Closing is not a RoutedEvent, I had to use code-behind to get this to work. My VM has the following two properties that can be bound: ClosingWindow and CloseWindow. My goal was to bind a DataTrigger in my MainWindowStyle to the ClosingWindow property of the VM. When ClosingWindow was set to True, it would start an animation using the following XAML: <DataTrigger Binding="{Binding ClosingWindow}" Value="True"> <DataTrigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:2"/> </Storyboard> </BeginStoryboard> </DataTrigger.EnterActions> </DataTrigger> Somehow (insert magic here) I was going to set CloseWindow on the VM, via Binding, to True when the animation completed, which would then use an AttachedBehavior to Close the Window. The AttachedBehavior works perfectly when I just set CloseWindow directly using the following XAML: <DataTrigger Binding="{Binding CloseWindow}" Value="True"> <Setter Property="ab:WindowCloseBehavior.Close" Value="True"/> </DataTrigger> ...but I want to reproduce the form fade before the form actually closes. So there are two issues that I've run into: First, the animation doesn't work. I enter the trigger correctly (I've taken out the animation and put a Setter statement in there that changes the Title of the MainWindow to "Closing" and it changes correctly when ClosingWindow = True) but the DoubleAnimation never does anything. Second, there's no way to set the value of CloseWindow once the animation is complete. I looked at Marlon Grech's animation code but that won't work on DataTriggers. I can't publish a RoutedEvent because my VM doesn't descend from UIElement, and I've been Googling all day trying to come up with a clever, MVVM-friendly way to do this with no luck. So any ideas why that animation doesn't do anything? And more importantly, how would you solve the entire problem of animating a form fade on close from the VM? I don't doubt that my entire solution to this problem might be whacked so I'm open to just about anything.

    Read the article

  • ASP.NET - FileUpload with PostBack Trigger

    - by Echilon
    I have an UpdatePanel which has an upload control and a button to upload. The button is set as a trigger, but the event handler for the button fails to execute on the first PostBack. My ASPX code is: <asp:UpdatePanel ID="updPages" runat="server" UpdateMode="Conditional"> <ContentTemplate> <div class="tabs"> <ul> <li><asp:LinkButton ID="lnkContentsPages" runat="server" OnClick="updateContents" CommandArgument="pages">Pages</asp:LinkButton></li> <%-- these tabs change the ActiveViewIndex to show a different UserControl --%> <li><asp:LinkButton ID="lnkContentsImages" runat="server" OnClick="updateContents" CommandArgument="images">Images</asp:LinkButton></li> </ul> <div class="tabbedContent"> <asp:MultiView runat="server" ID="mltContentsInner" ActiveViewIndex="0"> <asp:View ID="viwContentsImages" runat="server"> // ajax usercontrol for a list of images - works fine with ajax <fieldset> <legend>Upload New</legend> <div class="formRow"> <asp:Label ID="lblFile" runat="server" Text="Filename" AssociatedControlID="uplFile" /> <asp:FileUpload ID="uplFile" runat="server" /> </div> <div class="formRow"> <asp:Label ID="lblImageDescription" runat="server" Text="Description" AssociatedControlID="txtImageDescription" /> <asp:TextBox runat="server" ID="txtImageDescription" /> </div> <asp:Button ID="btnUpload" runat="server" Text="Upload" CssClass="c3button btnUpload" CausesValidation="false" OnClick="btnUpload_Click" /> </fieldset> </asp:View> <asp:View ID="viwContentsPages" runat="server"> // ajax usercontrol - works fine with ajax </asp:View> </asp:MultiView> </div> </div> </ContentTemplate> <Triggers> <asp:PostBackTrigger ControlID="btnUpload" /> </Triggers> </asp:UpdatePanel> The button works without fail on the second and subsequent times, just not the first. Is there any reason for this?

    Read the article

  • JqTouch - Detect trigger for animation

    - by majman
    Yet another problem I'm having w/ jqTouch... I'm trying to detect what element was clicked to trigger an animation so that I can pass parameters from the clicked item to the subsequent page. My HTML is: <div id="places"> <div class="toolbar"> <h1>Places</h1> <a class="back" href="#">Back</a> </div> <ul> <li id="1"><a href="#singleplace">Place 1</a></li> <li id="2"><a href="#singleplace">Place 2</a></li> <li id="3"><a href="#singleplace">Place 3</a></li> </ul> </div> <div id="singleplace"> <div class="toolbar"> <h1></h1> <a class="back" href="#">Back</a> </div> </div> When I click on any of the list items in #places, I'm able to slide over to #singleplace just fine, but I'm trying to detect which element was clicked so that I can pass parameters into the #singleplace div. My javascript is: var placeID; $('#places a').live('mouseup',function(){ $('#singleplace h1').html($(this).text()) placeID = $(this).parent().attr('id'); }) I've tried several alternatives to the $(el).live('event', fn()) approach including: $('#places a').live('click',fn()... $('#places a').live('mouseup',fn()... $('#places a').live('tap',fn()... $('#places a').tap(fn()... None of which seem to work. Is there a better way I could be handling this? I noticed on jqTouch's issues page, there is this: http://code.google.com/p/jqtouch/issues/detail?id=91 which may be part of the problem...

    Read the article

  • trigger animation with timer, as3

    - by VideoDnd
    How do I trigger the animation in sync with my timer?My timer and flip animation work, but they are out of sync with each other. I'm lost with the IF ELSE statements. Each time the value of my textfield changes, my number needs to flip. See example. Example //IF ELSE FUNCTION function theFlip(event:TimerEvent):void { count++; if (count < 9) { oldcount = count - 1; } else { count++; fcount=int(count) count++; oldcount = count - 1; } } //Cont... Complete Codehere's the file //Timer var timer:Timer = new Timer(100); //Integer values var count:int = 0; var fcount:int = 0; var oldcount:int = 0; //Formatting String function formatCount(i:int):String { var fraction:int = i % 100; var whole:int = i / 100; return ("00" + whole).substr(-2, 2) + "." + (fraction < 10 ? "0" + fraction : fraction); } //Start the timer timer.start(); timer.addEventListener(TimerEvent.TIMER, theFlip); //IF ELSE FUNCTION function theFlip(event:TimerEvent):void { count++; if (count < 9) { oldcount = count - 1; } else { count++; fcount=int(count) count++; oldcount = count - 1; } var toText:String = formatCount(fcount); sec4.digit.text = toText.substr(4, 1); flip4.flip.digit.text = toText.substr(4, 1); flip4.gotoAndPlay(2); sec3.digit.text = toText.substr(3, 1); flip3.flip.digit.text = toText.substr(3, 1); flip3.gotoAndPlay(2); sec1.digit.text = toText.substr(1, 1); flip1.flip.digit.text = toText.substr(1, 1); flip1.gotoAndPlay(2); }

    Read the article

  • Why trigger query fails in the sqlite with Qt?

    - by dexterous_stranger
    I am a beginner in the SQL. I am using SQLite, Qt - on embedded systems. I want to put a trigger here. The trigger is that whenever the primary key Id is greater than 32145, then channelNum=101 should be set. I want to set the attrib name - text also, but I got the compilation issue. I believe that the setting of trigger is the part of DDL - Data definition language. Please let me know that if I am wrong here. Here is my create db code. I get the sql query error. Also please do suggest how to set the text attrib = "COmedy". /** associate db with query **/ QSqlQuery query ( m_demo_db ); /** Foreign keys are disabled by default in sqlite **/ /** Here is the pragma to turn them on first **/ query.exec("PRAGMA foreign_keys = ON;"); if ( false == query.exec()) { qDebug()<<"Pragma failed"; } /** Create Table for storing user preference LCN for DTT **/ qDebug()<<"Create Table postcode.db"; query.prepare(" CREATE TABLE dttServiceList (Id INTEGER PRIMARY KEY, attrib varchar(20), channelNum integer )" ); if ( false == query.exec()) { qDebug()<<"Create dttServiceList table failed"; } /** Try placing trigger here **/ triggerQuery = "CREATE TRIGGER upd_check BEFORE INSERT ON dttServiceList \ FOR EACH ROW \ BEGIN \ IF Id > 32145 THEN SET channelNum=101; \ END IF; \ END; "; query.prepare(triggerQuery); if ( false == query.exec()) { qDebug()<<"Trigger failed !!"; qDebug() << query.lastError(); } Also, how to set the text name in the trigger - I want to SET attrib = "Comedy".

    Read the article

  • How to configure a GridView CommandField to trigger Full Page Update in UpdatePanel

    - by Frinavale
    I have 2 user controls on my page. One is used for searching, and the other is used for editing (along with a few other things). The user control that provides the search functionality uses a GridView to display the search results. This GridView has a CommandField used for editing (showEditButton="true"). I would like to place the GridView into an UpdatePanel so that paging through the search results will be smooth. The thing is that when the user clicks the Edit Link (the CommandField) I need to preform a full page postback so that the search user control can be hidden and the edit user control can be displayed. Edit: the reason I need to do a full page postback is because the edit user control is outside of the UpdatePanel that my GridView is in. It is not only outside the UpdatePanel, but it's in a completely different user control. I have no idea how to add the CommandField as a full page postback trigger to the UpdatePanel. The PostBackTrigger (which is used to indicate the controls cause a full page postback) takes a ControlID as a parameter; however the CommandButton does not have an ID...and you can see why I'm having a problem with this. Update on what else I've tried to solve the problem: I took a new approach to solving the problem. In my new approach, I used a TemplateField instead of a CommandField. I placed a LinkButton control in the TemplateField and gave it a name. During the GridView's RowDataBound event I retrieved the LinkButton control and added it to the UpdatePanel's Triggers. This is the ASP Markup for the UpdatePanel and the GridView <asp:UpdatePanel ID="SearchResultsUpdateSection" runat="server"> <ContentTemplate> <asp:GridView ID="SearchResultsGrid" runat="server" AllowPaging="true" AutoGenerateColumns="false"> <Columns> <asp:TemplateField> <HeaderTemplate></HeaderTemplate> <ItemTemplate> <asp:LinkButton ID="Edit" runat="server" Text="Edit"></asp:LinkButton> </ItemTemplate> </asp:TemplateField> <asp:BoundField ...... </Columns> </asp:GridView> </ContentTemplate> </asp:UpdatePanel> In my VB.NET code. I implemented a function that handles the GridView's RowDataBound event. In this method I find the LinkButton for the row being bound to, create a PostBackTrigger for the LinkButton, and add it to the UpdatePanel's Triggers. This means that a PostBackTrigger is created for every "edit" LinkButton in the GridView Edit: this did not create a PostBackTrigger for Every "edit" LinkButton because the ID is the same for all LinkButtons in the GridView. Private Sub SearchResultsGrid_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles SearchResultsGrod.RowDataBound If e.Row.RowType = DataControlRowType.Header Then ''I am doing stuff here that does not pertain to the problem Else Dim editLink As LinkButton = CType(e.Row.FindControl("Edit"), LinkButton) If editLink IsNot Nothing Then Dim fullPageTrigger As New PostBackTrigger fullPageTrigger.ControlID = editLink.ID SearchResultsUpdateSection.Triggers.Add(fullPageTrigger) End If End If End Sub And instead of handling the GridView's RowEditing event for editing purposes i use the RowCommand instead. Private Sub SearchResultsGrid_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles SearchResultsGrid.RowCommand RaiseEvent EditRecord(Me, New EventArgs()) End Sub This new approach didn't work at all because all of the LinkButtons in the GridView have the same ID. After reading the MSDN article on the UpdatePanel.Triggers Property I have the impression that Triggers can only be defined declaratively. This would mean that anything I did in the VB code wouldn't work. Any advise would be greatly appreciated. Thanks, -Frinny

    Read the article

  • jQuery , Trigger change event on newly created elements

    - by kwhohasamullet
    Hi Guys, I have a button in a form that when clicked adds another set of form fields, In these form fields there are 2 drop downs where the contents of the 2nd dropdown rely on what is selected in the first dropdown... What i want to do is when the new form field button is clicked for the new items to be added and then the change event to be triggered on the drop down that was created so what only that drop down changes and not all the drop downs with the same name currently in that form. THe first drop down is called product Category The code for the addFormField function is: function addFormField() { var id = document.getElementById("field_id").value; $("#products").append("<table width='600' cellpadding='5' cellspacing='0' class='Add_Products' id='row" + id + "'><td width='250' class='left'><label>Select Product Category</label></td><td class='right' ><label><select name='" + id + "' id='ProductCategory'><?php foreach($categories as $key=>$category){ echo "<option value=".$key.">".$category."</option>"; } ?></select></label></td></tr><tr><td width='250' class='left'><label>Select Product Template</label></td><td class='right' ><label><select name='data[QuoteItem][" + id + "][product_id]' id='QuoteItem" + id + "product_id' class='Product' title='" + id + "'></select></label></td></tr><tr ><td class='left'>Name</td><td class='right'><label><input name='data[QuoteItem][" + id + "][name]' type='text' id='QuoteItem" + id + "name' size='50' /></label></td></tr><tr ><td class='left'>Price (ex GST)</td><td class='right'><input type='text' name='data[QuoteItem][" + id + "][price]' id='QuoteItem" + id + "price' onchange='totalProductPrice();' class='quote-item-price' value='0' /></td></tr><tr><td class='left'>Description</td><td class='right'><label><textarea name='data[QuoteItem][" + id + "][description]' cols='38' rows='5' id='QuoteItem" + id + "description'></textarea></label></td></tr><tr><td><a href='#' onClick='removeFormField(\"#row" + id + "\"); return false;'>Remove</a></td></tr></table>"); $('#row' + id).highlightFade({ speed:1000 }); id = (id - 1) + 2; document.getElementById("field_id").value = id; } The code that detects change in ProductCategory dropdown and triggers the AJAX is below: $("select#ProductCategory").live('change', function(){ var url = base + "/quotes/productList/" + $(this).val() + ""; var id = $(this).attr('name'); $.getJSON(url,{id: $(this).val(), ajax: 'true'}, function(j){ var options = ''; options += '<option value="0">None</option>'; $.each(j, function(key, value){ options += '<option value="' + key + '">' + value + '</option>'; }) $("select#QuoteItem" + id + "product_id").html(options); }) }).trigger('change'); I have been trying all afternoon to work this out and the closest one i got to work applied the returned ajax values to all items. Currently using the live function people can add new fields and are able to use the drops down independant of each other dropdown but its only when the field is first added that i have trouble getting is populated Thanks in advance for any help

    Read the article

  • Implementing Audit Trail- Spring AOP vs.Hibernate Interceptor vs DB Trigger

    - by RN
    I found couple of discussion threads on this- but nothing which brought a comparison of all three mechanism under one thread. So here is my question... I need to audit DB changes- insert\updates\deletes to business objects. I can think of three ways to do this 1) DB Triggers 2) Hibernate interceptors 3) Spring AOP (This question is specific to a Spring\Hibernate\RDBMS- I guess this is neutral to java\c# or hibernate\nhibernate- but if your answer is dependent upon C++ or Java or specific implementation of hibernate- please specify) What are the pros and cons of selecting one of these strategies ? I am not asking for implementation details.-This is a design discussion. I am hoping we can make this as a part of community wiki

    Read the article

  • WPF trigger on datagrid to hide/show columns according to bindings

    - by Renan
    I have a data grid like this: <DataGrid AutoGenerateColumns="False" CanUserDeleteRows="True" HorizontalScrollBarVisibility="Hidden" Margin="10,10,10,10" VerticalScrollBarVisibility="Visible" CanUserAddRows="False" ItemsSource="{Binding ListGestores}" ToolTip="Selecione uma linha e pressione DELETE para remover uma unidade."> <DataGrid.Columns> <DataGridTextColumn Binding="{Binding TB_UNIDADE.DS_NOME_UNIDADE}" CanUserResize="False" Header="Setor" IsReadOnly="True" x:Name=""/> <DataGridTextColumn Binding="{Binding TB_UNIDADE.TB_UNIDADE2.DS_NOME_UNIDADE}" CanUserResize="False" Header="Unidade" IsReadOnly="True" x:Name=""/> <DataGridTextColumn Binding="{Binding TB_CONTATOS.DS_NOME}" CanUserResize="False" Header="Gestor" IsReadOnly="True" /> </DataGrid.Columns> </DataGrid> The problem is that i need to verify if the 2 column binding is null, and if it is null, i need to Hide it, and Change the Header of the column 1. I know that i can do that with Triggers, but how exactly??? I started with: <DataGrid.Triggers> <DataTrigger Binding="{Binding TB_UNIDADE.TB_UNIDADE2}" Value="{x:Null}"> <Setter Property="" Value="" /> </DataTrigger> </DataGrid.Triggers> But i don't know what setter or whatever to put ! Help me =]

    Read the article

  • Trigger event on click except for checkbox + label

    - by Jamaica Bob
    I have a table row, which triggers an event when clicked. There are (not displayed) checkbox + its styled label inside the row. What i want is to prevent (i guess with :not or .not() but cant figure it out) the execution if checkbox/label is clicked. HTML: <center> <table> <tr class='pend'> <td><input type="checkbox" id="bb"/> <label for="bb">X</label></td> <td>&nbsp;</td> <td>some text</td> </tr> </table> </center> CSS: center { margin-top:20px; } input[type=checkbox] + label { width:10px; height:10px; background-color:red; } input[type=checkbox] { display:none; } table tr { height:40px; background-color:gray; } table td { padding:5px; } JS: $('.pend').on('click',function(){ $(this).append('text'); return false; }) JSFIDDLE: http://jsfiddle.net/ySuGB/2/

    Read the article

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