Search Results

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

Page 161/1134 | < Previous Page | 157 158 159 160 161 162 163 164 165 166 167 168  | Next Page >

  • Testing custom constraints in Grails App

    - by WaZ
    Hi there, I have the following as my unit test: void testCreateDealer() { mockForConstraintsTests(Dealer) def _dealer= new Dealer( dealerName:"ABC", Email:"[email protected]", HeadOffice:"", isBranch:false) assertFalse _dealer.validate() } But when I run the test I get the following error: No signature of method: static com.myCompany.Dealer.findByDealerNameIlike() is applicable for argument types: (java.lang.String) values: [ABC] I use some custom constraints in my domain class. How Can I test this? static constraints = { dealerName(blank:false, validator: { val, obj -> def similarDealer = Dealer.findByDealerNameIlike(val) return !similarDealer || (obj.id == similarDealer.id) } )

    Read the article

  • Create a custom menu for BlackBerry

    - by Dachmt
    Hi I'm a beginner in BlackBerry programming, I need to replace in my application the default menu (when you press the menu button) by a custom menu, horizontal. The best to describe is I want the same result as the WeatherEye application for BlackBerry... I know how to create the default menu, but this one I have no idea! Thank you,

    Read the article

  • Extending Visual Studio with a Custom Designer

    - by Mick
    How do I create a custom Visual Studio 2008 UI designer for a C# file? For example, when you double click on a DataSet in the Solution Explorer, a UI screen appears that allows you to edit the DataSet, even though it is defined in XML/code (which you can right click and "View Code"). Usually this code is separated from user code in some way, either by region ("Windows Forms Designer Generated Code"), by codegen (".g.cs" for WPF XAML files), or some other means like partial classes.

    Read the article

  • as3 custom functions

    - by pixeltocode
    hi, i'm new to AS3. how do i go about executing a custom function n number of times and then executing another function n number of times repeatedly? eg. function firstOne():void { } function secondOne():void { } i need firstOne() executed say 3 times and then secondOne() 3 times and then firstOne 3 times again and so on. thanks

    Read the article

  • onchange event is not woking

    - by Jim
    Hello guys, Whats wrong with this code? My first function working fine but second function is not working. Please help me. Thanks function bag1() { var sum = 0; var qty = document.form1.qty.value; var pack = document.form1.pack.value; document.form1.bag.value = (qty*pack)/100; } function bag2() { var sum = 0; var qty = document.form1.qty.value; var pack1 = document.form1.pack1.value; document.form1.bag1.value = (qty*pack1)/100; } Here is HTML code <input id="item1" name="item1" type="text" maxlength="255" value=""/> <input type="text" maxlength="255" value=""/> <input id="weight" name="weight" type="text" maxlength="255" value=""/> <input id="pack" name="pack" type="text" maxlength="255" onchange="bag1();" value=""/> <input id="bag" name="bag" type="text" maxlength="255" value=""/> <input id="rate" name="rate" type="text" maxlength="255" value=""/> <input id="amount" name="amount" type="text" maxlength="255" value=""/> <input id="element_12" name="type" type="text" maxlength="255" value=""/> <input id="element_13" name="brand" type="text" maxlength="255" value=""/> <!-------------------------- Caculating 2th Row ---------------------------------------------------------------> <input type="text" maxlength="255" value=""/> <input type="text" maxlength="255" value=""/> <input id="weight2" name="weight2" type="text" maxlength="255" value=""/> <input id="pack2" name="pack2" type="text" maxlength="255" value=""/> <input id="bag2" name="bag2" type="text" maxlength="255" onchange="bag2();" value=""/> <input id="rate2" name="rate2" type="text" maxlength="255" value=""/> <input id="amount2" name="amount2" type="text" maxlength="255" value=""/> <input id="element_12" name="type" type="text" maxlength="255" value=""/> <input id="element_13" name="brand" type="text" maxlength="255" value=""/> </form type="submit" value="calculator2">

    Read the article

  • Global javascript variable not accessible in jquery change event

    - by Dan
    I have to be missing something simple, but I'm really not sure what. I'm not a JS veteran, so this may be an easy answer - sure hope so :). I have a button that, when clicked, gets JSON data. When a drop-down is changed, I check to see if there is data, if there is, I want to clear it out as the drop-down indicates what data to retrieve when the button is clicked The Code: var selected, $locDialog; var locations = []; $(function() { // Save the selected Name selected = $("#selected option:selected").val(); // Setup Dialog for Locations $locDialog = $('#location-dialog').dialog({ autoOpen: false }); // If user changes the selected // 1. Prompt for confirmation // 2. If users confirms, clear data $('#selected').change(function() { if (locations) { var confirmed = confirm("Oh Rly?"); if (confirmed) { // Clear data var locations; } } }); // When user clicks "Location" Button.. $('.loc-select button').click(function() { if (!locations) { $.getJSON("/Controller/JSONAction", { selectedId: selected, pageNum: 1, pageSize: 100 }, function(data) { locations = data; $.each(locations, function(index, loc) { var $tr = $('<tr/>') .append($('<td/>') .append('<input type="checkbox" name="TEST-'+index+'" value="'+loc.Id+'"/>')) .append('<td>' + loc.Name + '</td>'); $("#location-dialog table tbody").append($tr); }); }); } $locDialog.dialog('open'); return false; }); }); Here's the thing, Inside the .click(...) callback, I can see locations is []. Now, when I am in the .change(...) callback, I see locations is undefined. Any help/insight, as always, is appreciated!

    Read the article

  • Saving data in custom class via AppDelegate

    - by redspike
    I can't seem to save data to a custom instance object in my AppDelegate. My custom class is very simple and is as follows: Person.h ... @interface Person : NSObject { int _age; } - (void) setAge: (int) age; - (int) age; @end Person.m #import "Person.h" @implementation Person - (void) setAge:(int) age { _age = age; } - (int) age { return _age; } @end I then create an instance of Person in the AppDelegate class: AppDelegate.h @class Person; @interface AccuTaxAppDelegate : NSObject <UIApplicationDelegate> { ... Person *person; } ... @property (nonatomic, retain) Person *person; @end AppDelegate.m ... #import "Person.h" @implementation AccuTaxAppDelegate ... @synthesize person; - (void)applicationDidFinishLaunching:(UIApplication *)application { // Override point for customization after app launch [window addSubview:[navigationController view]]; [window makeKeyAndVisible]; } - (void)applicationWillTerminate:(UIApplication *)application { // Save data if appropriate } #pragma mark - #pragma mark Memory management - (void)dealloc { [navigationController release]; [window release]; [person release]; [super dealloc]; } @end Finally, in my ViewController code I grab a handle on AppDelegate and then grab the person instance, but when I try to save the age it doesn't seem to work: MyViewController ... - (void)textFieldDidEndEditing:(UITextField *)textField { NSString *textAge = [textField text]; int age = [textAge intValue]; NSLog(@"Age from text field::%i", age); AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; Person *myPerson = (Person *)[appDelegate person]; NSLog(@"Age before setting: %i", [myPerson age]); [myPerson setAge:age]; NSLog(@"Age after setting: %i", [myPerson age]); [textAge release]; } ... The output of the above NSLogs are: [Session started at 2010-05-04 18:29:22 +0100.] 2010-05-04 18:29:28.260 AccuTax[16235:207] Age in text field:25 2010-05-04 18:29:28.262 AccuTax[16235:207] Age before setting: 0 2010-05-04 18:29:28.263 AccuTax[16235:207] Age after setting: 0 Any ideas why 'age' isn't being stored? I'm relatively new to Obj-C so please forgive me if I'm missing something very simple!

    Read the article

  • FormsAuthentication, can I create a custom cookie?

    - by Blankman
    When the browser closes, I want the session to end = logged out. The FormAuthenticationTicket class doesnt' have a overload that is suitable for me. I don't want to set the expires property, so when the user closes the browser it logs him out. But I need: version, Name, UserData So I guess I have to create my own cookie? is there a way to create a custom cookie, but still uses forms authentication to encrypt and decrypt things?

    Read the article

  • How to make groupbox invisble on select of a radiobutton

    - by Aditya
    Hi, I am doing an Windows Application using XAML ,WPF in C#. I have 2 radio buttons called "WriteData" and "ReadData". when writeData is selected, I need groupbox with a textbox and browse button inside it to be displayed at a particular location, (this i have already designed in UI..) <GroupBox Header="Browse Data" Name="grpBrowseData" Height="78" VerticalAlignment="Top" HorizontalAlignment="Left" Width="1030"> <Grid Name="grdBrowse" Height="60" Width="1030"> <Button x:Name="btnBrowseButton" Margin="0,7.5,45,20" Content="Browse" Click="BrowseButton_Click" HorizontalAlignment="Right" Width="111" /> <TextBox x:Name="txtBxBrowseTB" Margin="46,13.993,185,17.5" Text="TextBox" TextWrapping="Wrap" TextChanged="BrowseTB_TextChanged" ></TextBox> <Label HorizontalAlignment="Left" Margin="-1.25,8.75,0,15" Name="label1" Width="47.5" FontSize="13" VerticalContentAlignment="Center" HorizontalContentAlignment="Center">Path:</Label> Now, if I select "ReadData" radio button, a combo box should be visible in the SAME LOCATION where the above groupbox is displayed, the xaml code for this <GroupBox Header="Select the Project" Name="grpSelectProject" Height="78" VerticalAlignment="Top" HorizontalAlignment="Left" Width="1030" Visibility="Visible" Margin="-1030,0,0,0"> <Grid Name="grdSelectProject" Height="60" Width="1030"> <Label HorizontalAlignment="Left" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="0,11.662,0,20.825" Width="95.103">Select the Project</Label> <ComboBox Margin="119.952,13.994,493.969,16.66"></ComboBox> </Grid></GroupBox> so, how do I make only one visible as per the radio button selected. In the ReadData_click event i tried to make other groupbox invisble. but I wasnt able to do that. please help me. Thanks Ramm

    Read the article

  • Set Custom/default font in Gmail

    - by Rishi
    Gmail does not let me set my default font settings Is there a shortcut to use a font which I use regularly? Adjusting Font type and size in every email is a laborious job. EDIT: Any feature involving very few clicks will do (should not be dependent on any other application)

    Read the article

  • Change post permalink structure on WordPress to use custom taxonomy

    - by TiuTalk
    Hi there! I want to change the post permalink schema on my WordPress 3.0-beta1 to use my new custom taxonomy. Today I can use /%category%/%postname%/ and the /my-category/my-post/ URL, that's nice but I need to use another taxonomy instead "category" one. I tried to use /%acervo%/%postname%/ but my URLs came with %acervo% on the URL instead the name of the "Acevo" (my taxonomy name) wich the post belongs to. I found something related to WP_Rewrite but without sucess...

    Read the article

  • Detecting the onload event of a window opened with window.open

    - by Chris T
    window.popup = window.open($(this).attr('href'), 'Ad', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); $(window.popup).onload = function() { alert("Popup has loaded a page"); }; This doesn't work in any browser I've tried it with (IE, Firefox, Chrome). How can I detect when a page is loaded in the window (like an iframe onload)?

    Read the article

  • How to check is custom protocol supported

    - by Piotr Pankowski
    We are using software that registers its own protocol. We can run application from browser then by link like: customprotocol://do_this. but is there a way to check is such custom protocol supported by user`s system? If not we would like to ask user to install software first. E.g. if (canHandle ('customprotocol')) { // run software } else { // ask to install }

    Read the article

  • How to make a form using ajax, onchange event, reload to SAME page

    - by user1348220
    I've been studying this for a while and I'm not sure if I'm going about this the right way because every form I setup according to examples, it doesn't do what I need. I need to setup a form that will: set session when you select from dropdown menu not reload/refresh page (i've read that using AJAX solves this) submit and stay on SAME page (confused because most AJAX examples send it to different process.php page which is supposedly "invisible" but it doesn't "stay" on the same page, it redirects. Basically, client selects quantity of 1 to 10. If they select "2"... it does NOT reload the page.. but it DOES set a session[quantity]=2. Should be simple... but do I POST to same page as form? or POST to different page and it somehow redirects? Also, one test I did it kept pasting my "echo session[quantity]" down the page like 7, 2, 3, 5, etc. etc. each time instead of replacing it. I would paste code but it's all over the place and I'm hoping for direction on which methods to use. Feel I need to start all over again. Edit: trying to add code below but can't seem to paste it properly. <? ob_start();?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <?php session_start(); ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Submit Form with out refreshing page Tutorial</title> <!-- JavaScript --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script> <script type="text/javascript" > $(function() { $(".submit").click(function() { var gender = $("#gender").val(); var dataString = '&gender=' + gender; if(gender=='') { $('.success').fadeOut(200).hide(); $('.error').fadeOut(200).show(); } else { $.ajax({ type: "POST", url: "join.php", data: dataString, success: function(){ $('.success').fadeIn(200).show(); $('.error').fadeOut(200).hide(); } }); } return false; }); }); </script> <style type="text/css"> body{ } .error{ color:#d12f19; font-size:12px; } .success{ color:#006600; font-size:12px; } </style> </head> <body id="public"> <div style="height:30px"></div> <div id="container"> <div style="height:30px"></div> <form method="post" name="form"> <select id="gender" name="gender"> <option value="">Gender</option> <option value="male">Male</option> <option value="female">Female</option> </select> <div> <input type="submit" value="Submit" class="submit"/> <span class="error" style="display:none"> Please Enter Valid Data</span> <span class="success" style="display:none"> Your gender is <?php echo $_SESSION['gender'];?></span> </div> </form> <div style="height:20px"></div> </div><!--container--> </body> </html> <? ob_flush(); ?> and here is my page where the POST goes called join.php (called that in example so I went with it for now) <?php session_start(); if($_POST) { $gender = $_POST['gender']; $_SESSION['gender'] = $gender; } else { } ?>

    Read the article

  • Django Piston - how can I create custom methods?

    - by orokusaki
    I put my questions in the code comments for clarity: from piston.handler import AnonymousBaseHandler class AnonymousAPITest(AnonymousBaseHandler): fields = ('update_subscription',) def update_subscription(self, request, months): # Do some stuff here to update a subscription based on the # number of months provided. # How the heck can I call this method? return {'msg': 'Your subscription has been updated!'} def read(self, request): return { 'msg': 'Why would I need a read() method on a fully custom API?' }

    Read the article

  • Steps to deploy a custom routing protocol

    - by user134589
    I'm a Ph.D Student and I'm researching a Service Centric Networking architecture with resourceallocation on a large scale. What I'm looking to do is expand an existing routing protocol like OSPF with extra fields and some new message types that I need for communication between Nodes. I want to manipulate the cost of a network link and I want paths to be calculated like in OSPF V2/v3, but using the cost that my algorithms have calculated. What I have I have the source code of OSPF from Quagga. I am assuming I can edit this code how I want, including packet structures and creating new types. Yes, I am aware it won't be easy but this is a 6 years research project and I am eager to develop something new, to move forward. What I need I would like to know how I can deploy the edited OSPF source files I have (written in C) on any type of server. I have a large testbed environment available with hundreds of virtual nodes and pretty much any OS out there. So if I want to test my extended protocol, how do I make all the nodes in a network use this to communicate? I do not understand what parts of the kernel I need to edit here. I tried searching for days now and I am unable to find how to deploy a non-existing routing protocol, without the use of an application-level framework. If somebody could push me in the right direction that'd be awesome. note: I need this to be a routingprotocol and not an application, since I want this to work on op of the network layer for performance reasons. Thanks!

    Read the article

  • Change of a background image of a button on onclick event

    - by Alpan67
    Why does this not work ? In Firebug, when I click on the button, it always says to me that cambiaBandiera is not defined ... HELP Alex CSS ITA{ float:right; margin : 5px 85px; width:40px; height:40px; background : #FFFFFF url("../ITA_off.png") center center no-repeat; border:0; } JAVASCRIPT (in HEAD) style type="text/javascript" function cambiaBandiera() { test=document.getElementById("ITA"); test.style.backgroundImage="url('../ITA_on.png')"; } /style and this is HTML div id="bandiere" input type="button" id="ITA" onClick="cambiaBandiera()" /input /div

    Read the article

  • Updating with using custom class collection not working

    - by Risho
    I've posted this yesterday on asp forum but no one replied so perhaps I'll have better luck here. For some reason the OnUpdating method does not pull new values from the grid which is in edit mode. I've search and have come across several blogs and sites, some sugesting that an ObjectDataSource is required in order to use the "e.NewValue" construct others provide code to the contrary. I don't get any errors - the variables in the code file would contain the old values rather then new ones. I don't want to use the ODS way of manipulating the data. My delete method works but not the update one. Can you suggest what is wrong with the code? Here is what I've got: aspx file: <asp:GridView ID="gvBlack" runat="server" AutoGenerateColumns="False" OnRowUpdating="gvBlack_OnUpdating" OnRowEditing="gvBlack_RowEditing"> <Columns> <%--<asp:BoundField DataField="Ident_Black" ReadOnly="True" visible="false" />--%> <asp:TemplateField ItemStyle-Width="1px"> <EditItemTemplate> <asp:Label ID="lblIdent_Black" runat="server" Text='<%# Bind("Ident_Black") %>' Visible="false" /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Model" > <ItemTemplate> <asp:Label ID="lblModel_Black" runat="server" Text='<%# Bind("Model_Black") %>' width="130px" /> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtModel_Black" runat="server" Text='<%# Eval("Model_Black") %>' width="100px" /> <asp:RequiredFieldValidator ID="rfvModel_Black" runat="server" ControlToValidate="txtModel_Black" SetFocusOnError="true" ErrorMessage="*" ValidationGroup="CurrentMfg" ForeColor="Red" Font-Bold="true" /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Description" > <ItemTemplate> <asp:Label ID="lblDesc_Black" runat="server" Text='<%# Bind("Desc_Black") %>' width="200px" /> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtDesc_Black" runat="server" Text='<%# Eval("Desc_Black") %>' width="170px" /> <span></span> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Qty" > <ItemTemplate> <asp:Label ID="lblQty_Black" runat="server" Text='<%# Bind("Qty_Black") %>' width="35px" /> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtQty_Black" runat="server" Text='<%# Eval("Qty_Black") %>' width="35px" /> <asp:RequiredFieldValidator ID="rfvQty_Black" runat="server" ControlToValidate="txtQty_Black" SetFocusOnError="true" ErrorMessage="*" ValidationGroup="CurrentMfg" ForeColor="Red" Font-Bold="true" /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Reorder<br />Limit"> <ItemTemplate> <asp:Label ID="lblBlack_Reorder_Limit" runat="server" Text='<%# Bind("Black_Reorder_Limit") %>' width="35px" /> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtBlack_Reorder_Limit" runat="server" Text='<%# Eval("Black_Reorder_Limit") %>' width="35px" /> <asp:RequiredFieldValidator ID="rfvBlack_Reorder_Limit" runat="server" ControlToValidate="txtBlack_Reorder_Limit" SetFocusOnError="true" ErrorMessage="*" ValidationGroup="CurrentMfg" ForeColor="Red" Font-Bold="true" /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Notes"> <ItemTemplate> <asp:Label ID="lblNotes" runat="server" Text='<%# Bind("Notes") %>' width="200px" /> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtNotes" runat="server" Text='<%# Eval("Notes") %>' width="170px" /> <span></span> </EditItemTemplate> </asp:TemplateField> <asp:CommandField ShowEditButton="True" ShowDeleteButton="false" ValidationGroup="CurrentToner" /> </Columns> </asp:GridView> aspx.cs file: protected void Page_Load(object sender, EventArgs e) { LoadData_TonerBlack(); } private void LoadData_TonerBlack() { dalConsumables_TonerBlack drTonerBlack = new dalConsumables_TonerBlack(); gvBlack.DataSource = drTonerBlack.GetListTonersBlack(); gvBlack.DataBind(); } protected void gvBlack_OnUpdating(object sender, GridViewUpdateEventArgs e) { //GridView gvBlack = (GridView)sender; //GridViewRow gvBlackRow = (GridViewRow)gvBlack.Rows[e.RowIndex]; int _Ident_Black = Convert.ToInt32(gvBlack.DataKeys[e.RowIndex].Values[0].ToString()); TextBox _txtModel_Black = (TextBox)gvBlack.Rows[e.RowIndex].FindControl("txtModel_Black"); TextBox _txtDesc_Black = (TextBox)gvBlack.Rows[e.RowIndex].FindControl("txtDesc_Black"); TextBox _txtQty_Black = (TextBox)gvBlack.Rows[e.RowIndex].FindControl("txtQty_Black"); TextBox _txtBlack_Reorder_Limit = (TextBox)gvBlack.Rows[e.RowIndex].FindControl("txtBlack_Reorder_Limit"); TextBox _txtNotes = (TextBox)gvBlack.Rows[e.RowIndex].FindControl("txtNotes"); string _updatedBy = Request.ServerVariables["AUTH_USER"].ToString(); dalConsumables_TonerBlack updateTonerBlack = new dalConsumables_TonerBlack(); updateTonerBlack.UpdateTonerBlack(_Ident_Black, _txtModel_Black.Text, _txtDesc_Black.Text, Convert.ToInt32(_txtQty_Black.Text), Convert.ToInt32(_txtBlack_Reorder_Limit.Text), _txtNotes.Text, _updatedBy); gvBlack.EditIndex = -1; LoadData_TonerBlack(); } protected void gvBlack_RowEditing(object sender, GridViewEditEventArgs e) { gvBlack.EditIndex = e.NewEditIndex; LoadData_TonerBlack(); } Thanks in advance! Risho

    Read the article

  • Can I set a Custom Icon for a jQueryUI Button

    - by Boycs
    Is it possible to create a jQueryUI Button with a custom icon, ie: an icon that is not part of the sprite icons that are provided with jQueryUI??? I am using the ButtonSet functionality for a group of 3 checkboxes but need a more stylised icon than what is provided out of the box...

    Read the article

  • Best way to store weekly event in MySQL?

    - by mazin k.
    I have a table of weekly events that run on certain days of the week (e.g. MTWTh, MWF, etc.) and run on a certain time (e.g. 8am-5pm). What's the best way to store day of week information in MySQL to make retrieving and working with the data easiest? My CakePHP app is going to need to retrieve all events happening NOW(). For time of day, I would just use TIME. For days of the week, I had considered a 7-bit bitfield, a varchar ("MTWThFr" type deal) for the days of the week, but both of those seem like clunky solutions (the varchar being clunkier). Any suggestions?

    Read the article

  • Ant XML Custom Result Formatter

    - by Iso
    Hi, Can anyone point me the tutorial for step by step creating my onw XML custom result formatter. I read that we can create our own result formatter by specifying the XSLT in styledir. I want to know what should specify in XSLT, like the xml tag for testsuite name, testcase name and the result. Thanks in advance

    Read the article

< Previous Page | 157 158 159 160 161 162 163 164 165 166 167 168  | Next Page >