Search Results

Search found 8049 results on 322 pages for 'concerned parent'.

Page 32/322 | < Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >

  • Passing null child object from parent object to a partial view

    - by Mike
    I have an object which contains models for my ASP.NET MVC web app. The Model that is being passed into the view has sub models for "gadgets" on that particular view. Each of these sub models gets passed to a partial view (gadget). The problem is when I have a null model in the view model. See example below. View Model: public class FooBarHolder() { public FooBar1 FooBar1 { get; set; } public FooBar2 FooBar2 { get; set; } } We pass FooBarHolder into the view and inside the view we make calls such as <% Html.RenderPartial("Foo", Model.FooBar1); %> <% Html.RenderPartial("Foo2", Model.FooBar2); %> Now say for instance that Model.FooBar2 was null. What I am experiencing from the strongly typed partial view is an error that says "This view expected a model of type FooBar2 but got a model of type FooBarHolder." Why is this happening instead of just passing in a null?

    Read the article

  • before_filter not inheriting from parent controller correctly?

    - by Scott
    Sorry if this may be a stupid question but I'm unable get my filters to inherit the way the Rails 3 documentation is saying it should. Specifically I have an Admin controller that was generated via: rails generate controller admin I added only a single action to the admin controller, the before filter & the private filter method class AdminController < ApplicationController before_filter require_admin_creds def index end private def require_admin_creds unless current_user && current_user.admin? flash[:error] = ... redirect_to .... end end end I next then created my nested resources under the admin section with: rails generate scaffold admin/model While my admin index is indeed getting the filter, the admin/model index (or any other actions) are not. What is happening under the hood here that I must have excluded? Thanks in advance.

    Read the article

  • 2 Minute question - HTML / CSS If div within div expands expand parent div

    - by Ozaki
    I have a setup lets say like follows: <div id="nav"> <div id="innernav"> //With dynamic content here. </div> </div> I am running a script that sizes #nav to the size of the browser window in height. But sometimes my dynamic content is now getting bigger than the height of the window.. Is there a way I can enforce that when #innernav exceeds #nav that #nav will increase in size?

    Read the article

  • OpenERP model tracking external resource, hooking into parent's copy() or copy_data()

    - by CB.
    I have added a new model (call it crm_lead_external) that is linked via a new one2many on crm_lead. Thus, my module has two models defined: an updated crm_lead (with _name=crm_lead) and a new crm_lead_external. This external model tracks a file and as such has a 'filename' field. I also created a unique SQL index on this filename field. This is part of my module: def copy(self, cr, uid, id, default=None, context=None): if not default: default = {} default.update({ 'state': 'new', 'filename': '', }) ret = super(crm_lead_external, self).copy(cr, uid, id, default, context=context) #do file copy return ret The intent here is to allow an external entity to be duplicated, but to retarget the file path. Now, if I click duplicate on the Lead, I get an IntegrityError on my unique constraint. Is there a particular reason why copy() isn't being called? Should I add this logic to copy_data()? Myst I really override copy() for the lead? Thanks in advance.

    Read the article

  • Child elements changing opacity with parent Image

    - by mitch
    I have a <div> element which has a background image. On top of that I have some text that is hidden but when the user hovers over the <div> element that text will show and the <div> opacity will lower. My problem is when you hover over the div all elements inside that change opacity as well. I have looked through stackoverflow to see if anyone has the same problem but all i found were answers that had RGBA using background colors (not images). Here is my css: .pic{ background-image:url(http://www.granitesportsinstitute.com/wp-content/uploads/2014/06/Green-Sea-Turtle-150x150.jpg); -webkit-transition: all .3s ease-in-out; -moz-transition: all .3s ease-in-out; -o-transition: all .3s ease-in-out; transition: all .3s ease-in-out; } .textstuff{ visibility:hidden; } .pic:hover .textstuff{ visibility:visible; color:black; } .pic:hover{ filter: alpha(opacity=30); -moz-opacity: 0.3; -khtml-opacity: 0.3; opacity: 0.3; } HTML HERE: <div class="pic" style="height:150px;width:150px;"> <div class="textstuff">this is text</div> </div>

    Read the article

  • Calling from a parent file in python

    - by Teifion
    I have a file called main.py and a file called classes.py main.py contains the application and what's happening while class.py contains some classes. main.py has the following code main.py import classes def addItem(text): print text myClass = classes.ExampleClass() And then we have classes.py classes.py class ExampleClass (object): def __init__(self): addItem('bob') Surprisingly enough that's not the actual code I am using because I've stripped out anything that'd get in the way of you seeing what I want to do. I want to be able to call a method that's defined in main.py from a class within classes.py. How do I do this? Thanks in advance

    Read the article

  • jQuery ajax.load div, then have parent container access property

    - by Brett
    So I have a tabbed ui "form", each tab is quiet complicated so it is loaded via the .load('item.html'); command. All good, when the user clicks to a different tab, I want to read a property, maybe execute a function from within the ajax loaded div. What is the best way to get to these properties and methods from outsite the ajax loaded div?

    Read the article

  • how does an object knows about its parent in javascript

    - by alter
    Lets suppose I made a class called Person. var Person = function(fname){this.fname = fname;}; pObj is the object I made from this class. var pObj = new Person('top'); now I add one property to Person class, say lname. Person.prototype.lname = "Thomsom"; now pObj.lname gets me "Thomson". My question is that, when pObj didn't find the property lname in it, how does it know where to look for.

    Read the article

  • How to inherit methods from a parent class in C++

    - by Pat
    When inheriting classes in C++ I understand members are inherited. But how does one inherit the methods as well? For example, in the below code, I'd like the method "getValues" to be accessible not through just CPoly, but also by any class that inherits it. So one can call "getValues" on CRect directly. class CPoly { private: int width, height; public: void getValues (int* a, int* b) { *a=width; *b=height;} }; class CRect: public CPoly { public: int area () { return (width * height); } }; In other words, is there any way to inherit methods for simple generic methods like getters and setters?

    Read the article

  • Why does my ConfirmButtonExtender cause full postbacks after I've toggled its parent usercontrol's v

    - by zk812
    Hello all, I have a series of usercontrols on a page that are displayed based on a selection. Each usercontrol contains a Delete button with a ConfirmButton/ModalPopupExtender combo attached to it. This works great when first loading any of the usercontrols--clicking delete shows my Confirm Modal popup and hitting yes or no causes an async postback to perform the operation. But if I move away from the usercontrol and come back to it, the Confirm Modal Popup appears but clicking yes or no now causes a full postback (the operation does still take place). Why does changing the visible property cause this?

    Read the article

  • Prevent event from parent element to child element in jquery

    - by sonam
    I have binded event as below: $(document).delegate('.budget', 'click', function(e){ if ($(this).hasClass('collapsed')) { $(this).removeClass('collapsed'); $(this).addClass('expanded'); } else if ($(this).hasClass('expanded')) { $(this).removeClass('expanded'); $(this).addClass('collapsed'); } }); Basically this toggles between expand and collapse. I have another event binded as below: $('[id^="tree"]').delegate('.collapsed', 'click', function(e){ var elementId = $(this).attr('id'); hideChildElement(elementId); }); The elements binded by the second event binding are parents of elements binded by first event binding. What happens is that on clicking on the element from the first binding event method also triggers the event binded by second event binding. I want to prevent any events from binding from second event binding to 1st event binding method. If element A is binded to click event from first event binding and B is binded to second event binding (A is inside B or A is child of B), I dont want any event of B to propagate to A. Note I tried e.stopImmediatePropagation(); but did not worked

    Read the article

  • Implementation of interface when using child class of a parent class in method of interface

    - by dotnetdev
    I don't have access to my dev environment, but when I write the below: interface IExample void Test (HtmlControl ctrl); class Example : IExample { public void Test (HtmlTextArea area) { } I get an error stating the methods in the class implementation don't match the interface - so this is not possible. HtmlTextArea is a child class of HtmlControl, is there no way this is possible? I tried with .NET 3.5, but .NET 4.0 may be different (I am interested in any solution with either framework). Thanks

    Read the article

  • Accress Parent Page's Viewstate in ASP.NET

    - by rachmos
    OK, I guess I'm missing something obvious here, but I still can't make it work... I have a page in ASP.NET. I have a nested class inside the page. I have a property in this nested class. How can I access the page's viewstate from the property's Set statement? Thanks!

    Read the article

  • [Django] One single page to create a Parent object and its associated child objects

    - by ahmoo
    Hi all, This is my very first post on this awesome site, from which I have been finding answers to a handful of challenging questions. Kudos to the community! I am new to the Django world, so am hoping to find help from some Django experts here. Thanks in advance. Item model: class Item(models.Model): name = models.CharField(max_length=50) ItemImage model: class ItemImage(models.Model): image = models.ImageField(upload_to=get_unique_filename) item = models.ForeignKey(Item, related_name='images') As you can tell from the model definitions above, every Item object can have many ItemImage objects. My requirements are as followings: A single web page that allows users to create a new Item while uploading the images associated with the Item. The Item and the ItemImages objects should be created in the database all together, when the "Save" button on the page is clicked. I have created a variable in a custom config file, called NUMBER_OF_IMAGES_PER_ITEM. It is based on this variable that the system generates the number of image fields per item. Questions: What should the forms and the template be like? Can ModelForm be used to achieve the requirements? For the view function, what do I need to watch out other than making sure to save Item before ItemImage objects?

    Read the article

  • Printing contents of a dynamically created iframe from parent window

    - by certainlyakey
    I have a page with a list of links and a div which serves as a placeholder for the pages the links lead to. Everytime user clicks on a link an iframe is created in the div and its src attribute gets the value of the link href attribute - simple and clear, sort of external web pages gallery. What i do have a problem with is printing the contents of the iframe. To do this i use this code: function PrintIframe() { frames["name"].focus(); frames["name"].print(); } The issue seems to be that iframe is created dynamically by JQuery - when I insert an iframe right into the html code, the browser prints the external page all right. But with the same code injected by JavaScript nothing happens. I tried to use JQ 1.3 'live' event on "Print" link, no success. Is there a way to overcome this?

    Read the article

  • Removing random object from parent CCprite

    - by Natty
    probably this is a simple problem to solve, since I'm quite new. I have a scene with a waiter holding a tray of food (the food is a random CCSprite choosen from an array) each time he comes onscreen he holds a new piece of food (the user touches the food and the waiter walks off to return again with a new piece of food however I cant seem to delete the old peice of food from the screen as it says the child is already added... any help would be great -(id) init { ///other code then... waiterOnSCreen = [CCSprite spriteWithSpriteFrameName:@"CatUP.png"]; waiterOnSCreen.position = ccp(CatOffSCreenPosX, catXpos); [self addChild:waiterOnSCreen z:0]; //moving the waiter // the random food sprite is added later to the waiter // [waiterOnSCreen addChild:myRandomSprite]; } -(void)LoadRandomFood { ///I make my array here then... int i = arc4random() % [RandomFood count]; myRandomSprite = (CCSprite *)[RandomFood objectAtIndex:i]; //waiterOnSCreen is a CCSprite added on the init [waiterOnSCreen addChild:myRandomSprite]; myRandomSprite.position=ccp(290,220); myRandomSprite.tag = RandomFoodTag; } } later in if(CGRectContainsPoint(waiterOnSCreen.boundingBox, location)) { //trying to remove the food here //Ive already tried to remove the sprite using [self removeChildByTag:RandomeObjectTag]; //and also CCSprite *wantedSprite = (CCSprite *)[self getChildByTag:RandomFoodTag]; [wantedSprite removeFromParentAndCleanup:YES]; } }

    Read the article

  • Get seleted text parent tag using regex C#

    - by Aruna Tennakoon
    <SPAN id=spanD121C150D2 style="BACKGROUND-COLOR: antiquewhite" CategoryID="1" MessageID="2316" refSpan=""> <SPAN id=span1CE69EDE12 style="BACKGROUND-COLOR: blue" CategoryID="2" MessageID="2316" refSpan="">platnosci inny srodkiem platnosci. DC - zakup paliwa na stacji benzynowej 101-500 (150 zl). 27 </SPAN> </SPAN> I have a string like above. If the selected text is "srodkiem ", is it possible to get the relevant span tag? Is this possible using a regular expression?

    Read the article

  • Append before parent after getSelection()

    - by sanceray3
    Hi all, I have one question. I try to develop a little WYSIWYG editor. I would like create a <h1> button which allows me to generate a <h1> title (by clicking on button after text selection in <p> element). I obtain the selection with window.getSelection().... But now, I would like to put my append("<h1>my text selected</h1>") just before the <p>. It’s my problem, because my <p> elements don’t have id or class. So do you know a means to put my append just before the <p> where my text has been selected? I don’t know if with my bad English you’ll understand me! Thanks very much for your help.

    Read the article

  • Get node parent of defined type using xpath

    - by IordanTanev
    Hi, i will give an example of the problem i have. My XML is like this <roor> <child Name = "child1"> <node> <element1>Value1</element1> <element2>Value2</element2> </node> </child> <child Name = "child2"> <element1>Value1</element1> <element2>Value2</element2> <element3>Value3</element3> </child> </root> I have xpath expression that returns all "element2" nodes. Then i want to for every node of type "element2" to find the node of type "child" that contains it. The problem is that between these two nodes there can be from 1 to n different nodes so i can't just use "..". Is there something like "//" that will look up instead of down Best Regards, Iordan

    Read the article

  • Javascript object properties access functions in parent constructor?

    - by Bob Spryn
    So I'm using this pretty standard jquery plugin pattern whereby you can grab an api after applying the jquery function to a specific instance. This API is essentially a javascript object with a bunch of methods and data. So I wanted to essentially create some private internal methods for the object only to manipulate data etc, which just doesn't need to be available as part of the API. So I tried this: // API returned with new $.TranslationUI(options, container) $.TranslationUI = function (options, container) { // private function? function monkey(){ console.log("blah blah blah"); } // extend the default settings with the options object passed this.settings = $.extend({},$.TranslationUI.defaultSettings,options); // set a reference for the container dom element this.container = container; // call the init function this.init(); }; The problem I'm running into is that init can't call that function "monkey". I'm not understanding the explanation behind why it can't. Is it because init is a prototype method?($.TranslationUI's prototype is extended with a bunch of methods including init elsewhere in the code) $.extend($.TranslationUI, { prototype: { init : function(){ // doesn't work monkey(); // editing flag this.editing = false; // init event delegates here for // languagepicker $(this.settings.languageSelector, this.container).bind("click", {self: this}, this.selectLanguage); } } }); Any explanations would be helpful. Would love other thoughts on creating private methods with this model too. These particular functions don't HAVE to be in prototype, and I don't NEED private methods protected from being used externally, but I want to know how should I have that requirement in the future.

    Read the article

  • Parent selector in jquery

    - by matthewsteiner
    I have a table row that needs to be hidden when the anchor with class "removerow" is clicked. <tr><td>Product Name</td><td><a class="removerow">Remove</a></td></tr> I've been trying this, but it doesn't work: $("a.removerow").click(function(){ $(tr > this).hide(); }); How can I select the entire table row with a child of ".removerow". What am I doing wrong? Thanks.

    Read the article

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