Search Results

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

Page 34/486 | < Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >

  • IE7 and the CSS table-cell property

    - by Ryan Smith
    So I just love it when my application is working great in Firefox, but then I open it in IE and... Nope, please try again. The issue I'm having is that I'm setting a CSS display property to either "none" or "table-cell" with JavaScript. I was initially using "display: block;", but Firefox was rending it weird without the table-cell property. I would love to do this without adding an hack in the JavaScript to test for IE. Any suggestions? Thanks.

    Read the article

  • PHP: Accessing an object property with a variable.

    - by Peter
    Let's assume I have an array of object properties I'd like to access: $properties = array('foo', 'bar'); I'd like to loop through the object and access these properties dynamically (specifically, I'm trying to dynamically handle missing JSON elements based on an array of expected elements): foreach ($data as $item) { foreach ($properties as $property) { if (empty($item->{$property})) { // Do something } } } Each $item in $data should have the properties 'foo' and 'bar'. If empty(), I'll handle them. I'm trying to get the loop (in line 3) to access $item-{'foo'} and $item-{'bar'}, but it's not working. Any idea why? Thanks!

    Read the article

  • Dynamically udpate canvasOverlay property of jQuery jqPlot

    - by You Kuper
    I want to dynamically udpate canvasOverlay property of jQuery jqPlot. This will provide the effect of a timeline in my jqPlot. This effect should be similar to the one shown in this jFiddle. However, instead of drawing points, I want to update canvasOverlay property every second: canvasOverlay: { show: true, objects: [ { rectangle: { xmax: new Date(), xminOffset: "0px", xmaxOffset: "0px", yminOffset: "0px", ymaxOffset: "0px", color: "rgba(0, 0, 0, 0.1)", showTooltip: true } }, ] } How can I do this? What are the functions I should use? UPDATE: My idea is to do something like this: canvasOverlay: { name: 'current', show: true, objects: [ { rectangle: { xmax: new Date(), xminOffset: "0px", xmaxOffset: "0px", yminOffset: "0px", ymaxOffset: "0px", color: "rgba(0, 0, 0, 0.1)", showTooltip: true } }, ] } /... var co = plot.plugins.canvasOverlay; var current = co.get('current'); current.options.objects.rectangle.xmax = new Date(); co.draw(plot);

    Read the article

  • ASP.NET Custom Control With A Property That Is An Interface

    - by user129674
    I want to have a property on my custom control that is an interface type. For example: [ ToolboxData("<{0}:MyTextBox runat=server></{0}:MyTextBox"), ParseChildren(true, "Validation") ] class MyTextBox : WebControl { [ Category("Behavior"), Description("The validation to use"), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerDefaultProperty) ] public IValidation Validation { get; set; } } Then when I go to use my control in a web form I would like to be able to do: <my:MyTextBox ID="txt" runat="server"> <my:FancyValidator /> </my:MyTextBox> That way I will be able to define one class that could use any number of validators. When I try and do this now, I end up with an error saying: Type 'IValidator' does not have a public property named 'FancyValidator' What do I need to do to make this work? Thanks!

    Read the article

  • Caller property of JS for "foo = function()" style of coding

    - by arvind
    I want to use the property of "caller" for a function which is defined here It works fine for this style of function declaration function g() { alert(g.caller.name) // f } function f() { alert(f.caller.name) // undefined g() } f() JSfiddle for this But then my function declaration is something like g = function() { alert(g.caller.name) // expected f, getting undefined } f = function() { alert("calling f") alert(f.caller.name) // undefined g() } f() and I am getting undefined (basically not getting anything) JSfiddle for this Is there any way that I can use the caller property without having to rewrite my code? Also, I hope I have not made any mistakes in usage and function declaration since I am quite new to using JS.

    Read the article

  • Text property in a UserControl in C#

    - by yeyeyerman
    I have a control with a inner TextBox. I want to make a direct relationship between the Text property of the UserControl and the Text property of the TextBox. The first thing I realized is that Text was not being displayed in the Properties of the UserControl. Then I added the Browsable(true) attribute. [Browsable(true)] public override string Text { get { return m_textBox.Text; } set { m_textBox.Text = value; } } Now, the text will be shown for a while, but then is deleted. This is because the information is not written within the xxxx.Designer.cs. How can this behviour be changed?

    Read the article

  • How can a property resolve its own name and type with reflection?

    - by Tim Santeford
    Is there a way for a property to access its own name and type at runtime using reflection? I want to access this info without hard coding the name or index of the property in the class. Simple Example Code: Private ReadOnly Property MyProperyName() As String Get Console.WriteLine((Get Current Property Info).Type.ToString) Console.WriteLine((Get Current Property Info).Name) Return "" End Get End Property Expected output: System.String MyPropertyName

    Read the article

  • VB.Net Create Database table from class property

    - by joeb
    I'm trying to create an inheritable class(OF t) in vb.net that I will pass it a class of objects. Inside the class of objects I want to use the class properties to create a corresponding database table. Like below Public Class SampleClass #Region "Properties" Private newPropertyValue As String Public Property NewProperty() As String Get Return newPropertyValue End Get Set(ByVal value As String) newPropertyValue = value End Set End Property #End Region Public Sub New() End Sub End Class I'm new to vb.net so I don't know my way around exactly. I was looking into class attributes for this action but they do not fully make sense to me yet. Thanks in advance.

    Read the article

  • ASP.NET UserControl Uri property

    - by Roedel
    I want to pass a property of the type System.Uri to an WebControl from inside an aspx page. Is it possible to pass the property like that: <MyUserControl id="myusercontrol" runat="server"> <MyUrlProperty> <System.Uri>http://myurl.com/</System.Uri> </MyUrlProperty> </MyUserControl> instead of: <MyUserControl id="myusercontrol" runat="server" MyUrlProperty="http://myurl.com/" /> which can't be casted from System.String to System.Uri

    Read the article

  • WPF/Silverlight DataBinding to interface property (with hidden implementation)

    - by Dave
    I have the following (C#) code namespace A { interface IX { bool Prop { get; set; } } class X : IX { public bool Prop { ... } } // hidden implementation of IX } namespace B { .. A.IX x = ...; object.DataContext = x; object.SetBinding(SomeDependencyProperty, new Binding("Prop")); .. } So I have a hidden implementation of an interface with a property "Prop" and I need to bind to this property in code. My problem is that the binding isn't working unless I make class X public. Is there any way around this problem?

    Read the article

  • Resolve property at runtime. C#

    - by user1031381
    I have some class which have some code public IEnumerable<TypeOne> TypeOne { get { if (db != null) { var col = db.Select<TypeOne>(); if (col.Count > 0) return col; } return db2.TypeOne; } } public IEnumerable<TypeTwo> TypeTwo { get { if (db != null) { var col = db.Select<TypeTwo>(); if (col.Count > 0) return col; } return db2.TypeTwo; } } So as You can see there is a lot of duplicated Code and there are same property name and item type of enumerable. I want to call some property of object like "obj.MyProp". And MyProp must be resolved at runtime with some generic or non-generic method. Is it possible?

    Read the article

  • Javascript: Retrieve Object Property Names

    - by Jason
    I'm trying to write a function that needs to know the property names of an object being passed in, like so: var data = { "key1":"value1", "key2":"value2", etc} ^ i want the string value "key1" How do I retrieve the string "key1" from data? I know I can set a property dynamically like data[prop]=value but i want to know what prop is from an object passed in. If that doesn't make sense I suppose I could try to explain more. Thanks! I eventually want to do something like: for (var i = 0; i<data.length; i++) { var name = data[i].getPropertyName() <--- not a real function // do stuff }

    Read the article

  • Object directing to a property when accessed as an iterable

    - by ThE_JacO
    I'm trying to figure out if there's an elegant and concise way to have a class accessing one of its own properties when "used" as a dictionary, basically redirecting all the methods that'd be implemented in an ordered dictionary to one of its properties. Currently I'm inheriting from IterableUserDict and explicitly setting its data to another property, and it seems to be working, but I know that UserDict is considered sort of old, and I'm concerned I might be overlooking something. What I have: class ConnectionInterface(IterableUserDict): def __init__(self, hostObject): self._hostObject= hostObject self.ports= odict.OrderedDict() self.inputPorts= odict.OrderedDict() self.outputPorts= odict.OrderedDict() self.data= self.ports This way I expect the object to behave and respond (and be used) the way I mean it to, except I want to get a freebie ordered dictionary behaviour on its property "ports" when it's iterated, items are gotten by key, something is looked up ala if this in myObject, and so on. Any advice welcome, the above seems to be working fine, but I have an odd itch that I might be missing something. Thanks in advance.

    Read the article

  • .net runtime type casting when using reflection

    - by Mike
    I have need to cast a generic list of a concrete type to a generic list of an interface that the concrete types implement. This interface list is a property on an object and I am assigning the value using reflection. I only know the value at runtime. Below is a simple code example of what I am trying to accomplish: public void EmployeeTest() { IList<Employee> initialStaff = new List<Employee> { new Employee("John Smith"), new Employee("Jane Doe") }; Company testCompany = new Company("Acme Inc"); //testCompany.Staff = initialStaff; PropertyInfo staffProperty = testCompany.GetType().GetProperty("Staff"); staffProperty.SetValue(testCompany, (staffProperty.PropertyType)initialStaff, null); } Classes are defined like so: public class Company { private string _name; public string Name { get { return _name; } set { _name = value; } } private IList<IEmployee> _staff; public IList<IEmployee> Staff { get { return _staff; } set { _staff = value; } } public Company(string name) { _name = name; } } public class Employee : IEmployee { private string _name; public string Name { get { return _name; } set { _name = value; } } public Employee(string name) { _name = name; } } public interface IEmployee { string Name { get; set; } } Any thoughts? I am using .NET 4.0. Would the new covariant or contravariant features help? Thanks in advance.

    Read the article

  • Callers block until getFoo() has a value ready?

    - by Sean Owen
    I have a Java Thread which exposes a property which other threads want to access: class MyThread extends Thread { private Foo foo; ... Foo getFoo() { return foo; } ... public void run() { ... foo = makeTheFoo(); ... } } The problem is that it takes some short time from the time this runs until foo is available. Callers may call getFoo() before this and get a null. I'd rather they simply block, wait, and get the value once initialization has occurred. (foo is never changed afterwards.) It will be a matter of milliseconds until it's ready, so I'm comfortable with this approach. Now, I can make this happen with wait() and notifyAll() and there's a 95% chance I'll do it right. But I'm wondering how you all would do it; is there a primitive in java.util.concurrent that would do this, that I've missed? Or, how would you structure it? Yes, make foo volatile. Yes, synchronize on an internal lock Object and put the check in a while loop until it's not null. Am I missing anything?

    Read the article

  • Is there a nice way of having static generic parameters is Java?

    - by Chris
    Hello, recently I'm writing some functions that I take from Haskell and translate into Java. One of the main problems I have is I cannot easily create a static property with a generic type. Let me explain by a little example... // An interface to implement functions public interface Func<P, R> { public R apply(P p); } // What I want to do... (incorrect in Java) public class ... { public static <T> Func<T, T> identity = new Func<T, T>() { public T apply(T p) { return p; } } } // What I do right now public class ... { private static Func<Object, Object> identity = new Func<Object, Object>() { public Object apply(Object p) { return p; } } @SuppressWarnings("unchecked") public static <T> Func<T, T> getIdentity() { return (Func<T, T>)identity; } } Are there any easier ways to do something like that? What kind of problems might arise if the syntax I used would be valid?

    Read the article

  • Where to set Visual studio 2013 property macros

    - by marcp
    I'm a new VS user. I've received some sample C++ projects working with a 3rd party API. They were saved in VS2012 format, but I have VS 2013. After conversion I find that there is an API specific macro defined in the project properties in the "Linker|General|Additional Library Directories" category. If I click on 'edit' I can replace the macro with an actual path, but how do I establish what the macro points to? In other words, how does one create a macro usable in multiple projects?

    Read the article

  • Hibernate Que related to database i want select query generic without using property name

    - by Sudhir Gudhe
    Hi My que is i tried to get the data from data base using String SQL_QUERY ="from dat_personal_info "; Query query = session.createQuery(SQL_QUERY); for( it=query.iterate();it.hasNext();) { Object[] rowObject =(Object[]) it.next(); } but error occurs Hibernate: select dat_person0_.row_id as col_0_0_ from dat_personal_info dat_per son0_ java.lang.ClassCastException: bn.com.server.database.maptables.dat_personal_info $$EnhancerByCGLIB$$e1ffd36e cannot be cast to [Ljava.lang.Object; pls any who ans pls reply Thanks & Regards Sudhir gudhe

    Read the article

  • nhibernate configure and buildsessionfactory time

    - by davidsleeps
    Hi, I'm using Nhibernate as the OR/M tool for an asp.net application and the startup performance is really frustrating. Part of the problem is definitely me in my lack of understanding but I've tried a fair bit (understanding is definitely improving) and am still getting nowhere. Currently ANTS profiler has that the Configure() takes 13-18 seconds and the BuildSessionFActory() as taking about 5 seconds. From what i've read, these times might actually be pretty good, but they were generally talking about hundreds upon hundreds of mapped entities...this project only has 10. I've combined all the mapping files into a single hbm mapping file and this did improve things but only down to the times mentioned above... I guess, are there any "Traps for young players" that are regularly missed...obvious "I did this/have you enabled that/exclude file x/mark file y as z" etc... I'll try the serialize the configuration thing to avoid the Configure() stage, but I feel that part shouldn't be that long for that amount of entities and so would essentially be hiding a current problem... I will post source code or configuration if necessary, but I'm not sure what to put in really... thanks heaps! edit (more info) I'll also add that once this is completed, each page is extremely quick... configuration code- hibernate.cfg.xml <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" /> </configSections> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> <session-factory> <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property> <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property> <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> <property name="connection.connection_string_name">MyAppDEV</property> <property name="cache.provider_class">NHibernate.Caches.SysCache.SysCacheProvider, NHibernate.Caches.SysCache</property> <property name="cache.use_second_level_cache">true</property> <property name="show_sql">false</property> <property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property> <property name="current_session_context_class">managed_web</property> <mapping assembly="MyApp.Domain"/> </session-factory> </hibernate-configuration> </configuration> My SessionManager class which is bound and unbound in a HttpModule for each request Imports NHibernate Imports NHibernate.Cfg Public Class SessionManager Private ReadOnly _sessionFactory As ISessionFactory Public Shared ReadOnly Property SessionFactory() As ISessionFactory Get Return Instance._sessionFactory End Get End Property Private Function GetSessionFactory() As ISessionFactory Return _sessionFactory End Function Public Shared ReadOnly Property Instance() As SessionManager Get Return NestedSessionManager.theSessionManager End Get End Property Public Shared Function OpenSession() As ISession Return Instance.GetSessionFactory().OpenSession() End Function Public Shared ReadOnly Property CurrentSession() As ISession Get Return Instance.GetSessionFactory().GetCurrentSession() End Get End Property Private Sub New() Dim configuration As Configuration = New Configuration().Configure() _sessionFactory = configuration.BuildSessionFactory() End Sub Private Class NestedSessionManager Friend Shared ReadOnly theSessionManager As New SessionManager() End Class End Class edit 2 (log4net results) will post bits that have a portion of time between them and will cut out the rest... 2010-03-30 23:29:40,898 [4] INFO NHibernate.Cfg.Environment [(null)] - Using reflection optimizer 2010-03-30 23:29:42,481 [4] DEBUG NHibernate.Cfg.Configuration [(null)] - dialect=NHibernate.Dialect.MsSql2005Dialect ... 2010-03-30 23:29:42,501 [4] INFO NHibernate.Cfg.Configuration [(null)] - Mapping resource: MyApp.Domain.Mappings.hbm.xml 2010-03-30 23:29:43,342 [4] INFO NHibernate.Dialect.Dialect [(null)] - Using dialect: NHibernate.Dialect.MsSql2005Dialect 2010-03-30 23:29:50,462 [4] INFO NHibernate.Cfg.XmlHbmBinding.Binder [(null)] - Mapping class: ... 2010-03-30 23:29:51,353 [4] DEBUG NHibernate.Connection.DriverConnectionProvider [(null)] - Obtaining IDbConnection from Driver 2010-03-30 23:29:53,136 [4] DEBUG NHibernate.Connection.ConnectionProvider [(null)] - Closing connection

    Read the article

  • Difference between "Data Binding'","Data Hiding","Data Wraping" and "Encapsulation"?

    - by krishna Chandra
    I have been studying the conpects of Object oriented programming. Still I am not able to distinguish between the following concepts of object oriented programming.. a) Data Binding b) Data Hiding c) Data Wrapping d) encapsulation e) Data Abstraction I have gone through a lot of books ,and I also search the difference in google. but still I am not able to make the difference between these? Could anyone please help me ?

    Read the article

  • WPF binding to current class property

    - by AnD
    Hello, I have a problem that i cant solve :( I have a user control (xaml file and cs file) in xaml it's like: <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="Demo.CtrlContent" x:Name="UserControl" d:DesignWidth="598.333" d:DesignHeight="179.133" xmlns:Demo="clr-namespace:Demo" > <UserControl.Resources> <Storyboard x:Key="SBSmall"> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(FrameworkElement.Width)"> <SplineDoubleKeyFrame KeyTime="00:00:01" Value="I WANT TO BIND VALUE HERE"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </UserControl.Resources> <Border BorderBrush="#FFC2C0C1" CornerRadius="3,3,3,3" BorderThickness="1,1,1,1" RenderTransformOrigin="0.5,0.5" x:Name="border" Margin="1,3,1,3" HorizontalAlignment="Left" VerticalAlignment="Top" Width="300"> and .cs file: public partial class CtrlContent { private mindef W { get { return (mindef) Window.GetWindow(this); } } public double MedWidth { // I WANT BIND THIS VALUE GO TO STORYBOARD VALUE IN XAML ABOVE get { double actualW; if(W == null) actualW = SystemParameters.PrimaryScreenWidth; else actualW = W.WrapMain.ActualWidth; return actualW - border.Margin.Left - border.Margin.Right; } } public double SmlWidth { get { return MedWidth / 2; } } public CtrlContent () { this.InitializeComponent(); } public CtrlContent (Content content) { this.InitializeComponent(); Document = content; } } in my .cs file there's a property called MedWidth, and in XAML file there's a storyboard called: SBSmall I want to bind my storyboard value to my property in class ctrlcontent. *the idea is, the storyboard is an animation to resize the control to a certain width depends on its parent container (the width is dynamic) anybody? please :) thanks!

    Read the article

  • "Trying to get property of non-object" error with SimpleXML and PHP

    - by SooDesuNe
    I'm using a PHP script with SimpleXML to parse an XML feed. I have no control over the content of the XML. try { $xml = @new SimpleXMLElement($fetchResult); } catch (Exception $e) { errorHandle($e->getMessage());} $userNick = $xml->View->ScrollView->VBoxView->View->MatrixView->VBoxView[0]->HBoxView->TextView->SetFontStyle->b; foreach ($xml->View->ScrollView->VBoxView->View->MatrixView->VBoxView[0]->VBoxView as $pathToSubTree){ foreach ($pathToSubTree->MatrixView->View->VBoxView->VBoxView->HBoxView[0]->VBoxView->MatrixView->VBoxView as $canopy){ //Do some stuff now that we've found the canopy of the tree } $canopy = $pathToSubTree->MatrixView->View->VBoxView->VBoxView->HBoxView[0]->VBoxView->MatrixView->VBoxView; if(is_null($canopy)){ //Do some stuff stuff is the canopy was not traceable } } $pathToSubTree = $xml->View->ScrollView->VBoxView->View->MatrixView->VBoxView[0]->VBoxView; if(is_null($pathToSubTree)){ //Do some stuff stuff is the subTree path was not traceable } unset($xml); I'm getting lots of two errors, which I'm sure are related to the same cause: PHP Notice: Trying to get property of non-object in myScript.php on line 45 PHP Warning: Invalid argument supplied for foreach() in myScript.php on line 45 PHP Notice: Trying to get property of non-object in myScript.php on line 76 Line 45 is (from above): foreach ($pathToSubTree->MatrixView->View->VBoxView->VBoxView->HBoxView[0]->VBoxView->MatrixView->VBoxView as $canopy){ Line 76 is (from above): $canopy = $pathToSubTree->MatrixView->View->VBoxView->VBoxView->HBoxView[0]->VBoxView->MatrixView->VBoxView; I'm pretty sure this error is caused by one of the arrays in my path not being an array for the particular XML, but some times it CAN be an array. What's the correct way to deal with these?

    Read the article

  • WPF DatePicker IsEnabled property not changing appearance

    - by Jonathan
    I think I have found an issue with the DatePicker in the toolkit, perhaps some of you gurus can check it out. The issue is when setting the IsEnabled property of the DatePicker. If set in XAML, it stays grey even if you set the IsEnabled to true at run time. The same goes for the other way around should it start off being enabled. The button just changes the IsEnabled property of the date picker, you will see that when it becomes enabled, the style remains grayed out. <Window x:Class="WpfApplication3.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:tk="http://schemas.microsoft.com/wpf/2008/toolkit" Title="Window1" Height="300" Width="300"> <StackPanel> <tk:DatePicker x:Name="txtDate" IsEnabled="False"></tk:DatePicker> <Button Height="25" Click="Button_Click"></Button> </StackPanel> </Window> private void Button_Click(object sender, RoutedEventArgs e) { txtDate.IsEnabled = !txtDate.IsEnabled; }

    Read the article

  • JSF Page does not submit when onclick javascript is added to menu item?

    - by Padmarag
    I show some detail using popup windows. I want to close those when the user clicks on sign-out link. I have a JavaScript function that'll close the windows. The sign-out link is rendered using Navigation MenuModel. The definition in faces-config is as below - <managed-bean> <managed-bean-name>signoutNavigation</managed-bean-name> <managed-bean-class>com.xxx.xxx.framework.NavigationItem</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> <managed-property> <property-name>label</property-name> <value>Sign Out</value> </managed-property> <managed-property> <property-name>viewId</property-name> <value>/signout.jsp</value> </managed-property> <managed-property> <property-name>outcome</property-name> <value>signout</value> </managed-property> <managed-property> <property-name>onclick</property-name> <value>closeOrderWindows()</value> </managed-property> </managed-bean> The problem is when I use the "onclick" property on managed-bean, the page doesn't submit to "signout.jsp" and remains on same page. When I remove/comment the "onclick" part, the page gets submitted properly. I use MyFaces Trinidad.

    Read the article

< Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >