Search Results

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

Page 46/486 | < Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >

  • trouble with a javascript Cannot read property 'value' of

    - by Stanislas Piotrowski
    I've done a function but I do not understand why, a part of it does not work. Actualy I use the methode using className and Id. Here is the part of the code: var items = new Array(); var itemCount = document.getElementsByClassName("items"); for(var i = 0; i < itemCount.length; i++) { items[i] = document.getElementById("p"+(i+1)).value; } return items; } And in jsfiddle the html part that show that this Id exist. So it should not return to me this errors: Uncaught TypeError: Cannot read property 'value' of null fiddle.jshell.net:402 the concerned line is the following: items[i] = document.getElementById("p"+(i+1)).value; http://jsfiddle.net/Wt4qd/ Kind Regards SP.

    Read the article

  • Dynamically choosing css property in animation

    - by paddywhack
    Hi, It seems a straightforward thing but I'm not having much success. I'm just implementing a simple animation moving a div left or up using animate() but I would like to be able to set the "top" and "left" css properties dynamically. I would like to use the same function rather than have to have two, one for "left" and one for "top". Here's some code which gives the idea. function test($element){ $element.click(function(){ var cssProperty; var direction = "left"; var moveTo = "100px"; if (direction === "top") { cssProperty = "top"; } else { cssProperty = "left"; } /*Using variable as CSS property - This doesn't work */ $(this).animate({ cssProperty: moveTo }, 1000); /*Using variable as the CSS Values - This does */ $(this).animate({ left: moveTo }, 1000); }); } Variables works on the css value side but not on the css selector side. Anyone have any suggestions? Thanks

    Read the article

  • could not resolve property (complex properties)

    - by felipeoriani
    I have a asp.net mvc application with NHibernate and I do not know how to resolve a problem to query some data. I have this query: // create query var query = session.QueryOVer<Laudo>().Fetch(x => x.Equipament).Eager; // add some filters if (idEquipament.HasValue) query = query.And(x => x.Equipament.Id == idEquipament.Value); //I got the error here... if (idCompany.HasValue) query = query.And(x => x.Equipament.Company.Id == idCompany.Value); When I try to execute this query, I've got an exception with this message: "could not resolve property: Equipament.Company.Id of: DomainModel.Laudo" what can I do to fix this problem? Thanks

    Read the article

  • How does SET works with property in C#?

    - by Richard77
    Hello, I'd like to know how set works in a property when it does more than just setting the value of a private member variable. Let's say I've a private member in my class (private int myInt). For instance, I can make sure that the the value returned is not negative get { if(myInt < 0) myInt = 0; return myInt; } With SET, all I can do is affecting the private variable like so set { myInt = value; } I didn't see in any book how I can do more than that. How about if I wan't to do some operation before affecting the value to myInt? Let's say: If the value is negative, affect 0 to myInt. set { //Check if the value is non-negative, otherwise affect the 0 to myInt } Thanks for helping

    Read the article

  • Access property from include inside a class method in PHP

    - by Jojo
    How do you make a class property available to the other included file inside the same class' method? // file A.php class A { private $var = 1; public function go() { include('another.php'); } } in another file: // this is another.php file // how can I access class A->var? echo $var; // this can't be right Is this possible given the scope. If var is an array then we can use extract but if var is not, we can wrap it in an array. Is there a better way? Thanks!

    Read the article

  • TreeViewItem - Use ControlTemplate and HierarchicalDataTemplate together

    - by CrownJ
    I'm using HierarchicalDataTemplate in my TreeView, and I wanted to also overwrite the default template for the TreeViewItem so that when an item is selected, it only highlights the text, not including the icon next to it. <TreeView.ItemTemplate> <HierarchicalDataTemplate ItemsSource="{Binding Children}"> <TreeViewItem Style="{StaticResource TreeViewItemStyle}" Header="{Binding DisplayText}" /> </HierarchicalDataTemplate> </TreeView.ItemTemplate> <TreeView.Resources> <Style x:Key="TreeViewItemFocusVisual"> <Setter Property="Control.Template"> <Setter.Value> <ControlTemplate> <Rectangle/> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="ExpandCollapseToggleStyle" TargetType="{x:Type ToggleButton}"> <Setter Property="Focusable" Value="False"/> <Setter Property="Width" Value="19"/> <Setter Property="Height" Value="13"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ToggleButton}"> <Border Width="19" Height="13" Background="Transparent"> <Border Width="9" Height="9" SnapsToDevicePixels="true" BorderBrush="#FF7898B5" BorderThickness="1" CornerRadius="1"> <Border.Background> <LinearGradientBrush EndPoint="1,1" StartPoint="0,0"> <GradientStop Color="White" Offset=".2"/> <GradientStop Color="#FFC0B7A6" Offset="1"/> </LinearGradientBrush> </Border.Background> <Path x:Name="ExpandPath" Fill="Black" Margin="1,1,1,1" Data="M 0 2 L 0 3 L 2 3 L 2 5 L 3 5 L 3 3 L 5 3 L 5 2 L 3 2 L 3 0 L 2 0 L 2 2 Z"/> </Border> </Border> <ControlTemplate.Triggers> <Trigger Property="IsChecked" Value="True"> <Setter Property="Data" TargetName="ExpandPath" Value="M 0 2 L 0 3 L 5 3 L 5 2 Z"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="{x:Type TreeViewItem}" TargetType="{x:Type TreeViewItem}"> <Setter Property="Background" Value="Transparent"/> <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/> <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/> <Setter Property="Padding" Value="1,0,0,0"/> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> <Setter Property="FocusVisualStyle" Value="{StaticResource TreeViewItemFocusVisual}"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TreeViewItem}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition/> </Grid.RowDefinitions> <ToggleButton x:Name="Expander" Style="{StaticResource ExpandCollapseToggleStyle}" ClickMode="Press" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}"/> <StackPanel Orientation="Horizontal" Grid.Column="1" > <Image Width="16" Height="16" Margin="3,0" Source="{Binding Path=ImageSource}" /> <Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="0" Padding="0"> <ContentPresenter x:Name="PART_Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header"/> </Border> </StackPanel> <ItemsPresenter x:Name="ItemsHost" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1"/> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsExpanded" Value="false"> <Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed"/> </Trigger> <Trigger Property="HasItems" Value="false"> <Setter Property="Visibility" TargetName="Expander" Value="Hidden"/> </Trigger> <Trigger Property="IsSelected" Value="true"> <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/> <Setter Property="Control.Foreground" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/> </Trigger> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsSelected" Value="true"/> <Condition Property="IsSelectionActive" Value="false"/> </MultiTrigger.Conditions> <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/> <Setter Property="Control.Foreground" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> </MultiTrigger> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> <Trigger Property="VirtualizingStackPanel.IsVirtualizing" Value="true"> <Setter Property="ItemsPanel"> <Setter.Value> <ItemsPanelTemplate> <VirtualizingStackPanel/> </ItemsPanelTemplate> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style> </TreeView.Resources> I couldn't find a way to use both the HierarchicalDataTemplate and ControlTemplate together so I can specify the ItemsSource and also change parts of the control's behavior. When I do the above code, it won't select the treeviewitem at all.

    Read the article

  • During Spring unit test, data written to db but test not seeing the data

    - by richever
    I wrote a test case that extends AbstractTransactionalJUnit4SpringContextTests. The single test case I've written creates an instance of class User and attempts to write it to the database using Hibernate. The test code then uses SimpleJdbcTemplate to execute a simple select count(*) from the user table to determine if the user was persisted to the database or not. The test always fails though. I was suspect because in the Spring controller I wrote, the ability to save an instance of User to the db is successful. So I added the Rollback annotation to the unit test and sure enough, the data is written to the database since I can even see it in the appropriate table -- the transaction isn't rolled back when the test case is finished. Here's my test case: @ContextConfiguration(locations = { "classpath:context-daos.xml", "classpath:context-dataSource.xml", "classpath:context-hibernate.xml"}) public class UserDaoTest extends AbstractTransactionalJUnit4SpringContextTests { @Autowired private UserDao userDao; @Test @Rollback(false) public void teseCreateUser() { try { UserModel user = randomUser(); String username = user.getUserName(); long id = userDao.create(user); String query = "select count(*) from public.usr where usr_name = '%s'"; long count = simpleJdbcTemplate.queryForLong(String.format(query, username)); Assert.assertEquals("User with username should be in the db", 1, count); } catch (Exception e) { e.printStackTrace(); Assert.assertNull("testCreateUser: " + e.getMessage()); } } } I think I was remiss by not adding the configuration files. context-hibernate.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd> <bean id="namingStrategy" class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean"> <property name="staticField"> <value>org.hibernate.cfg.ImprovedNamingStrategy.INSTANCE</value> </property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" destroy-method="destroy" scope="singleton"> <property name="namingStrategy"> <ref bean="namingStrategy"/> </property> <property name="dataSource" ref="dataSource"/> <property name="mappingResources"> <list> <value>com/company/model/usr.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.use_sql_comments">true</prop> <prop key="hibernate.query.substitutions">yes 'Y', no 'N'</prop> <prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop> <prop key="hibernate.cache.use_query_cache">true</prop> <prop key="hibernate.cache.use_minimal_puts">false</prop> <prop key="hibernate.cache.use_second_level_cache">true</prop> <prop key="hibernate.current_session_context_class">thread</prop> </props> </property> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"/> <property name="nestedTransactionAllowed" value="false" /> </bean> <bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor"> <property name="transactionManager"> <ref local="transactionManager"/> </property> <property name="transactionAttributes"> <props> <prop key="create">PROPAGATION_REQUIRED</prop> <prop key="delete">PROPAGATION_REQUIRED</prop> <prop key="update">PROPAGATION_REQUIRED</prop> <prop key="*">PROPAGATION_SUPPORTS,readOnly</prop> </props> </property> </bean> </beans> context-dataSource.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="org.postgresql.Driver" /> <property name="jdbcUrl" value="jdbc\:postgresql\://localhost:5432/company_dev" /> <property name="user" value="postgres" /> <property name="password" value="postgres" /> </bean> </beans> context-daos.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> <bean id="extendedFinderNamingStrategy" class="com.company.dao.finder.impl.ExtendedFinderNamingStrategy"/> <bean id="finderIntroductionAdvisor" class="com.company.dao.finder.impl.FinderIntroductionAdvisor"/> <bean id="abstractDaoTarget" class="com.company.dao.impl.GenericDaoHibernateImpl" abstract="true" depends-on="sessionFactory"> <property name="sessionFactory"> <ref bean="sessionFactory"/> </property> <property name="namingStrategy"> <ref bean="extendedFinderNamingStrategy"/> </property> </bean> <bean id="abstractDao" class="org.springframework.aop.framework.ProxyFactoryBean" abstract="true"> <property name="interceptorNames"> <list> <value>transactionInterceptor</value> <value>finderIntroductionAdvisor</value> </list> </property> </bean> <bean id="userDao" parent="abstractDao"> <property name="proxyInterfaces"> <value>com.company.dao.UserDao</value> </property> <property name="target"> <bean parent="abstractDaoTarget"> <constructor-arg> <value>com.company.model.UserModel</value> </constructor-arg> </bean> </property> </bean> </beans> Some of this I've inherited from someone else. I wouldn't have used the proxying that is going on here because I'm not sure it's needed but this is what I'm working with. Any help much appreciated.

    Read the article

  • Why is the tooltip hiding Dash Search on 12.04?

    - by Anwar Shah
    Can I disable the tooltip shown at the side of the Launcher icon when hovered by the mouse. These are nice, but I want to disable them, because when I press "Dash Home" button on the launcher, then want to write something on the dash, I can't see the letters because of the tooltip. How can I disable the Unity tooltip from hiding search string in dash? I am using Ubuntu 12.04. I have given a screenshot of the launcher. My problem is basically with this Update 1 I have given advice to follow this answer in chat discussion, but nothing has changed. Update 2 As an answer suggests, I updated unity to the latest version. It is now unity 5.12.0. as the below output indicates $ unity --version unity 5.12.0

    Read the article

  • How to stop running pidgin at logins and disable window hiding feature?

    - by Behzadsh
    Every time I login into my desktop, pidgin start behind, and sometimes it's bothering me - e.g. when I'm not connected to Internet or when I don't want to be on-line - I check startup application list and there's no pidgin listed. another thing that is very bothering is hiding window feature or what ever it called. assume that you're using MusicTracker plug-in, your status is Busy and you're chatting with someone. when music change, status will change, and then buddy-list will disappear and chat window will minimize. Buddy-list is not important but minimizing chat window when you're chatting is bothering, Is there any way to make pidgin stop that?

    Read the article

  • Delphi: EReadError with message ‘Property PageNr does Not Exist’.

    - by lyborko
    Hi, I get SOMETIMES error message: EReadError with message 'Property PageNr does Not exist', when I try to run my own project. I am really desperate, because I see simply nothing what is the cause. The devilish is that it comes up sometimes but often. It concerns of my own component TPage. Here is declaration TPage = class(TCustomControl) // private FPaperHeight, FPaperWidth:Integer; FPaperBrush:TBrush; FPaperSize:TPaperSize; FPaperOrientation:TPaperOrientation; FPDFDocument: TPDFDocument; FPageNr:integer; procedure PaintBasicLayout; procedure PaintInterior; procedure SetPapersize(Value: TPapersize); procedure SetPaperHeight(Value: Integer); procedure SetPaperWidth(Value: Integer); procedure SetPaperOrientation(value:TPaperOrientation); procedure SetPaperBrush(Value:TBrush); procedure SetPageNr(Value:Integer); protected procedure CreateParams(var Params:TCreateParams); override; procedure AdjustClientRect(var Rect: TRect); override; public constructor Create(AOwner: TComponent);override; destructor Destroy;override; // function GetChildOwner:TComponent; override; procedure DrawControl(X,Y :integer; Dx,Dy:Double; Ctrl:TControl;NewCanvas:TCanvas); // procedure GetChildren(Proc:TGetChildProc; Root:TComponent); override; procedure Loaded; override; procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; procedure Paint; override; procedure PrintOnCanvas(X,Y:integer; rX,rY:Double; ACanvas:TCanvas); procedure PrintOnPDFCanvas(X,Y:integer); procedure PrintOnPrinterCanvas(X,Y:integer); procedure Resize; override; procedure SetPrintKind(APrintKind:TPrintKind; APrintGroupindex:Integer); published property PageNr:integer read FPageNr write SetPageNr; property PaperBrush: TBrush read FPaperBrush write SetPaperBrush; property PaperHeight: integer read FPaperHeight write SetPaperHeight; property PaperWidth: integer read FPaperWidth write SetPaperWidth; property PaperSize: TPaperSize read FPaperSize write SetPaperSize; property PaperOrientation:TPaperOrientation read FPaperOrientation write SetPaperOrientation; property PDFDocument:TPDFDocument read FPDFDocument write FPDFDocument; property TabOrder; end; I thoroughly read the similar topic depicted here: Delphi: EReadError with message 'Property Persistence does Not exist' But here it is my own source code. No third party. Interesting: when I delete PageNr property in my dfm file (unit1.dfm), then pops up : EReadError with message 'Property PaperHeight does Not exist'. when I delete PaperHeight then it will claim PaperWidth and so on... Here is piece of dfm file: object pg1: TPage Left = 128 Top = 144 Width = 798 Height = 1127 PageNr = 0 PaperHeight = 1123 PaperWidth = 794 PaperSize = psA4 PaperOrientation = poPortrait TabOrder = 0 object bscshp4: TBasicShape Left = 112 Top = 64 Width = 105 Height = 105 PrintKind = pkNormal PrintGroupIndex = 0 Zooming = 100 Transparent = False Repeating = False PageRepeatOffset = 1 ShapeStyle = ssVertical LinePosition = 2 end object bscshp5: TBasicShape Left = 288 Top = 24 Width = 105 Height = 105 PrintKind = pkNormal PrintGroupIndex = 0 Zooming = 100 Transparent = False What the hell happens ??????? I have never seen that. I compiled the unit several times... Encoutered no problem. Maybe the cause is beyond this. I feel completely powerless.

    Read the article

  • JQuery Json error: Object doesn't support this property or method

    - by Abu Hamzah
    ERROR: Microsoft JScript runtime error: Object doesn't support this property or method i am using WCF service to pull the data and its very simple for the purpose of test and it does returning me the data from wcf service but it fails on json2.js on line number 314-316 // We split the first stage into 4 regexp operations in order to work around // crippling inefficiencies in IE's and Safari's regexp engines. First we // replace all backslash pairs with '@' (a non-JSON character). Second, we // replace all simple value tokens with ']' characters. Third, we delete all // open brackets that follow a colon or comma or that begin the text. Finally, // we look to see that the remaining characters are only whitespace or ']' or // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. if (/^[\],:{}\s]*$/.test(text.replace(/\\["\\\/bfnrtu]/g, '@'). replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'). replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { here is what i am doing function serviceProxy(wjOrderServiceURL) { var _I = this; this.ServiceURL = wjOrderServiceURL; // *** Call a wrapped object this.invoke = function (options) { // Default settings var settings = { serviceMethod: '', data: null, callback: null, error: null, type: "POST", processData: false, contentType: "application/json", dataType: "text", bare: false }; if (options) { $.extend(settings, options); } function GetFederalHolidays() { $("#dContacts1").empty().html('Searching for Active Contacts...'); ContactServiceProxy.invoke({ serviceMethod: "Holidays", callback: function (response) { // ProcessActiveContacts1(response); debugger }, error: function (xhr, errorMsg, thrown) { postErrorAndUnBlockUI(xhr, errorMsg, thrown); } }); } any help what iam doing wrong? i try to change from dataType: text to json but i get the same error above.

    Read the article

  • "OutputPath property is not set" error occurs only when calling MSBuild in CCNET

    - by LostInCCNET
    I've made an MSBuild project that simply does an msbuild task with our solution file as parameter. I've defined a BeforeBuild target where I set some properties, and a Build target that executes the msbuild task. I've confirmed that no errors occured when building the msbuild script in the command line console. However, when I use it in the msbuild task in my CCNET project, I keep getting the following error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (483,9): error: The OutputPath property is not set for project 'MyProject.msbuild'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='AnyCPU'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. I checked the build log and it seems that the error occurs during _CheckForInvalidConfigurationAndPlatform. It wasn't even able to continue to my Build task! Since the script is only intended to build the solution under Debug/Release and AnyCPU as platform, I tried to add the following lines to my msbuild project: <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <OutputPath>.\bin\Debug\</OutputPath> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <OutputPath>.\bin\Release\</OutputPath> </PropertyGroup> I could still build the project without errors in the command line, but CCNET is returning the same error mentioned above. I don't understand why CCNET keeps getting the error, and I don't know what else to try. Please help.

    Read the article

  • WPF - Binding an ObservableCollection Dependency Property within a UserControl

    - by John
    I have a control class DragGrid : Grid { ... } which inherits from the original grid and enables dragging and resizing its child elements. I need to bind a custom DP named WorkItemsProperty to an observable collection of type WorkItem (implements INotifyPropertyChanged). Each element in the grid is bound to a collection item. Whenever the user adds a new item dynamically at runtime (the items cannot be declared in XAML!), or deletes an item from that collection, the WorkItems DP on the DragGrid should be updated, and the children in the grid (where each child represents a WorkItem collection item). My question is how does the DP notify the control about which child element in the grid must be removed, changed ('change' means user dragged an element, or resized it with the mouse) or added, and how would I identify which one of the existing children is the one that needs to be deleted or changed. I understand that this is where the DependencyPropertyChangedCallback comes in. But that only gets called when the DP property is set anew, not when something inside the collection changes (like add, remove item). So in the end, does the DragGrid control somehow need to subscribe to the CollectionChanged event? At what point would I hook up the event handler for that?

    Read the article

  • Binding "Text-Property" of a derived textbox to another textbox doesn´t work

    - by Jehof
    Hello, i have a class 'MyTextBox' that derives from the default TextBox in Silverlight. This class currently contains no additional code. I set up a binding in xaml to bind the Text-Property of MyTextbox to another Textbox to reflect the input made in the Textbox. The effect is that MyTextBox doesn´t update and not display the text of the other Textbox. Additional i made an equal binding for a normal Textbox. And this works. Here´s the XAML for the bindings. <UserControl x:Class="Silverlight.Sample.Dummy" 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" xmlns:my="clr-namespace:Sample" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <StackPanel x:Name="LayoutRoot" Background="White"> <TextBox Height="23" x:Name="textBox2" Width="120" /> <TextBox Text="{Binding ElementName=textBox2, Path=Text, Mode=TwoWay}" Width="120" /> <my:NumberTextBox Width="120" Text="{Binding ElementName=textBox2, Path=Text, Mode=OneWay}" /> </StackPanel> Is there something special to set for binding, when i derive from a control. PS: I tried a binding to a dummy object with INotifyPropertyChanged and set it as DataContext for the existing Textboxes. This test works as expected and my derived textbox gets updated.

    Read the article

  • JQuery UI function errors out: Object is not a property or method

    - by Luke101
    In the following code I get an error that says autocomplete function Object is not a property or method Here is the code: <title><%= ViewData["pagetitle"] + " | " + config.Sitename.ToString() %></title> <script src="../../Scripts/jqueryui/jquery-ui-1.8.1.custom/development-bundle/ui/minified/jquery.ui.core.min.js" type="text/javascript"></script> <script src="../../Scripts/jqueryui/jquery-ui-1.8.1.custom/development-bundle/ui/minified/jquery.ui.core.min.js" type="text/javascript"></script> <script src="../../Scripts/jqueryui/jquery-ui-1.8.1.custom/development-bundle/ui/jquery.ui.widget.js" type="text/javascript"></script> <script src="../../Scripts/jqueryui/jquery-ui-1.8.1.custom/development-bundle/ui/jquery.ui.position.js" type="text/javascript"></script> <script src="../../Scripts/jqueryui/jquery-ui-1.8.1.custom/development-bundle/ui/jquery.ui.autocomplete.js" type="text/javascript"></script> <script language="javascript" type="text/javascript" src="/Scripts/main.js"></script> <script language="javascript" type="text/javascript"> $(document).ready(function () { Categories(); $('#tags1').autocomplete({ //error here url: '/Tag/TagAutoComplete', width: 320, max: 4, delay: 30, cacheLength: 1, scroll: false, highlight: false }); }); </script>

    Read the article

  • [WPF] ComboBox.Text not taking the ItemStringFormat property into account

    - by Thomas Levesque
    I just noticed a strange behavior which looks like a bug. Consider the following XAML : <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib"> <Page.Resources> <x:Array x:Key="data" Type="{x:Type sys:String}"> <sys:String>Foo</sys:String> <sys:String>Bar</sys:String> <sys:String>Baz</sys:String> </x:Array> </Page.Resources> <StackPanel Orientation="Vertical"> <Button>Boo</Button> <ComboBox Name="combo" ItemsSource="{Binding Source={StaticResource data}}" ItemStringFormat="##{0}##" /> <TextBlock Text="{Binding Text, ElementName=combo}"/> </StackPanel> </Page> The ComboBox displays the values as "##Foo##", "##Bar##" and "##Baz##". But the TextBlock displays the selected values as "Foo", "Bar" and "Baz". So the ItemStringFormat is apparently ignored for the Text property... Is that a bug ? If it is, is there a workaround ? Or am I just doing something wrong ?

    Read the article

  • How To Raise Property Changed events on a Dependency Property?

    - by Muad'Dib
    OK, so I have this control with two properties. One of these is a DependencyProperty, the other is an "alias" to the first one. What I need to be able to do is raise the PropertyChanged event for the second one (the alias) when the first one is changed. NOTE: I am using DependencyObjects, not INotifyPropertyChanged (tried that, didn't work because my control is a sub-classed ListView) something like this..... protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) { base.OnPropertyChanged(e); if (e.Property == MyFirstProperty) { RaiseAnEvent( MySecondProperty ); /// what is the code that would go here? } } If I were using an INotify I could do like this... public string SecondProperty { get { return this.m_IconPath; } } public string IconPath { get { return this.m_IconPath; } set { if (this.m_IconPath != value) { this.m_IconPath = value; this.SendPropertyChanged("IconPath"); this.SendPropertyChanged("SecondProperty"); } } } where I can raise PropertyChanged events on multiple properties from one setter. I need to be able to do the same thing, only using DependencyProperties.

    Read the article

  • 'ErrorMessageResourceType' property specified was not found. on XmlSerialise

    - by Redeemed1
    In my ASP.Net MVC app I have a Model layer which uses localised validation annotations on business objects. The code looks like this: [XmlRoot("Item")] public class ItemBo : BusinessObjectBase { [Required(ErrorMessageResourceName = "RequiredField", ErrorMessageResourceType = typeof(StringResource))] [HelpPrompt("ItemNumber")] public long ItemNumber { get; set; } This works well. When I want to serialise the object to xml I get the error: "'ErrorMessageResourceType' property specified was not found" (although it is lost beneath other errors, it is the innerexception I am trying to work on. The problem therefore is the use of the DataAnnotations attributes. The relevant resource files are in another assembly and are marked as 'public' and as I said everything works well until I get to serialisation. I have references to the relevant DataAnnotations class etc in my nunit tests and target class. By the way, the HelpPrompt is another data annotation I have defined elsewhere and is not causing the problem. Furthermore if I change the Required attribute to the standard format as follows, the serialisation works ok. [Required(ErrorMessage="Error")] Can anyone help me?

    Read the article

  • DataGridViewColumn.DataPropertyName Property

    - by Captain Comic
    Hi I have a DataGridView control and I want to populate it with data. I use DataSource property // dgvDealAsset is DataGridView private void DealAssetListControl_Load(object sender, EventArgs e) { dgvDealAssets.AutoGenerateColumns = false; dgvDealAssets.DataSource = DealAssetList.Instance.Values.ToList(); } Now problem number one. The class of my collection does not contain only simple types that I can map to columns using DataPropertyName. This is the class that is contained in collection. class MyClass { public String Name; MyOtherClass otherclass; } class MyOtherClass { public String Name; } Now I am binding properties of MyClass to columns col1.DataPropertyName = "Name" // Ok col2.DataPropertyName = "otherclass" // Not OK - I will have empty cell The problem is that I want to display otherclass.Name field. But if I try to write col2.DataPropertyName = "otherclass.Name" I get empty cell. I tried to manually set the column private void DealAssetListControl_Load(object sender, EventArgs e) { dgvDealAssets.AutoGenerateColumns = false; dgvDealAssets.DataSource = DealAssetList.Instance.Values.ToList(); // iterate through rows and set the column manually foreach (DataGridViewRow row in dgvDealAssets.Rows) { row.Cells["Column2"].Value = ((DealAsset)row.DataBoundItem).otherclass.Name; } But this foreach cycle takes about minute to complete (2k elements). How to solve this problem?

    Read the article

  • "Permission denied to access property 'href' from a non-chrome context" in JavaScript and OpenLayers

    - by Mark Iliffe
    This is really two questions one leading into the other. Firstly what does 'Permission denied to access property 'href' from a non-chrome context' actually mean? Secondly I am using overlays in OpenLayers and wish to change the opacity of said layers, this is where this error is being thrown the code of which is here... <input id='opacity' value="1.0" onChange="changeOpacity()"> Of which changeOpacity() is the following function... function changeOpacity() { var newOpacity = parseFloat(OpenLayers.Util.getElement('opacity').value); newOpacity = Math.min(1.0, Math.max(0.1, newOpacity)); OpenLayers.Util.getElement('opacity').value = newOpacity; for (var i=0; i<images.length; i++) { layers[images[i]].setOpacity(newOpacity); } } which throws the error at "var href = originalElement.href;" here... function mD(e) { //what is originalElement/srcElement/originalTarget? var originalElement = e.srcElement || e.originalTarget; var href = originalElement.href; if (originalElement.nodeName == "A" && href.match("http://www.openstreetmap.org/browse/")) { href = href.replace('http://www.openstreetmap.org/browse/','http://www.openstreetmap.org/api/0.6/'); if (gml) { map.removeLayer(gml); } //$("status").innerHTML = 'loading'; } gml = new OpenLayers.Layer.GML("OSM", href, {format: OpenLayers.Format.OSM}); map.addLayer(gml); gml.preFeatureInsert = style_osm_feature; var sf = new OpenLayers.Control.SelectFeature(gml, {'onSelect': on_feature_hover}); map.addControl(sf); sf.activate(); return false; } } Any help/ideas is great appreciated! I am using firefox 3.5.9 and firebug 1.5.4

    Read the article

  • 'System.Web.UI.Control.Controls' is a 'property' but is used like a 'type'

    - by senzacionale
    What i am doing wrong? I extend LinkButton and i get this error Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0118: 'System.Web.UI.Control.Controls' is a 'property' but is used like a 'type' Source Error: Line 1084: Line 1085: public void @_DataBinding_control30(object sender, System.EventArgs e) { Line 1086: ConfirmButton.Controls.ConfirmLinkButton dataBindingExpressionBuilderTarget; Line 1087: System.Web.UI.IDataItemContainer Container; Line 1088: dataBindingExpressionBuilderTarget = ((ConfirmButton.Controls.ConfirmLinkButton)(sender)); This is C# code: [Localizable(true)] public string Message { get { return ViewState["Message"] as string; } set { ViewState["Message"] = value; } } #region Overriden protected override void OnPreRender(EventArgs e) { if (!String.IsNullOrEmpty(Message)) { WebControlUtils.SetConfirmationMessage(Page, typeof (Page), this, Message, Page.IsAsyncPostBack(), CausesValidation); } base.OnPreRender(e); } #endregion ASPX CODE: <asp:TemplateField> <ItemTemplate> <asp:ConfirmLinkButton ID="lnkBtnDelete" runat="server" Text="Odstrani" Message="Delete?" CommandName="DeleteAgencie" Width="50" CommandArgument='<%# Eval("idAgencies") %>' OnCommand="lnkBtnDelete_Command" CausesValidation="False"></asp:ConfirmLinkButton> </ItemTemplate> </asp:TemplateField> Regards

    Read the article

  • get property from XML using PHP

    - by Adnan
    Hello, I am using PHP's SimpleXML to get some values out of the following XML; - <entry> <id>http://www.google.com/m8/feeds/contacts/email_address%40gmail.com/base/0</id> <updated>2010-01-14T22:06:26.565Z</updated> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact" /> <title type="text">Customer Name</title> <link rel="http://schemas.google.com/contacts/2008/rel#edit-photo" type="image/*" href="http://www.google.com/m8/feeds/photos/media/email_address%40gmail.com/0/34h5jh34j5kj3444" /> <link rel="self" type="application/atom+xml" href="http://www.google.com/m8/feeds/contacts/email_address%40gmail.com/full/0" /> <link rel="edit" type="application/atom+xml" href="http://www.google.com/m8/feeds/contacts/email_address%40gmail.com/full/0/5555" /> <gd:email rel="http://schemas.google.com/g/2005#other" address="[email protected]" primary="true" /> </entry> I can get the title with: $xml = new SimpleXMLElement($response_h1); foreach ($xml->entry as $entry) { echo $entry->title, '<br />'; } But how to get the address="[email protected]" property?

    Read the article

  • Jackson object mapping - map incoming JSON field to protected property in base class

    - by Pete
    We use Jersey/Jackson for our REST application. Incoming JSON strings get mapped to the @Entity objects in the backend by Jackson to be persisted. The problem arises from the base class that we use for all entities. It has a protected id property, which we want to exchange via REST as well so that when we send an object that has dependencies, hibernate will automatically fetch these dependencies by their ids. Howevery, Jackson does not access the setter, even if we override it in the subclass to be public. We also tried using @JsonSetter but to no avail. Probably Jackson just looks at the base class and sees ID is not accessible so it skips setting it... @MappedSuperclass public abstract class AbstractPersistable<PK extends Serializable> implements Persistable<PK> { @Id @GeneratedValue(strategy = GenerationType.AUTO) private PK id; public PK getId() { return id; } protected void setId(final PK id) { this.id = id; } Subclasses: public class A extends AbstractPersistable<Long> { private String name; } public class B extends AbstractPersistable<Long> { private A a; private int value; // getter, setter // make base class setter accessible @Override @JsonSetter("id") public void setId(Long id) { super.setId(id); } } Now if there are some As in our database and we want to create a new B via the REST resource: @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Transactional public Response create(B b) { if (b.getA().getId() == null) cry(); } with a JSON String like this {"a":{"id":"1","name":"foo"},"value":"123"}. The incoming B will have the A reference but without an ID. Is there any way to tell Jackson to either ignore the base class setter or tell it to use the subclass setter instead? I've just found out about @JsonTypeInfo but I'm not sure this is what I need or how to use it. Thanks for any help!

    Read the article

  • Getting Service Tag from Dell Machine using .net?

    - by JonH
    Hello folks I've got a class that pulls model information (hardware info) for a local machine code is like so: Imports System.Management Public Class clsWMI Private objOS As ManagementObjectSearcher Private objCS As ManagementObjectSearcher Private objMgmt As ManagementObject Private m_strComputerName As String Private m_strManufacturer As String Private m_StrModel As String Private m_strOSName As String Private m_strOSVersion As String Private m_strSystemType As String Private m_strTPM As String Private m_strWindowsDir As String Public Sub New() objOS = New ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem") objCS = New ManagementObjectSearcher("SELECT * FROM Win32_ComputerSystem") For Each objMgmt In objOS.Get m_strOSName = objMgmt("name").ToString() m_strOSVersion = objMgmt("version").ToString() m_strComputerName = objMgmt("csname").ToString() m_strWindowsDir = objMgmt("windowsdirectory").ToString() Next For Each objMgmt In objCS.Get m_strManufacturer = objMgmt("manufacturer").ToString() m_StrModel = objMgmt("model").ToString() m_strSystemType = objMgmt("systemtype").ToString m_strTPM = objMgmt("totalphysicalmemory").ToString() Next End Sub Public ReadOnly Property ComputerName() Get ComputerName = m_strComputerName End Get End Property Public ReadOnly Property Manufacturer() Get Manufacturer = m_strManufacturer End Get End Property Public ReadOnly Property Model() Get Model = m_StrModel End Get End Property Public ReadOnly Property OsName() Get OsName = m_strOSName End Get End Property Public ReadOnly Property OSVersion() Get OSVersion = m_strOSVersion End Get End Property Public ReadOnly Property SystemType() Get SystemType = m_strSystemType End Get End Property Public ReadOnly Property TotalPhysicalMemory() Get TotalPhysicalMemory = m_strTPM End Get End Property Public ReadOnly Property WindowsDirectory() Get WindowsDirectory = m_strWindowsDir End Get End Property End Class Any possibility to get a service tag from WMI ? From the client side form I display values like so: Dim objWMI As New clsWMI() With objWMI Debug.WriteLine("Computer Name = " & .ComputerName) Me.Label1.Text = "Name: " & .ComputerName Debug.WriteLine("Computer Manufacturer = " & .Manufacturer) Me.Label2.Text = "Manufacturer: " & .Manufacturer Debug.WriteLine("Computer Model = " & .Model) Me.Label3.Text = "Model: " & .Model Debug.WriteLine("OS Name = " & .OsName) Me.Label4.Text = "OS Name: " & .OsName Debug.WriteLine("OS Version = " & .OSVersion) Me.Label5.Text = "OS VERSION: " & .OSVersion Debug.WriteLine("System Type = " & .SystemType) Me.Label6.Text = "System type = " & .SystemType Debug.WriteLine("Total Physical Memory = " & .TotalPhysicalMemory) Me.Label7.Text = "Memory: " & .TotalPhysicalMemory Debug.WriteLine("Windows Directory = " & .WindowsDirectory) Me.Label8.Text = "Win Directory: " & .WindowsDirectory End With

    Read the article

  • How to access generic property without knowing the closed generic type

    - by Martin Booka Weser
    I have a generic Type as follows public class TestGeneric<T> { public T Data { get; set; } public TestGeneric(T data) { this.Data = data; } } If i have now an object (which is coming from some external source) from which i know that it's type is of some closed TestGeneric<, but i don't know the TypeParameter T. Now I need to access the Data of my object. Problem is that i can't cast the object, since i don't know exactly to which closed TestGeneric. I use // thx to http://stackoverflow.com/questions/457676/c-reflection-check-if-a-class-is-derived-from-a-generic-class private static bool IsSubclassOfRawGeneric(Type rawGeneric, Type subclass) { while (subclass != typeof(object)) { var cur = subclass.IsGenericType ? subclass.GetGenericTypeDefinition() : subclass; if (rawGeneric == cur) { return true; } subclass = subclass.BaseType; } return false; } to make sure, my object is of the generic type. The code in question is as follows: public static void Main() { object myObject = new TestGeneric<string>("test"); // or from another source if (IsSubclassOfRawGeneric(typeof(TestGeneric<>), myObject.GetType())) { // the following gives an InvalidCastException // var data = ((TestGeneric<object>)myObject).Data; // if i try to access the property with reflection // i get an InvalidOperationException var dataProperty = typeof(TestGeneric<>).GetProperty("Data"); object data = dataProperty.GetValue(myObject, new object[] { }); } } I need the Data regardless of its type (well, if i could ask for its type using GetType() would be fine, but not necessary) since i just want to dump it in xml using ToString(). Any suggestions? Thanx.

    Read the article

< Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >