Search Results

Search found 12126 results on 486 pages for 'property hiding'.

Page 52/486 | < Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >

  • F# Silverlight 3.0 Custom Control Property throws: NullReferenceException

    - by akaphenom
    A new issue since my previous post. I am having some issues with the properties of the control in my Control Class I havse defined: static member ItemsProperty : DependencyProperty = DependencyProperty.Register( "Items", typeof<MyMenuItemCollection>, typeof<MyMenu>, null); member this.Items with get () : MyMenuItemCollection = this.GetValue(MyMenu.ItemsProperty) :?> MyMenuItemCollection and set (value: MyMenuItemCollection) = this.SetValue(MyMenu.ItemsProperty, value); The problem occurs on access: for menuItem in this.Items do let contentElement: FrameworkElement = menuItem.Content where I get a null referce exception on this.Items; 'Items' threw an exception of type 'System.NullReferenceException' Immediately after I initialized in the constructor: do this.Items <- new CoolMenuItemCollection()

    Read the article

  • Using NHibernate to map a nChar column to an enumerated type

    - by Morrislgn
    Hello Folks, I am trying to map a table frp, a SQL Server 2005 DB to a class which contains an enum: public class MyClass{ private YesNoOptional addressSetting; public YesNoOptional AddressSetting{ {get; set;} } } public enum YesNoOptional { Yes, No, Optional } This will dictate that one of three values is inserted into the corresponding column - 'Y', 'N', 'O'. This column is of type nchar(1). My mapping file is like so (addressSetting is the property which is causing the problem): <class name="IncidentDefinition" table="IR_INCIDENT_DEF" lazy="false" > <id name="Guid" column="INT_GUID" > <generator class="guid"></generator> </id> <property name="Reference" column="INT_REF" ></property> <property name="Description" column="INT_DESCRIPTION" ></property> <property name="AddressSetting" column="INT_ADDRESS_REQ" ></property> <property name="Active" column="INT_ACTIVE" type="YesNo"></property> <property name="PinDocId" column="INT_PIN_DOC_ID"></property> </class> Using the config above I get the following error: NHibernate.ADOException: could not initialize a collection: System.FormatException: Input string was not in a correct format.. If I try to map the enum using a custom type like so: <property name="AddressSetting" column="INT_ADDRESS_REQ" type="ML.Types.YesNoOptional, ML.Types" ></property> Error: System.FormatException: Input string was not in a correct format. Next, if I try using a specific type like so: <property name="AddressSetting" column="INT_ADDRESS_REQ" type="String" ></property> This error is generated: NHibernate.PropertyAccessException: The type System.String can not be assigned to a property of type System.ArgumentException: Object of type 'System.String' cannot be converted to type 'ML.Types.YesNoOptional'.. As a last resort I tried to specify the type as a char like so: <property name="AddressSetting" column="INT_ADDRESS_REQ" type="Char" ></property> This works a bit better, as it in it doesnt throw an error, however instead of returning the character from the table and mapping it to the enumerated type the ASCII value of the character is returned instead - so Y is represented by 89! I am hoping someone can explain what I am doing wrong and\or how why this is happening please? Thanks Morris

    Read the article

  • ReadOnly Property in Custom Column Types in Sharepoint

    - by Ray Booysen
    Hey all I'm creating a custom column in a feature for Sharepoint. It is essentially this: <Field Type="Integer" ID="<insert guid here>" ReadOnly="true" Name="xxx" DisplayName="XXX" Group="YYY" /> When the field is deployed and attached to a content type, the content type shows no instance of this field being attached. The documentation about ReadOnly is a bit vague but definitely states that the column will be available for viewing in a View. However, when I create a view it is not available. The moment I remove ReadOnly from the field, it is available on the content type without any problems. Any ideas?

    Read the article

  • LINQ to remove duplicated property

    - by Shawn Mclean
    I have a LINQ statement like this: var media = (from p in postService.GetMedia(postId) select new { PostId = postId, SynthId = p.SynthId }); There are many(possibly thousands) of records returned with the same SynthId. I want to select one one, any random one. So when I'm finished, media should contain records with distinct SynthId. SynthId can be null, I want all nulls to be in media (the distinct should not affect them). My DAL is EntityFramework, if that will help. How do I accomplish this in the most efficient way?

    Read the article

  • NSDictionary with specific property of plist

    - by Leonardo
    Hi, I have a plist with key values. Each key represent a language, let's say 'it' 'en' ....ecc The value of each key is another key/value(=array) set. At startup I would like to create a dictionary by reading only a specific key. Let's say the locale of my iphone is 'it', then the init method would only parse it key, because the only way I found by now is to make a dictionary from the whole plist file and then another dictionary. But I can imagine this can become quite cpu consuming if I add more language in the future. thanks Leonardo

    Read the article

  • Attempting to use CSS top property on a SWF file, but it's not working

    - by ben
    Hey guys, I'm trying to position my Flex app so that it's further down the page, but I can't get it working. It's still appearing in the top left. Here is the HTML, any help would be greatly appreciated! <html lang="en"> <head> <title>Page</title> <style type="text/css"> body { margin: 0px; overflow: hidden; } #swf {top:50%;} </style> <script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script> <script type="text/javascript"> swfobject.embedSWF( "link_to_the_swf", "swf", "100%", "100%", "10.0.0", "playerProductInstall.swf", flashVars, params ); </script> </head> <body scroll="no"> <div id="swf"> <p>Alternative content</p> </div> </body> </html>

    Read the article

  • Filter a date property between a begin and end Dates with JDOQL

    - by Sergio del Amo
    I want to code a function to get a list of Entry objects whose date field is between a beginPeriod and endPeriod I post below a code snippet which works with a HACK. I have to substract a day from the begin period date. It seems the condition great or equal does not work. Any idea why I have this issue? public static List<Entry> getEntries(Date beginPeriod, Date endPeriod) { /* TODO * The great or equal condition does not seem to work in the filter below * Substract a day and it seems to work */ Calendar calendar = Calendar.getInstance(); calendar.set(beginPeriod.getYear(), beginPeriod.getMonth(), beginPeriod.getDate() - 1); beginPeriod = calendar.getTime(); PersistenceManager pm = JdoUtil.getPm(); Query q = pm.newQuery(Entry.class); q.setFilter("this.date >= beginPeriodParam && this.date <= endPeriodParam"); q.declareParameters("java.util.Date beginPeriodParam, java.util.Date endPeriodParam"); List<Entry> entries = (List<Entry>) q.execute(beginPeriod,endPeriod); return entries; }

    Read the article

  • Castle Windsor Dynamic Property in XML config

    - by haxelit
    I'm trying to set the DataContext on ApplicationMainWindow which is a WPF window. When I set it up in the XML like so it leaves the DataContext null: <!-- View Models --> <component id="mainwindow.viewmodel" type="ProjectTracking.ApplicationMainViewModel, ProjectTracking" inspectionBehavior="none" lifestyle="transient"> </component> <!-- UI Components --> <component id="mainwindow.view" type="ProjectTracking.ApplicationMainWindow, ProjectTracking" inspectionBehavior="none" lifestyle="transient"> <parameters> <DataContext>${mainwindow.viewmodel}</DataContext> </parameters> </component> But if I do it this way via C# it works. _Kernel.Register( ... Component.For<ApplicationMainWindow>() .DynamicParameters( (k,d) => { d["DataContext"] = k[typeof(ApplicationMainViewModel)]; }) ); I'm instantiating my window like so: Window window = _Kernel[typeof(ApplicationMainWindow)] as Window; When I configure windsor via the xml config it leaves my DataContext NULL, but when I configure it via code it works like a charm. Do I need to use code to pull this off, or should it work via XML config ? Thanks, Raul

    Read the article

  • how to set the background image property of a div to a dynamically generated image

    - by tixrus
    I have some divs and each one has its own background image. The base images as stored is just a black silhouette. What I would like to do is use the PHP GD package to modify the color of those images somewhat randomly and have the modified randomly coloured images be the background images of the divs. One way to do it is just create GD images structures from the original files, modify them, save the results as a temp file, pass this filename into the client, and then use jquery to modify the css background image properties of the divs to be the new file. But this is going to leave a lot of files laying around to garbage collect. Is there some way to do it without creating a bunch of files?

    Read the article

  • Map element position in data file to class property

    - by Augusto
    I need to read/write files, following a format provided by a third party specification. The specification itself is pretty simple: it says the position and the size of the data that will be saved in the file. For example: Position Size Description -------------------------------------------------- 0001 10 Device serial number 0011 02 Hour 0013 02 Minute 0015 02 Second 0017 02 Day 0019 02 Month 0021 02 Year The list is very long, it has about 400 elements. But lots of them can be combined. For example, hour, minute, second, day, month and year can be combined in a single DateTime object. I've splitted the elements into about 4 categories, and created separeted classes for holding the data. So, instead of a big structure representing the data, I have some smaller classes. I've also created different classes for reading and writing the data. The problem is: how to map the positions in the file to the objects properties, so that I don't need to repeat the values in the reading/writing class? I could use some custom attributes and retrieve them via reflection. But since the code will be running on devices with small memory and processor, it would be nice to find another way. My current read code looks like this: public void Read() { DataFile dataFile = new DataFile(); // the arguments are: position, size dataFile.SerialNumber = ReadLong(1, 10); //... } Any ideas on this one? Thanks!

    Read the article

  • Finding parents where child collection does not contain an item with a specific property value

    - by Colin Bowern
    I am trying to get a list of parents where the child collection does not contain an item of a specific type. The LINQ equivalent would be something like: dataset.Where(x => x.Items.FirstOrDefault(y => y.Type.Code == "ABC") == null) The object model is Parent Child (Items) Type Code If Parent is my aggregate root, how would I model this in NHibernate criteria/query? Here's my first attempt: var results = session.CreateCriteria<Parent>() .CreateCriteria("Items") .CreateCriteria("Type") .Add(Restrictions.Not(Restrictions.Eq("Code", "ABC"))) .SetResultTransformer(Transformers.DistinctRootEntity) .List<Parent>(); This doesn't seem to return the right entities - it just returns them all.

    Read the article

  • problem with jquery : minipulating val() property of element

    - by P4ul
    Hi, Please help! I have some form elements in a div on a page: <div id="box"> <div id="template"> <div> <label for="username">Username</label> <input type="text" class="username" name="username[]" value="" / > <label for="hostname">hostname</label> <input type="text" name="hostname[]" value=""> </div> </div> </div> using jquery I would like to take a copy of #template, manipulate the values of the inputs and insert it after #template so the result would look something like: <div id="box"> <div id="template"> <div> <label for="username">Username</label> <input type="text" class="username" name="username[]" value="" / > <label for="hostname">hostname</label> <input type="text" name="hostname[]" value=""> </div> </div> <div> <label for="username">Username</label> <input type="text" class="username" name="username[]" value="paul" / > <label for="hostname">hostname</label> <input type="text" name="hostname[]" value="paul"> </div> </div> I am probably going about this the wrong way but the following test bit of javascript code run in firebug on the page does not seem to change the values of the inputs. var cp = $('#template').clone(); cp.children().children().each( function(i,d){ if( d.localName == 'INPUT' ){ $(d).val('paul'); //.css('background-color', 'red'); } }); $("#box").append(cp.html()); although if I uncomment "//.css('background-color', 'red');" the inputs will turn red.

    Read the article

  • How to dynamic call property on javascript object with jQuery

    - by Massimo Ugues
    Hallo all. I got a javascript object with some propeties let's say function Animal() { this.id; this.name; I need to call id function in a dynamic way to get and set its value: something like this Animal animal = new Animal(); var propertyName = "id"; animal.+propertyName = "name"; Is there an elegant way to do it? With jQuery? Kind regards Massimo

    Read the article

  • angular js scope property is undefined

    - by user2071301
    why is $scope.orderBy undefined? Shouldnt it be "test" ? http://jsfiddle.net/XB4QA/4/ var app = angular.module("Foo", []); app.directive("two", function () { return { scope: { orderBy: '@' }, restrict: 'E', transclude: true, controller: function ($scope, $element, $attrs) { console.log($scope.orderBy); // is undefined, why? }, template: '<div></div>', replace: true }; }); <div ng-app="Foo"> <two order-by="test">test</two> </div>

    Read the article

  • flex: entering itemEditor when no value is assigned to data property in custom itemRenderer

    - by Markus
    Hi there, Im having a strange problem with my custom itemRenderer in the following Methode I assign the values to the cell. The problem is, when the side.element is still empty. In this case the itemEditor will not show up by default... override public function set data(side:Object):void{ super.data = side.element.toString(); choiceLabel.text = side.element.toString(); answer.selected = side.element.@answer; } Thanks for your help! Markus

    Read the article

  • NHibernate: Mapping IList property

    - by Anry
    I have a table Order, Transaction, Payment. Class Order has the properties: public virtual Guid Id { get; set; } public virtual DateTime Created { get; set; } ... I added properties: public virtual IList<Transaction> Transactions { get; set; } public virtual IList<Payment> Payments { get; set; } These properties contain a record of tables [Transaction] and [Payment]. How to keep these lists in the database?

    Read the article

  • C# Reset a property

    - by Jeff
    I'm writing a Clone function for a non serializeable object.For most objects I don't care if they are shallow copied as I won't be making any changes to them. I start with a MemberwiseClone and this copies all the values and few objects like configuration dictionary over just fine but they are pointers. EAVEntity newClone = (EAVEntity) this.MemberwiseClone(); newClone.EntityStorageID = Guid.NewGuid(); newClone.Controls.Clear(); So how do I reset a pointer so I can make them not point at the same location?

    Read the article

  • problem with RenderOuterTable property for .net 4.0 controls

    - by Mario
    According to the new 4.0 framework overview, one should be able to add the attrib RenderOuterTable="false" to a control that supports the attribute and see css friendly code be spit out - in other words no html tables. To test this, I threw a login control into a basic fresh webpage with the following code: <asp:Login ID="Login1" runat="server" RenderOuterTable="false"></asp:Login> The result? Crappy html table output, which supposedly doesn't happen with this attrib set to false. Here is the output: &lt;table cellpadding=&quot;0&quot;&gt; <tr> <td align="center" colspan="2">Log In</td> </tr><tr> <td align="right"><label for="MainContent_Login1_UserName">User Name:</label></td><td><input name="ctl00$MainContent$Login1$UserName" type="text" id="MainContent_Login1_UserName" /><span id="MainContent_Login1_UserNameRequired" title="User Name is required." style="visibility:hidden;">*</span></td>... Hopefully you get the point. Anyone know how to stop these controls from outputting tables? This is super annoying.

    Read the article

  • @OneToMany property null in Entity after (second) merge

    - by iNPUTmice
    Hi, I'm using JPA (with Hibernate) and Gilead in a GWT project. On the server side I have this method and I'm calling this method twice with the same "campaign". On the second call it throws a null pointer exception in line 4 "campaign.getTextAds()" public List<WrapperTextAd> getTextAds(WrapperCampaign campaign) { campaign = em.merge(campaign); System.out.println("getting textads for "+campaign.getName()); for(WrapperTextAd textad: campaign.getTextAds()) { //do nothing } return new ArrayList<WrapperTextAd>(campaign.getTextAds()); } The code in WrapperCampaign Entity looks like this @OneToMany(mappedBy="campaign") public Set<WrapperTextAd> getTextAds() { return this.textads; }

    Read the article

  • Error creating bean with name 'sessionFactory'

    - by Sunny Mate
    hi i am getting the following exception while running my application and my applicationContext.xml is <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver"> </property> <property name="url" value="jdbc:mysql://localhost/SureshDB"></property> <property name="username" value="root"></property> <property name="password" value="root"></property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource" /> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.MySQLDialect </prop> </props> </property> <property name="mappingResources"> <list> <value>com/jsfcompref/register/UserTa.hbm.xml</value></list> </property></bean> <bean id="UserTaDAO" class="com.jsfcompref.register.UserTaDAO"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <bean id="UserTaService" class="com.jsfcompref.register.UserTaServiceImpl"> <property name="userTaDao"> <ref bean="UserTaDAO"/> </property> </bean> </beans> Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V any suggestion would be heplful

    Read the article

  • Fluent-NHibernate - Component property attributes ignored by Convention

    - by BobTodd
    I have a component with a number of properties that have various attributes Normally when these attributes are added to a plain old domain object they are picked up by my custom AttributeConventions. For the Component properties they are not. Is there some extra wiring needed for these? e.g. public class Component { [Length(Max=50)] public virtual string Name {get; set;} } public class MyClass { public virtual Component Component {get; set;} [Length(Max=50)] public virtual string Color {get; set;} } I get a table MyClass with columns Color & ComponentName Color is an nvarchar(50) whilst ComponentName is an nvarchar(255) (the default)

    Read the article

  • Copy an entity in Google App Engine datastore in Python without knowing property names at 'compile'

    - by Gordon Worley
    In a Python Google App Engine app I'm writing, I have an entity stored in the datastore that I need to retrieve, make an exact copy of it (with the exception of the key), and then put this entity back in. How should I do this? In particular, are there any caveats or tricks I need to be aware of when doing this so that I get a copy of the sort I expect and not something else. ETA: Well, I tried it out and I did run into problems. I would like to make my copy in such a way that I don't have to know the names of the properties when I write the code. My thinking was to do this: #theThing = a particular entity we pull from the datastore with model Thing copyThing = Thing(user = user) for thingProperty in theThing.properties(): copyThing.__setattr__(thingProperty[0], thingProperty[1]) This executes without any errors... until I try to pull copyThing from the datastore, at which point I discover that all of the properties are set to None (with the exception of the user and key, obviously). So clearly this code is doing something, since it's replacing the defaults with None (all of the properties have a default value set), but not at all what I want. Suggestions?

    Read the article

  • Syntax to change the value of a cached object property

    - by Craig
    In an ASP.NET 3.5 VB web app, I successfully manage to cache an object containing several personal details such as name, address, etc. One of the items is CreditNum which I'd like to change in the cache on the fly. Is there a way to access this directly in the cache or do I have to destroy and rebuild the whole object just to change the value of objMemberDetails.CreditNum? The cache is set using: Public Shared Sub CacheSet(ByVal key As String, ByVal value As Object) Dim userID As String = HttpContext.Current.User.Identity.Name HttpContext.Current.Cache(key & "_" & userID) = value End Sub

    Read the article

  • Using ManagementObject to retrieve a single WMI property

    - by Jesse
    This probably isn't the best way, but I am currently retrieving the amount of RAM on a machine using: manageObjSearch.Query = new ObjectQuery("SELECT TotalVisibleMemorySize FROM Win32_OperatingSystem"); manageObjCol = manageObjSearch.Get(); foreach (ManagementObject mo in manageObjCol) sizeInKilobytes = Convert.ToInt64(mo["TotalVisibleMemorySize"]); It works well and good, but I feel I could be doing this more directly and without a foreach over a single element, but I can't figure out how to index a ManagementObjectCollection I want to do something like this: ManagementObject mo = new ManagementObject("Win32_OperatingSystem.TotalVisibleMemorySize") mo.Get(); Console.WriteLine(mo["TotalVisibleMemorySize"].ToString()) or maybe even something like ManagementClass mc = new ManagementClass("Win32_OperatingSystem"); Console.WriteLine(mc.GetPropertyValue("TotalVisibleMemorySize").ToString()); I just can't seem to figure it out. Any ideas?

    Read the article

< Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >