Search Results

Search found 24177 results on 968 pages for 'true gritt'.

Page 8/968 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • How do I pass struts2 <s:select multiple="true"> with a Map

    - by deepblue
    I have an bean placed on my action Event.java, the action is Called ManageEvents. I would like the user to be able to add to a struts2 multiple select form field and create a list or map of items (in this case Map where the data would be . <struts2:select name="event.dj_map" label="Add DJs To Your Event" list="event.dj_map" listsize="5" multiple="true" headerKey="headerKey" required="true" headerValue="--- Please Select ---"> So ultimately I would like to know how to pass a mult. select field (e.g. Events.dj_map) as a map of name,value pairs to an object (e.g. Event.java) set on the action (e.g. ManageEvents.java).

    Read the article

  • Using True and False to select items to print

    - by user1753915
    I have a workbook that contains rows of information that needs to printed to a seperate worksheet in excel. I am trying to utilize a checkbox to indicate which items need to print and which items need to be skipped. The checkbox is located in column "A" and once checked and the macro ran, I want it to pick up the data in each cell of that particular row, transfer it a seperate worksheet (form), prompt and save the worksheet to pdf, clear the form, and then return to the main worksheet to continue until all rows have been checked. However, right now, my code is only looping through the very first "TRUE" statement and not continuing to the rest. Here is the code: Private Sub CommandButton1_Click() On Error GoTo ErrHandler: Dim i As Integer For i = 1 To 10 If ActiveSheet.OLEObjects("CheckBox" & i).Object.Value = False Then Else If ActiveSheet.OLEObjects("CheckBox" & i).Object.Value = True Then Call PrintWO Else End If Do Until ActiveSheet.OLEObjects("CheckBox" & i).Object.Value = 10 MsgBox "Nothing Selected to Print" Exit Do Exit Sub Loop End If Next i ErrHandler: End Sub

    Read the article

  • Android SharedPreferences set True or False - Clear on App Exit

    - by KickingLettuce
    I want a notification to pop up when an app opens. But once User dismisses, I don't want it to come back again, even if they go back to the same activity. But when the app exits, and they come back later, I want same dialog notification to pop up (prompting user to login). So basically... boolean b = true; if (b == true) { // show dialog b = false; } I simply want var b to save state but clear on exit.

    Read the article

  • When is (true == x) === !!x false?

    - by Paul S.
    JavaScript has different equality comparison operators Equal == Strict equal === It also has a logical NOT ! and I've tended to think of using a double logical NOT, !!x, as basically the same as true == x. However I know this is not always the case, e.g. x = [] because [] is truthy for ! but falsy for ==. So, for which xs would (true == x) === !!x give false? Alternatively, what is falsy by == but not !! (or vice versa)?

    Read the article

  • Testing a SQL Query for True or False

    - by KickingLettuce
    $sql = "SELECT # FROM users WHERE onduty = 1 AND loc_id = '{$site}';"; $result = mysql_query($sql); I simply want to test if this is true or false. If it returns 0 rows, I want next line to be something like: if (!$result) { //do this; } However, in my test, I am getting false when I know it should be true. Is this sound logic here? (note, yes I know I should be using mysqli_query, that is not what I am asking here)

    Read the article

  • jQuery clone( true ) not working with dynamic elements

    - by elclanrs
    Take the following example: $.fn.foo = function() { var $input = $('<input type="text"/>'); var $button_one = $('<button>One</button>'); var $button_two = $('<button>Two</button>'); $button_one.click(function(){ $input.val('hey'); }); $button_two.click(function(){ $input.replaceWith( $input.val('').clone( true ) ); }); this.append($input, $button_one, $button_two); }; Check the demo: http://jsbin.com/ezexah/1/edit Now click "one" and you should see "hey" in the input. Next click "two" and then click "one" again and it doesn't work. Even using the true option in clone to copy all events it still does not work. Any ideas?

    Read the article

  • Only get the value if a condition is true

    - by Autolycus
    I am checking to see if element1, element 2 or element 3 exists and then add them to finalData if they exist. However if one of those dont exist or are not true then I just want to add the elements whose bool value is true! Below is my code bool hasElement1 = ( from Playlist in loaded.Descendants("Node") select Playlist.Descendants("Element1").Any() ).Single(); bool hasElement2 = ( from Playlist in loaded.Descendants("Node") select Playlist.Descendants("Element2").Any() ).Single(); bool hasElement3 = ( from Playlist in loaded.Descendants("Node") select Playlist.Descendants("Element2").Any() ).Single(); var finalData = from x in loaded.Descendants("Node") select new { Element1 = x.Descendants("Element1").First().Value, Element2 = x.Descendants("Element2").First().Value, Element3 = x.Descendants("Element3").First().Value, };

    Read the article

  • .NET Reference "Copy Local" True / False Being Set Based on Contents of GAC

    - by D-Sect
    We had a very interesting problem with a Win Forms project. It's been resolved. We know what happened, but we want to understand why it happened. This may help other people out in the future who have a similar problem. The WinForms project failed on 2 of our client's PCs. The error was an obscure kernel.dll error. The project ran fine on 3 other PCs. We found that a .DLL (log4net.dll - a very popular open-source logging library) was missing from our release folder. It was previously in our release folder. Why was it missing in this latest release? It was missing because I must have installed a program on my Dev box that used log4net.dll and it was added to the Global Assembly Cache. When I checked the solution's references for log4net.dll, they were changed to "copy local=FALSE". They must have changed automatically because log4net.dll was present in my GAC. Here's where my question starts: Why did my reference for log4net.dll get changed from COPY LOCAL = TRUE to COPY LOCAL = FALSE? I suspect it's because it was added to my GAC by another program. How can we prevent this from happening again? As it stands now, if I install a piece of software that uses a common library and it adds it to my GAC, then my SLNs that reference that DLL will change from Copy Local TRUE to FALSE.

    Read the article

  • DOM: element created with cloneNode(true) missing element when added to DOM

    - by user149327
    I'm creating a tree control and I'm attempting to use a parent element as a template for its children. To this end I'm using the element.cloneNode(true) method to deep clone the parent element. However when I insert the cloned element into the DOM it is missing certain inner elements despite having an outerHTML value identical to its parent. Surprisingly I observe the same behavior is in IE, Firefox, and Chrome leading me to believe that it is by design. This is the HTML for the node I'm attempting to clone. <SPAN class=node><A class=nodeLink href="/SparklerRestService2.aspx?q={0}" name=http://dbpedia.org/data/Taylor_Swift.rdf> <IMG class=nodeIcon alt="Taylor Swift" src="images/node.png"><SPAN class=nodeText>Taylor Swift</SPAN></A><SPAN class=nodeDescription>Taylor Swift is a swell gall who is realy great.</SPAN></SPAN> Once I've cloned the node using cloneNode(true) I examine the outerHTML property and find that it is indeed identical to the original. <SPAN class=node><A class=nodeLink href="/SparklerRestService2.aspx?q={0}" name=http://dbpedia.org/data/Taylor_Swift.rdf><IMG class=nodeIcon alt="Taylor Swift" src="images/node.png"><SPAN class=nodeText>Taylor Swift</SPAN></A><SPAN class=nodeDescription>Taylor Swift is a swell gall who is realy great.</SPAN></SPAN> However when I insert it into the DOM and inspect the result using FireBug I find that the element has been transformed: <span class="node" style="top: 0px; left: 0px;"<a class=nodeLink href="/SparklerRestService2.aspx?q={0}" name=http://dbpedia.org/data/Taylor_Swift.rdf>Taylor Swift</a><span class="nodeDescription">It's great</span></span> Notice that the grandchildren of the node (the image tag and the span tag surrounding "Taylor Swift") are missing, although strangely the great grandchild "Taylor Swift" text node has made it into the tree. Can anyone shed some light on this behavior? Why would nodes disappear after insertion into the DOM, and why am I seeing the same result in all three major browser engines?

    Read the article

  • .NET Reference "Copy Local" True / Fasle Being Set Based on Contents of General Assembly

    - by D-Sect
    Hello All. First question for me here. We had a very interesting problem with a Win Forms project. It's been resolved. We know what happened, but we want to understand why it happened. This may help other people out in the future who have a similar problem. The WinForms project failed on 2 of our client's PCs. The error was an obscure kernel.dll error. The project ran fine on 3 other PCs. We found that a .DLL (log4net.dll - a very popular open-source logging library) was missing from our release folder. It was previously in our release folder. Why was it missing in this latest release? It was missing because I must have installed a program on my Dev box that used log4net.dll and it was added to the general assembly. When I checked the SLN's references for log4net.dll, they were changed to "copy local=FALSE". They must have changed automagicially because log4net.dll was present in my GAC. Here's where my question starts: Why did my reference for log4net.dll get changed from COPY LOCAL = TRUE to COPY LOCAL = FALSE? I suspect it's because it was added to my GAC by another program. How can we prevent this from happening again? As it stands now, if I install a piece of software that uses a common library and it adds it to my GAC, then my SLNs that REF that DLL will change from Copy Local TRUE to FALSE. Thank you so much. I hope this helps people out who have a piece of software that runs in some places, but not in others, when it used to run fine in ALL places.

    Read the article

  • "Cannot open user default database" error with "User Instance=True"

    - by Keith
    I have a desktop application that uses Sql user instancing. This is my connection string: "Data Source=.\SqlExpress; AttachDbFilename=C:\path\file.mdf; Integrated Security=True; User Instance=True; Connect Timeout=100;" My application creates this DB, downloads a load of data into it from a web service and then does a lot of actions with it. The problem comes when I attempt to re-open the connection. I get a SqlException: "Cannot open user default database. Login failed. Login failed for user 'myDomain\myusername'." This error makes no sense in this context - I have no default database. I'm logging in to an instance created just for the current application, running separately from SqlExpress. There's no other way to connect to this DB. If I start the SqlExpress service and connect to the default instance it won't be visible. It only exists for this application. The file on disk is locked by the SqlExpress instance service running under the application. if I stop the app and restart it the connection works first time, but fails on re-opening. If I just stop the app I can delete the .mdf files and begin again, but it still crashes when I re-open the connection. As my app started the instance running as me my current user should have access to every DB in the instance. This doesn't happen for other users of the same code, which suggests that it's a SQL config issue. Does anyone have any idea what causes this and how to work around it?

    Read the article

  • SQL Server 2008 - Editing Tables: Bit columns require 'True' or 'False'

    - by CJM
    Not so much a question as an observation... I'm just upgrading to SQL Server 2008 on my development machine in anticipation of upgrading my live applications. I didn't anticipate any problems since [I think] I generally use standard T-SQL, and probably not too far from ANSI standard SQL. So far so good, but I was really thrown by a very simple change: I was creating a simple, small look-up table to store a list of codes and including a bit column to indicate the current default code. But when I used the new/modified 'Edit Top 200 Rows' option, and entered my 0s and 1s in the the bit column I got an error: 'Invalid value for cell - String was not recognised as a valid boolean' After a bit of head-scratching, I tried True and False - and they worked. So it seems this new Edit feature requires 4 or 5 characters to be typed, rather than the previous 1. Checking further, we can still use '...where bitval = 1' but can now also use '...where bitval = 'true''. But any results returned render these bit columns as 0 or 1 still. It all sounds like half a step backwards. Not the end of the world, but and unnecessary annoyance. Does anybody have any insight on this issue? Or there any other new Gotchas with SQL Server 2008?

    Read the article

  • documentFragment.cloneNode(true) doesn't clone jQuery data

    - by taber
    I have a documentFragment with several child nodes containing some .data() added like so: myDocumentFragment = document.createDocumentFragment(); for(...) { myDocumentFragment.appendChild( $('').addClass('button') .attr('href', 'javascript:void(0)') .html('click me') .data('rowData', { 'id': 103, 'test': 'testy' }) .get(0) ); } When I try to append the documentFragment to a div on the page: $('#div').append( myDocumentFragment ); I can access the data just fine: alert( $('#div a:first').data('rowData').id ); // alerts '103' But if I clone the node with cloneNode(true), I can't access the node's data. :( $('#div').append( myDocumentFragment.cloneNode(true) ); ... alert( $('#div a:first').data('rowData').id ); // alerts undefined Has anyone else done this or know of a workaround? I guess I could store the row's data in jQuery.data('#some_random_parent_div', 'rows', [array of ids]), but that kinda defeats the purpose of making the data immediately/easily available to each row. I've also read that jQuery uses documentFragments, but I'm not sure exactly how, or in what methods. Does anyone have any more details there? Thanks!

    Read the article

  • TextBox doesn't fire TextChanged Event on IE 8, AutoPostback is true

    - by MaikoID
    Hi guys, I have the same thing, there are many TextBoxes with the event TextChanged set and with AutoPostback = true, and works in all browsers (Chrome, Opera, Firefox 3.6) except in IE 8, IE 6/7 I didn't test. I don't want to put the onblur event in all my TextBoxs because there are many pages with many TextBox that use this event. Description I'm using a masterPage, in the aspx i have <asp:TextBox ID="txtCnpj" runat="server" CssClass="txt" Width="200px" onkeyup="Mascara(this,Cnpj)" onkeydown="Mascara(this,Cnpj)" MaxLength="18" AutoPostBack="true" ValidationGroup="txtCnpj" OnTextChanged="txtCnpj_TextChanged"></asp:TextBox> in the aspx.cs protected void txtCnpj_TextChanged(object sender, EventArgs e) { if (CredorInvestimento.GetCredorInvestimento(txtCnpj.Text) != null) { ((TextBox)sender).Text = ""; ((TextBox)sender).Focus(); rfvCnpj.ErrorMessage = "Duplicado"; Page.Validate(txtCnpj.ID); } else txtNome.Focus(); } Thanks! ps: I really doesn't like of asp.net I spend more time fixing errors than developing new functions. ps: sorry for my english. ps: if i remove the onkeydown and onkeyup events the textchanged fire in IE, but i realy this events too.

    Read the article

  • Why is button background defaulting to grey when IsPressed is true

    - by Dave Colwell
    Hey all, I have a simple problem. Using the IsPressed trigger i want to be able to set the background color of a button to something other than the default grey. Here is what the button looks like when it is not pressed and here is what it looks like when it is clicked Here is the trigger for the button. I know the trigger is firing correctly because of the glow effect around the edge of the button when it is clicked. I also know that the brush is correct because i tried it out as a background brush to see what it looked like. <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Background" Value="{DynamicResource ButtonHoverBrush}"/> <Setter Property="BitmapEffect" Value="{DynamicResource ButtonHoverGlow}"/> </Trigger> <!-- This is the trigger which is working but the background color wont change --> <Trigger Property="IsPressed" Value="True"> <Setter Property="BitmapEffect" Value="{DynamicResource ButtonHoverGlow}"/> <Setter Property="Background" Value="{DynamicResource ButtonPressedBrush}" /> </Trigger> </Style.Triggers>

    Read the article

  • Why is OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true) causing an OCR running error?

    - by Ian Wells
    Hi folks, I am using MODI to read tiff images and do what I need to do with the text. Some images work fine and then other tiff images always cause the method, OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true) to fail. I have researched this and tried different variations such as 'false','false' in the parameter list. I have also tried SYSDEFAULT instead of English but I still get the error. Can anyone please tell me why it would fail on some tiff images and not on others? I have done some research and found this answer: One possible cause is MODI trying to process a file without any recognisable text. A blank document, or one which has only drawings/scribbles and is effectively blank, will cause this exception. Obviously this is not good enough as there is no way I can have an app that decides to OCR some images and not others. I handle the exception, but the OCR object is not then initalised so I can't do what I need to do from there. This is a bloody nightmare! Why can't the method just do it's bloody job and if the image has some unreadable pages then just ignore them? I am using Windows 7 Ultimate and Office 2007 Ultimate. Visual Studio version is 2008 Thanks, IW

    Read the article

  • gwtQuery's outerWidth(true) and IE8 not working without putting a delay

    - by Christopher
    I recently came across an odd behavior when trying to calculate the width (with margins) of an element using gwtQuery. The goal is to get the width (including padding, borders and margins) of a given element as a child of a certain parent. This parent may define specific CSS rules for some children so I clone it, add my element to this parent, call .outerWidth(true) to get the width and finally remove the clone from the parent. It works fine on Chrome, Firefox and IE 10, but randomly fails (outputs 0) on IE 8. However I noticed that if I put a "sleep" between the moment I add the element to the DOM and the moment I get the outer width, it always succeeds. I obviously don't want to keep that sleep. So my question is does anyone has any insights on how to work around this behavior or even a better way of achieving the same goal? Thank you! Here's a code snippet private Integer computeTabWidth(IsWidget tab) { GQuery $tab = $("<li></li>").append($(tab).clone()); $(containerPanel).append($tab); // IE 8 debug. sleep(100); Integer tabWidth = $tab.outerWidth(true); $tab.remove(); return tabWidth; } private void sleep(int i) { long time = new Date().getTime() + i; while (time > new Date().getTime()); }

    Read the article

  • "requiresuniqueemail=true" implementation in asp.net site

    - by domineer
    Hi people I got a social networking site that is running live right now.The first time I launched my site I let requiresuniqueemail=false set-up on my web.config inorder for me to create dummy accounts for testing purposes and to start up the site you know.However the site is kind of stable right now w/ almost 5k members.So I would like to set-up the requiresuniqueemail to true so that users cannot reuse their existing email address and for me to make it sure that there will be unique email ad for each site user.I know the site got like 100 users with the same email address.My question is what could be the problem I'm going to face if I do this right now(requiresuniqueemail="true") and how to do this efficiently(without errors and if possible sitewide say in the global assax)?I tested and I already got an error if I logout an account.Like say a user try to click log-out this code runs: Dim d As DateTime = DateTime.Now.AddMinutes(-1 * Membership.UserIsOnlineTimeWindow) Dim theuser As MembershipUser = Membership.GetUser() theuser.LastActivityDate = d Membership.UpdateUser(theuser) If Not Cache(Page.User.Identity.Name.ToLower() + "currentstatus") Is Nothing Then Cache.Remove(Page.User.Identity.Name.ToLower() + "currentstatus") End If Then an exception occured on updateuser() function saying System.Configuration.Provider.ProviderException: The E-mail supplied is invalid. This is just one instance I know that I encountered a problem. Hoping to hear your ideas guys.....

    Read the article

  • How to convert "0" and "1" to false and true

    - by Chris
    I have a method which is connecting to a database via Odbc. The stored procedure which I'm calling has a return value which from the database side is a 'Char'. Right now I'm grabbing that return value as a string and using it in a simple if statement. I really don't like the idea of comparing a string like this when only two values can come back from the database, 0 and 1. OdbcCommand fetchCommand = new OdbcCommand(storedProc, conn); fetchCommand.CommandType = CommandType.StoredProcedure; fetchCommand.Parameters.AddWithValue("@column ", myCustomParameter); fetchCommand.Parameters.Add("@myReturnValue", OdbcType.Char, 1). Direction = ParameterDirection.Output; fetchCommand.ExecuteNonQuery(); string returnValue = fetchCommand.Parameters["@myReturnValue"].Value.ToString(); if (returnValue == "1") { return true; } What would be the proper way to handle this situation. I've tried 'Convert.ToBoolean()' which seemed like the obvious answer but I ran into the 'String was not recognized as a valid Boolean. ' exception being thrown. Am I missing something here, or is there another way to make '1' and '0' act like true and false? Thanks!

    Read the article

  • MVC Validator.TryValidateObject does not validate custom atrribute, validateAllProperties = true

    - by nealsu
    When calling Validator.TryValidateObject with validateAllProperties = true my custom validation attribute does not get triggered. The ValidationResult does not contain an entry for my erroneous property value. Below is the model, attribute and code used to test this. //Model public class Model { [AmountGreaterThanZero] public int? Amount { get; set; } } //Attribute public sealed class AmountGreaterThanZero: ValidationAttribute { private const string errorMessage = "Amount should be greater than zero."; public AmountGreaterThanZero() : base(errorMessage) { } public override string FormatErrorMessage(string name) { return errorMessage; } protected override ValidationResult IsValid(object value, ValidationContext validationContext) { if (value != null) { if ((int)value <= 0) { var message = FormatErrorMessage(validationContext.DisplayName); return new ValidationResult(message); } } return null; } } //Validation Code var container = new Container(); container.ModelList = new List<Model>() { new Model() { Amount = -5 } }; var validationContext = new ValidationContext(container, null, null); var validationResults = new List<ValidationResult>(); var modelIsValid = Validator.TryValidateObject(container, validationContext, validationResults, true); Note: That the validation works fine and ValidationResult returns with correct error message if I use the TryValidateProperty method.

    Read the article

  • PHP download page: file_exists() returns true, but browser returns 'page not found'

    - by Chris
    I'm using PHP for a file download page. Here's a snippet of the problem code: if (file_exists($attachment_location)) { header($_SERVER["SERVER_PROTOCOL"] . " 200 OK"); header("Cache-Control: public"); // needed for i.e. header("Content-Type: application/zip"); header("Content-Transfer-Encoding: Binary"); header("Content-Length:".filesize($attachment_location)); header("Content-Disposition: attachment; filename=file.zip"); readfile($attachment_location); die("Hooray"); } else { die("Error: File not found."); } This code works absolutely fine when testing locally, but after deploying to the live server the browser returns a 'Page not found' error. I thought it might be an .htaccess issue, but all .htaccess files on the live server are identical to their local counterparts. My next guess would be the live server's PHP configuration, but I have no idea what PHP setting might cause this behaviour. The file_exists() function always returns true - I've checked this on the live server and it's always correctly picking up the file, its size etc., so it does have a handle on the file. It just won't perform the download! The main site is a Wordpress site, but this code isn't part of a Wordpress page - it's in a standalone directory within the site root. UPDATE: is_file() and is_readable() are both returning true for the file, so that's not the problem. The specific line that is causing the problem is: readfile($attachment_location) Everything up until that point is super happy.

    Read the article

  • ASP.NET MVC Html.ValidationSummary(true) does not display model errors

    - by msi
    I have some problem with Html.ValidationSummary. I don't want to display property errors in ValidationSummary. And when I set Html.ValidationSummary(true) it does not display error messages from ModelState. When there is some Exception in controller action on string MembersManager.RegisterMember(member); catch section adds an error to the ModelState: ModelState.AddModelError("error", ex.Message); But ValidationSummary does not display this error message. When I set Html.ValidationSummary(false) all messages are displaying, but I don't want to display property errors. How can I fix this problem? Here is the code I'm using: Model: public class Member { [Required(ErrorMessage = "*")] [DisplayName("Login:")] public string Login { get; set; } [Required(ErrorMessage = "*")] [DataType(DataType.Password)] [DisplayName("Password:")] public string Password { get; set; } [Required(ErrorMessage = "*")] [DataType(DataType.Password)] [DisplayName("Confirm Password:")] public string ConfirmPassword { get; set; } } Controller: [HttpPost] public ActionResult Register(Member member) { try { if (!ModelState.IsValid) return View(); MembersManager.RegisterMember(member); } catch (Exception ex) { ModelState.AddModelError("error", ex.Message); return View(member); } } View: <% using (Html.BeginForm("Register", "Members", FormMethod.Post, new { enctype = "multipart/form-data" })) {%> <p> <%= Html.LabelFor(model => model.Login)%> <%= Html.TextBoxFor(model => model.Login)%> <%= Html.ValidationMessageFor(model => model.Login)%> </p> <p> <%= Html.LabelFor(model => model.Password)%> <%= Html.PasswordFor(model => model.Password)%> <%= Html.ValidationMessageFor(model => model.Password)%> </p> <p> <%= Html.LabelFor(model => model.ConfirmPassword)%> <%= Html.PasswordFor(model => model.ConfirmPassword)%> <%= Html.ValidationMessageFor(model => model.ConfirmPassword)%> </p> <div> <input type="submit" value="Create" /> </div> <%= Html.ValidationSummary(true)%> <% } %>

    Read the article

  • setOpaque(true/false); Java

    - by Trizicus
    In Java2D when you use setOpaque I am a little confused on what the true and false does. For example I know that in Swing Opaque means that when painting Swing wont paint what is behind the component. Or is this backwards? Which one is it? Thanks

    Read the article

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