Search Results

Search found 6420 results on 257 pages for 'mathieu parent'.

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

  • How do I center a GridView in its LinearLayout parent ?

    - by Jacques René Mesrine
    GridView is not behaving like it is supposed to. This screenshot shows that the GridView (in landscape mode) is flushed left. I want it centered. This is the XML layout for the GridView. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/templatelandscape" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <GridView android:id="@+id/commandsbarlandscape" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0" android:layout_alignParentTop="true" android:layout_centerInParent="true" android:padding="0dp" android:verticalSpacing="2dp" android:horizontalSpacing="2dp" android:numColumns="auto_fit" android:columnWidth="52dp" android:stretchMode="spacingWidth" android:gravity="fill_horizontal" / What am I doing wrong ?

    Read the article

  • In WPF, how do I get a command in a Control Template to bind to a property in a parent?

    - by Keith
    I am relatively new to WPF and sometimes it makes my head explode. However, I do like the power behind it, especially when used with the MVVM model. I have a control template that contains a button. I use that control template inside of a custom control. I want to add a property on the custom control that will bind to the command property of the button inside the control template. Basically, it is a combo box with a button to the right of it to allow a user to pop up a search dialog. Since this control could appear on a usercontrol multiple times, I need to be able to potentially bind each control to a different command (Searh products, search customers, etc). However, I have been unable to figure out how to do this Here is some sample XAML <Style TargetType="{x:Type m:SelectionFieldControl}"> <Setter Property="LookupTemplate" Value="{StaticResource LookupTemplate}" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type m:SelectionFieldControl}"> <Border BorderThickness="{TemplateBinding Border.BorderThickness}" Padding="{TemplateBinding Control.Padding}" BorderBrush="{TemplateBinding Border.BorderBrush}" Background="{TemplateBinding Panel.Background}" SnapsToDevicePixels="True" Focusable="False"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" MinWidth="0" SharedSizeGroup="{Binding LabelShareSizeGroupName, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type m:BaseFieldControl}}}" /> <ColumnDefinition Width="1*" /> <ColumnDefinition Width="Auto" SharedSizeGroup="{Binding WidgetsShareSizeGroupName, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type m:BaseFieldControl}}}" /> </Grid.ColumnDefinitions> <!-- Customized Value Part --> <ComboBox x:Name="PART_Value" Grid.Column="1" Margin="4,2,0,1" SelectedValue="{Binding Path=SelectionField.Value, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type m:SelectionFieldControl}}}" IsEnabled="{Binding Field.IsNotReadOnly, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type m:SelectionFieldControl}}}" Visibility="{Binding Field.IsInEditMode, Converter={StaticResource TrueToVisible}, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type m:SelectionFieldControl}}}" FontFamily="{StaticResource FontFamily_Default}" FontSize="11px"> <ComboBox.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel IsVirtualizing="True" VirtualizationMode="Recycling"/> </ItemsPanelTemplate> </ComboBox.ItemsPanel> </ComboBox> <StackPanel Grid.Column="2" Orientation="Horizontal" Name="PART_Extra" Focusable="False"> <ContentControl Name="PART_LookupContent" Template="{Binding LookupTemplate, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type m:SelectionFieldControl}}}" Focusable="False"/> </StackPanel> </Grid> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> I thought I could get it to work by doing something like this <Button Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type SelectionFieldControl}}, Path=ShowSearchCommand}" Margin="2" /> but it does not work. Any help would be greatly appreciated.

    Read the article

  • How to ajax load a parent-child listbox in JQuery/Asp.net MVC popup?

    - by melaos
    hi guys, i'm new to the asp.net mvc. and i have a link which will popup show a 3 panes listbox which allows the user to select country, region and language. and when the user click on the language, this will redirect back to the controller and refresh the page and show the proper localized content. i was thinking of using a jquery dialog/modal to do this but so i try using fancybox for this which will load the hidden div of the three listbox up. unfortunately, on clicking on the first listbox, the page will call a jquery event which will show the populate the 2nd list box in which the lightbox will close. is there a better way to do this? or i'm not using the proper jquery plugin? i was thinking of putting the whole three panes inside a html file and do ajax call to get the content into that page and load the listbox like that and just use the html popup like a normal popup. Any suggestions? i'm stuck, help!!

    Read the article

  • add a div.class in a child, only when the parent does not have other div.class

    - by armandfp
    i have a html code like this: <div class="someclass"> <div class="childclass"></div> <div class="checkclass"></div> </div> <div class="someclass"> <div class="childclass"></div> </div> <div class="someclass"> <div class="childclass"></div> <div class="checkclass"></div> </div> <div class="someclass"> <div class="childclass"></div> <div class="checkclass"></div> </div> <div class="someclass"> <div class="childclass"></div> </div> and i need to add a div only on those divs that dont have that "checkclass", so it will like this: <div class="someclass"> <div class="childclass"></div> <div class="checkclass"></div> </div> <div class="someclass"> <div class="childclass"></div> <div class="newclass"></div> </div> <div class="someclass"> <div class="childclass"></div> <div class="checkclass"></div> </div> <div class="someclass"> <div class="childclass"></div> <div class="checkclass"></div> </div> <div class="someclass"> <div class="childclass"></div> <div class="newclass"></div> </div> i tried with jquery something like: $('.someclase:not(children(hasClass(checkclass))').append('<div class="newclass"></div>'); $('.someclass:not(:children(.checkclass))').append('<div class="newclass"></div>'); $('.someclass > :not(.checkclass)').append('<div class="newclass"></div>'); but still nothing, any ideas?

    Read the article

  • How to generate proxy for a child class when my web service return a parent class?

    - by Amir Borzoei
    Hi * I have a web method like this: public class ParentClass{ public String str1; } public class ChildClass : ParentClass{ public String str2; } public class WebService{ public ParentClass WebMethod(){ return GetFirstChildClass(); //Return a child class } } When I generate proxy for this web service by Visual Studio, VS just generate proxy for ParentClass but I need ChildClass too. For workaround I add a dummy method to WebService that return ChildClass to generate proxy for ChildClass in client. public class WebService{ ... //This is a dummy method to generate proxy for ChildClass in client. public ChildClass DummyWebMethod(){ return null; } } In addition I write web service in java (JAX-WS) and my client is a SilverLight Application. Is there a better solution for this problem? tanx for your help ;)

    Read the article

  • where to enlist transaction with parent child delete (repository or bll)?

    - by Caroline Showden
    My app uses a business layer which calls a repository which uses linq to sql. I have an Item class that has an enum type property and an ItemDetail property. I need to implement a delete method that: (1) always delete the Item (2) if the item.type is XYZ and the ItemDetail is not null, delete the ItemDetail as well. My question is where should this logic be housed? If I have it in my business logic which I would prefer, this involves two separate repository calls, each of which uses a separate datacontext. I would have to wrap both calls is a System.Transaction which (in sql 2005) get promoted to a distributed transaction which is not ideal. I can move it all to a single repository call and the transaction will be handled implicitly by the datacontext but feel that this is really business logic so does not belong in the repository. Thoughts? Carrie

    Read the article

  • Singleton with inheritance, Derived class is not able to get instantiated in parent?

    - by yesraaj
    Below code instantiates a derived singleton object based on environment variable. The compiler errors saying error C2512: 'Dotted' : no appropriate default constructor. I don't understand what the compiler is complaining about. #include <stdlib.h> #include <iostream> #include <string> using namespace std; class Dotted; class Singleton{ public: static Singleton instant(){ if (!instance_) { char * style = getenv("STYLE"); if (!style){ if (strcmp(style,"dotted")==0) { instance_ = new Dotted(); return *instance_; } } else{ instance_ = new Singleton(); return *instance_; } } return *instance_; } void print(){cout<<"Singleton";} ~Singleton(){}; protected: Singleton(){}; private: static Singleton * instance_; Singleton(const Singleton & ); void operator=(const Singleton & ); }; class Dotted:public Singleton{ public: void print(){cout<<"Dotted";} protected: Dotted(); }; Dotted::Dotted():Singleton(){} int main(){ Singleton::instant().print(); cin.get(); }

    Read the article

  • PHP5 : Applying a method from an extended class on an object from the original (parent) class.

    - by Glauber Rocha
    Hello, I'm trying to extend two native PHP5 classes (DOMDocument and DOMNode) to implement 2 methods (selectNodes and selectSingleNode) in order to make XPath queries easier. I thought it would be rather straighforward, but I'm stuck in a problem which I think is an OOP beginner's issue. class nDOMDocument extends DOMDocument { public function selectNodes($xpath){ $oxpath = new DOMXPath($this); return $oxpath->query($xpath); } public function selectSingleNode($xpath){ return $this->selectNodes($xpath)->item(0); } } Then I tried to do extend DOMNode to implement the same methods so I can perform an XPath query directly on a node: class nDOMNode extends DOMNode { public function selectNodes($xpath){ $oxpath = new DOMXPath($this->ownerDocument,$this); return $oxpath->query($xpath); } public function selectSingleNode($xpath){ return $this->selectNodes($xpath)->item(0); } } Now if I execute the following code (on an arbitrary XMLDocument): $xmlDoc = new nDOMDocument; $xmlDoc->loadXML(...some XML...); $node1 = $xmlDoc->selectSingleNode("//item[@id=2]"); $node2 = $node1->selectSingleNode("firstname"); The third line works and returns a DOMNode object $node1. However, the fourth line doesn't work because the selectSingleNode method belongs to the nDOMNode class, not DOMNode. So my question: is there a way at some point to "transform" the returned DOMNode object into a nDOMNode object? I feel I'm missing some essential point here and I'd greatly appreciate your help. (Sorry, this is a restatement of my question http://stackoverflow.com/questions/2573820/)

    Read the article

  • how to place last div into right top corner of parent div? (css)

    - by Radek
    can I somehow using css place the block2 in right top corner of block1? Note that block2 must be the (very) last inside html code of block1 or it could be placed after block1. I cannot make it the first element in block1 <html> <head> <style type="text/css"> .block1 {color:red;width:100px;border:1px solid green;} .block2 {color:blue;width:70px;border:2px solid black;position:relative;} </style> </head> <body> <div class='block1'> <p>text</p> <p>text2</p> <div class='block2'>block2</DIV> </div> </body> </html>

    Read the article

  • How to refresh parent and ancestor windows after closing the child windows?

    - by truthseeker
    Hi, I have three windows: 1st - main window 2nd - child window - it's opened using window.showModalDialog from 1st widnow. 3rd - window - is an ancestor of 1st window and is's opened from 2nd window using window.showModalDialog. And now what I need to achieve is to open 1, 2 and 3 window. Next after closing the 3rd one, refresh the 2nd one. And after closing the 2nd one, refresh the 1st one. But there is one more assumption, I don't want to have any post-back during this process. Dose anybody have any idea how to make it?

    Read the article

  • How to add and relate a node within the parent nodes add form in Drupal.

    - by Espen Christensen
    Hi, I want to accomplish the following scenario in Drupal: You have 2 content-types. Lets say, an application-form for a lisence, and a content-type for persons. Then when you go to add a lisence in the "node/add" submission form in Drupal, i would like to add a relative number of persons that would be related to this lisence, and only this lisence. Say you would like to apply for a lisence, and relate 4 persons to this lisence, then insted of creating the lisence and then create the 4 persons and relate them to the lisence, i would like to do this "inline". So when i add a lisence, there would be a way to add 1 or more persons that would relate to the lisence node. Is this possible, and if so how? I have been looking at the node reference module, and that manages to reference a node to another, but not to add them inline with the other. With the web-development framework Django, there is a way to this with something called "inline-editing", where you get the content-type fields inside another content-type creation form. There you bind them togheter with a ForeignKey. Anybody know of something simular in Drupal, if not, is it another way to achive something simular, that would be as user-friendly?

    Read the article

  • How to let parent control know that its child got focus?

    - by Axarydax
    Hi there, imagine that I have a Form with 9 controls (TabbedStuffControl) in a 3x3 tile, and these controls contain TabControls containing another control (StuffControl) with ListBoxes and TextBoxes. I'd like to know a proper way to let TabbedStuffControl that its child has received a focus? e.g. user clicks into a textbox of StuffControl or drags something to listbox of StuffControl. Eventually the Form should know which TabbedStuffControl is active Do I need to hook up GotFocus event of TextBoxes and ListBoxes and TabControls, then dispatch another event to finally let Form know who got focus? I think that there should be a simpler way - that somehow TabbedStuffControl knows that its child got focus, so there would be only one place in code that I'll hook up. Thanks.

    Read the article

  • Create a UIView Subclass that calls a delegate function whenever it's parent viewController appears?

    - by Andrew Johnson
    UIViewControllers have viewWillAppear, viewDidDisappear, etc. delegate methods. I would like to create a UIView subclass that can be added to a viewController's view, and when that UIViewController apears or disappears, a delegate function is called. I could easily do this by putting function calls in the UIViewController viewWillAppear/viewWillDisappear delegate functions, but how can I encapsulate this behavior in the UIView?

    Read the article

  • Clarification needed: How does .NET runtime resolve assembly references from parent folder?

    - by aoven
    I have the following output structure of executables in my solution: %ProgramFiles% | +-[MyAppName] | +-[Client] | | | +-(EXE & several DLL assemblies) | +-[Common] | | | +-[Schema Assemblies] | | | | | +-(several DLL assemblies) | | | +-(several DLL assemblies) | +-[Server] | +-(EXE & several DLL assemblies) Each project in solution references different DLL assemblies, some of which are outputs from other projects in solution, and others are plain 3rd-party assemblies. For example, [Client] EXE might reference an assembly in [Common], which is in a different directory branch. All references have "Copy Local" set to false, to mirror the layout of the files in the final installed application. Now, if I take a look at reference properties in the Visual Studio IDE, I see that "Path" of every reference is absolute and that it corresponds to the actual output location of the assembly. That's understandable and correct. As expected, solution compiles and runs just fine. What I don't understand is, why everything seems to work even when I close the IDE, rename the [MyAppName] directory and run the [Client] EXE manually? How does the runtime find the assemblies if the reference paths aren't the same as they were at the time of linking? To be clear - this is actually exactly what I'm after: a semi-dispersed set of application files that run fine regardless of where the [MyAppName] directory is located or even what it's named. I'd just like to know, how and why this works without any specific path resolution on my part. I've read the answers to this similar question, but I still don't get it. Help much appreciated!

    Read the article

  • How can I pass a mouse click to a parent control?

    - by grimus
    In a Silverlight 2 app, I am using Rectangles on a Canvas to draw a representation of data. I would like to have mouse clicks on the Rectangles be passed on to the control that owns the Canvas. I would also like to be able to show a tooltip with a summary of the data when the mouse is over a Rectangle. So far I've only been able to achieve one item or the other. If I make the Rectangles have their IsHitTestVisible property = false, the tooltips don't work, but the owning control will receive the mouse clicks. If I set it to true, then tooltips do work, but the clicks don't get passed on. Is there a way to have a Silverlight item be IsHitTestvisible = true, and pass on the mouse clicks?

    Read the article

  • Why isn't the static constructor of the parent class called when invoking a method on a nested class

    - by Ryan Ische
    Given the following code, why isn't the static constructor of "Outer" called after the first line of "Main"? namespace StaticTester { class Program { static void Main( string[] args ) { Outer.Inner.Go(); Console.WriteLine(); Outer.Go(); Console.ReadLine(); } } public static partial class Outer { static Outer() { Console.Write( "In Outer's static constructor\n" ); } public static void Go() { Console.Write( "Outer Go\n" ); } public static class Inner { static Inner() { Console.Write( "In Inner's static constructor\n" ); } public static void Go() { Console.Write( "Inner Go\n" ); } } } }

    Read the article

  • JavaScript: Given an offset and substring length in an HTML string, what is the parent node?

    - by Bungle
    My current project requires locating an array of strings within an element's text content, then wrapping those matching strings in <a> elements using JavaScript (requirements simplified here for clarity). I need to avoid jQuery if at all possible - at least including the full library. For example, given this block of HTML: <div> <p>This is a paragraph of text used as an example in this Stack Overflow question.</p> </div> and this array of strings to match: ['paragraph', 'example'] I would need to arrive at this: <div> <p>This is a <a href="http://www.example.com/">paragraph</a> of text used as an <a href="http://www.example.com/">example</a> in this Stack Overflow question.</p> </div> I've arrived at a solution to this by using the innerHTML() method and some string manipulation - basically using the offsets (via indexOf()) and lengths of the strings in the array to break the HTML string apart at the appropriate character offsets and insert <a href="http://www.example.com/"> and </a> tags where needed. However, an additional requirement has me stumped. I'm not allowed to wrap any matched strings in <a> elements if they're already in one, or if they're a descendant of a heading element (<h1> to <h6>). So, given the same array of strings above and this block of HTML (the term matching has to be case-insensitive, by the way): <div> <h1>Example</a> <p>This is a <a href="http://www.example.com/">paragraph of text</a> used as an example in this Stack Overflow question.</p> </div> I would need to disregard both the occurrence of "Example" in the <h1> element, and the "paragraph" in <a href="http://www.example.com/">paragraph of text</a>. This suggests to me that I have to determine which node each matched string is in, and then traverse its ancestors until I hit <body>, checking to see if I encounter a <a> or <h_> node along the way. Firstly, does this sound reasonable? Is there a simpler or more obvious approach that I've failed to consider? It doesn't seem like regular expressions or another string-based comparison to find bounding tags would be robust - I'm thinking of issues like self-closing elements, irregularly nested tags, etc. There's also this... Secondly, is this possible, and if so, how would I approach it?

    Read the article

  • Can a web app in xul:iframe access functions from its parent XUL file?

    - by oskar
    I want to deploy a web app as a self-contained program using XULRunner. I'm simply loading it in a xul:iframe tag within the main XUL file. It works, but I want the web app to have access to XUL components, specifically nsiFilePicker. My tentative solution is to run the xul:iframe with escalated privileges (by omitting the "type" attribute), wait for the xul:iframe to load, then define a javascript function that the web app will then call. <window id="main" width="800" height="600" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <iframe id="contentview" src="web/index.html" flex="1"/> <script> //listen for XUL window to load window.addEventListener("load",Listen,false); function Listen() { var frame = document.getElementById("contentview"); frame.addEventListener("DOMContentLoaded", DomLoadedEventHandler, true); } //listen for iframe to load function DomLoadedEventHandler() { //set function in iframe called testMe() var frame = document.getElementById("contentview"); frame.contentWindow.testMe = function () { alert("This is a test"); }; } </script> </window> ...and then in the index.html file of the web app... <script> testMe(); </script> This doesn't seem to work. Does anyone have any suggestions?

    Read the article

  • How can I concatinate a subquery result field into the parent query?

    - by Pure.Krome
    Hi folks, DB: Sql Server 2008. I have a really (fake) groovy query like this:- SELECT CarId, NumberPlate (SELECT Owner FROM Owners b WHERE b.CarId = a.CarId) AS Owners FROM Cars a ORDER BY NumberPlate And this is what I'm trying to get... => 1 ABC123 John, Jill, Jane => 2 XYZ123 Fred => 3 SOHOT Jon Skeet, ScottGu So, i tried using AS [Text()] ... FOR XML PATH('') but that was inlcuding weird encoded characters (eg. carriage return). ... so i'm not 100% happy with that. I also tried to see if there's a COALESCE solution, but all my attempts failed. So - any suggestions?

    Read the article

  • Hibernate cascading: should setting to null on a parent delete children?

    - by EugeneP
    I wonder if Hib works as expected in my case? My Cascading options are set to "all,delete-orphan". Table_A @OneToOne Table_B Table_B @OneToMany Table_C Now it looks like Table_A . getTable_B . getTable_C_Collection() Suppose there are elements in Table_C collection. What I expect from Hibernate: if I set Table_B link to null, then all Table_C collection elements MUST BE DELETED. It does not happen. They become ORPHANED !

    Read the article

  • Is it possible to overwrite a static method in parent class?

    - by MartinDenny2069
    I have a static method defined in a base class, I want to overwrite this method in its child class, is it possible? I tried this but it did not work as I expected. When I created an instance of class B and invoke its callMe() method, the static foo() method in class A is invoked. public abstract class A { public static void foo() { System.out.println("I am base class"); } public void callMe() { foo(); } } Public class B { public static void foo() { System.out.println("I am child class"); } }

    Read the article

  • How to refresh parent and ancestor windows afret colsing the child windows?

    - by truthseeker
    Hi, I have three windows: 1st - main window 2nd - child window - it's opened using window.showModalDialog from 1st widnow. 3rd - window - is an ancestor of 1st widnow and is's opened from 2nd widnow using window.showModalDialog. And now what I need to achivie is to open 1, 2 and 3 window. Next after closing the 3rd one, refrest the 2nd one. And after closing the 2nd one, refresh the 1st one. But there is one more assumption, I don't want to have any postback during this proces. Dose anybody have any idea how to make it?

    Read the article

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