Search Results

Search found 5175 results on 207 pages for 'simon child'.

Page 4/207 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Flex Canvas child Randomly resizes

    - by BS_C3
    Hi! I have an application with a viewstack that contains all the components that need to be displayed. The navigation is defined in the main application. All the components are based on canvas. The main application looks like that: <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:components="components.*"> <mx:VBox width="1024" height="100%" horizontalCenter="0" verticalGap="0" backgroundColor="#FFFFFF"> <mx:Image id="header" verticalAlign="top" /> <mx:ViewStack id="body" horizontalCenter="0" verticalCenter="0" width="100%" height="100%"> <components:HomePage id="hp" width="100%"/> <components:CollectionSelection id="cs" width="100%"/> <components:SearchEngine id="se" width="100%"/> <components:SearchResult id="sr" width="100%"/> <components:Tray id="tr" width="100%"/> <components:Order id="or" width="100%"/> </mx:ViewStack> <mx:Image id="footer" verticalAlign="bottom" maintainAspectRatio="false" width="100%"/> </mx:VBox> </mx:Application> I'm getting a strange behaviour from the TRAY component. Here's the code for component Tray (I've only left the display info): <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Image id="bg" horizontalCenter="0" verticalCenter="0" width="100%" height="100%" maintainAspectRatio="false"/> <mx:HBox width="100%"> <mx:Button x="20" y="20" label="BACK"/> <mx:Spacer width="100%"/> <mx:LinkBar itemClick="linkbar_itemClick(event)" styleName="GLBLinkBTN" separatorColor="#FFFFFF" separatorWidth="1" > <mx:dataProvider> <mx:Object label="CLEAR"/> <mx:Object label="LOGOUT"/> </mx:dataProvider> </mx:LinkBar> </mx:HBox> <mx:VBox id="mainBox" horizontalCenter="0" verticalCenter="0" verticalGap="0"> <mx:HBox width="100%" height="50" backgroundColor="#60524D" verticalAlign="bottom" paddingBottom="5"> <mx:Label styleName="TRTitle" paddingLeft="15"/> <mx:Spacer width="100%"/> <mx:Label styleName="TRItems" paddingRight="15"/> </mx:HBox> <mx:HorizontalList id="hlist" dataProvider="{TrayData.instance.itemsCollection}" columnCount="{TrayData.instance.hlistColumns}" rowCount="1" itemRenderer="components.TrayItem" horizontalScrollPolicy="off" rollOverColor="#FFFFFF" selectionColor="#FFFFFF" horizontalCenter="0" verticalCenter="0" borderStyle="none" horizontalScrollPosition="{TrayData.instance.hsPosition}" /> <mx:HBox width="100%" backgroundColor="#E7DDDB" height="40" verticalAlign="middle" paddingLeft="20" paddingRight="20"> <mx:Box width="25" verticalAlign="middle" horizontalAlign="left"> <mx:Button id="leftBtn" /> </mx:Box> <mx:Spacer width="100%"/> <mx:Box width="25" verticalAlign="middle" horizontalAlign="right"> <mx:Button id="rightBtn" /> </mx:Box> </mx:HBox> </mx:VBox> </mx:Canvas> All the components are displaying properly. However, sometimes, randomly, the vbox "mainBox" in the tray component is not displaying as it should: the horizontallist shrinks and instead of fully displaying its items, I get horizontal and vertical scrollbars for each item... I'm currently trying to reproduce this behaviour (to get a print screen) but right know, it's working fine... -_-' As soon as I get it work as it shouldn't, I'll upload an image. Here's the code for the itemRenderer (just in case...): <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" > <mx:HBox width="100%" paddingTop="0" paddingBottom="0" paddingRight="3"> <mx:Spacer width="100%"/> <mx:Box width="14" height="14" verticalAlign="middle" horizontalAlign="center"> <mx:Button width="8" height="8"/> </mx:Box> </mx:HBox> <mx:VBox paddingLeft="20" paddingRight="20" verticalGap="15" paddingBottom="15"> <mx:Canvas id="thumbnail"> <mx:Image id="thumbnailBG" /> <mx:Image id="thumbnailIM" /> </mx:Canvas > <mx:VBox width="100%" verticalGap="7"> <mx:HBox width="100%" height="13"> <mx:Label width="74" opaqueBackground="#ECE5E2"/> <mx:Label paddingBottom="5"/> </mx:HBox> <mx:HBox width="100%" height="13"> <mx:Label width="74" opaqueBackground="#ECE5E2"/> <mx:Label /> </mx:HBox> <mx:HBox width="100%" height="13"> <mx:Label width="74" opaqueBackground="#ECE5E2"/> <mx:Label /> </mx:HBox> <mx:HBox width="100%" height="13"> <mx:Label width="74"opaqueBackground="#ECE5E2"/> <mx:Label /> </mx:HBox> <mx:HBox width="100%" height="13"> <mx:Label width="74" opaqueBackground="#ECE5E2"/> <mx:Label /> </mx:HBox> <mx:HBox width="100%" height="13"> <mx:Label width="74" opaqueBackground="#ECE5E2"/> <mx:Label /> </mx:HBox> <mx:HBox width="100%" height="13"> <mx:Label width="74" opaqueBackground="#ECE5E2"/> <mx:Label /> </mx:HBox> <mx:HBox width="100%" height="13"> <mx:Label width="74" opaqueBackground="#ECE5E2"/> <mx:Label /> </mx:HBox> </mx:VBox> <mx:Button /> </mx:VBox> </mx:VBox> Your help would really be appreciated. Regards, BS_C3

    Read the article

  • Linking Listbox child categories

    - by Gerardo Abdo
    Hello I have few monhts working with aspx, and now I'm developing a shopping cart website. For the employee to upload the products on the DB, every product needs to be linked to a category and sub category, and sub-sub category, and so on. Sometimes the sub-sub categories are up to 5. For example Electronics-TV-LCD-Samsung-40 inches. First, What I would like to identify is if the SQL table has the apporpiate structure. I have 3 columns Id, Description, Parent_Id. Categories with Parent Id=0 is used for the top ones. Is this the best way to do it? Then I want to use the ListBox control to select main Categories, and once it is selected, filled a second listbox with its childs and so on. Do I need to query SQL DB everytime the change event happens? I heard about linq but have not used yet, What would be your suggestion to do this. If you have seen a sample to understand it better will be appreciated. Thank you

    Read the article

  • T-SQL: Build Nested Set From Parent-Child Relationship

    - by Peder Rice
    I have a table that stores my Customer hierarchy with a nested set (due to the specific design of the application, I wasn't able to leverage just a Customer/Parent Customer mapping table). To simplify maintenance of this table, I've built a couple of stored procedures to handle moving nodes around and creating new nodes, but it's significantly more work than maintaining a Customer/Parent Customer table. Further, these structures are very fragile. So I'm looking for a way to have a Customer/Parent Customer table and then convert that table to a nested set on demand. Does anyone have a link to such an implementation?

    Read the article

  • How to model parent to child pair in MySQL (SQL)

    - by mikeschuld
    I have a data model that includes element types Stage, Actor, and Form. Logically, Stages can be assigned pairs of ( Form <--- Actor ) which can be duplicated many times (i.e. same person and same form added to the same stage at a later date/time). Right now I am modeling this with these tables: Stage Form Actor Form_Actor _______________ |Id | |FormId | --> Id in Form |ActorId | --> Id in Actor Stage_FormActor __________________ |Id | |StageId | --> Id in Stage |FormActorId | --> Id in Form_Actor I am using CodeSmith to generate the data layer for this setup and none of the templates really know how to handle this type of relationship correctly when generating classes. Ideally, the ORM would have Stage.FormActors where FormActor would be the pair Form, Actor. Is this the correct way to model these relationships. I have tried using all three Ids in one table as well Stage_Form_Actor ______________ |Id | |StageId | --> Id in Stage |FormId | --> Id in Form |ActorId | --> Id in Actor This doesn't really get generated very well either. Ideas?

    Read the article

  • flash actionscript 3 child control parent frame

    - by steve
    I'm completely new to flash... currently attempting to learn actionscript (ugh.) In the project I have right now, on the main timeline there are two layers: "intro" and "menu," and it's set to stop on frame 1. "Intro" is only 1 frame that holds a movie clip, and inside that is a movie clip with 800 frames. At the end of this clip around frame 750, it stops, and requires you to click to continue. Is there a way to have this be clicked, continue to the end of this movie clip, and then go to the 2nd frame in the main timeline to bring up the "menu"? Or do I have to have 800 blank frames before the menu so that the "intro" can play out. Thanks.

    Read the article

  • Help with manipulating child/parent elements with jQuery

    - by Mohammad
    Currently I have this JQuery script var img = $(this); img.wrap('<div class="photo"></div>'); img.parent().append("<p>" + img.attr("alt") + "</p>"); which successfully turns the following: <img src="photo.jpg" alt="caption"> into this <div class="photo"> <img src="photos.jpg" alt="caption"/> <p>caption</p> </div> All is well unless the image has a link as a parent; <a href="#"><img since I want it to be correct html (I'm fussy) improving the resulting outcome bellow would be satisfactory <a href="#"> <div class="photo"> <img src="photos.jpg" alt="caption"/> <p>caption</p> </div> </a> to this: <div class="photo"> <a href="#"> <img src="photos.jpg" alt="caption"/> </a> <p><a href="#">caption</a></p> </div> </a> This is my jQuery script so far (which doesn't work bc I'm a noob) aha if(img.parent('a')){ var targetLink = img.parent('a').attr('href').val(); img.parent('a').wrap('<div class="photo"></div>'); img.parent('div').append('<p><a href="'+targetLink+'">' + img.attr("alt") + '</p></a>'); }else{ img.wrap('<div class="photo"></div>'); img.parent().append("<p>" + img.attr("alt") + "</p>"); }; Any advice, or help will be greatly appreciated : ) Thank You! Update *Answer* (works but looks sloppy) I'm editing it atm; if(img.parent('a').length){ var targetLink = img.parent().attr('href'); img.parent().wrap('<div class="photo"></div>'); var divTarget = img.parent('a').parent('div'); divTarget.append('<p><a href="'+targetLink+'">' + img.attr("alt") + '</p></a>'); }else{ img.wrap('<div class="photo"></div>'); img.parent().append("<p>" + img.attr("alt") + "</p>"); };

    Read the article

  • Getting data from child controls loaded programmatically

    - by Farinha
    I've created 2 controls to manipulate a data object: 1 for viewing and another for editing. On one page I load the "view" User Control and pass data to it this way: ViewControl control = (ViewControl)LoadControl("ViewControl.ascx"); control.dataToView = dataObject; this.container.Controls.Add(control); That's all fine and inside the control I can grab that data and display it. Now I'm trying to follow a similar approach for editing. I have a different User Control for this (with some textboxes for editing) to which I pass the original data the same way I did for the view: EditControl control = (EditControl)LoadControl("EditControl.ascx"); control.dataToEdit = dataObject; this.container.Controls.Add(control); Which also works fine. The problem now is getting to this data. When the user clicks a button I need to fetch the data that was edited and do stuff with it. What's happening is that because the controls are being added programmatically, the data that the user changed doesn't seem to be accessible anywhere. Is there a solution for this? Or is this way of trying to keep things separated and possibly re-usable not possible? Thanks in advance.

    Read the article

  • Transferring object from parent to child

    - by waiwai933
    I'm currently developing an Custom Application using the IP.Board framework, which is in PHP, which by default, creates a IPSMember object for the logged-in user. However, I'm developing an additional class, basically class SpecialUser extends IPSMember Is there a way to get the parent object, which is IPSMember to change to SpecialUser?

    Read the article

  • jQuery child selector expression

    - by Saiful
    <div id="div"> <div> <!-- first level --> <div> <!-- second level --> <div>1.1</div> <!-- third level --> <div>1.2</div> </div> <div> <div></div> <div>2.2</div> </div> </div> </div> What are the jQuery selector expressions for selecting the followings: 1. div commented by first level 2. divs commented by second level 3. divs commented by third level

    Read the article

  • NHibernate child deletion problem.

    - by JMSA
    Suppose, I have saved some permissions in the database by using this code: RoleRepository roleRep = new RoleRepository(); Role role = new Role(); role.PermissionItems = Permission.GetList(); roleRep .SaveOrUpdate(role); Now, I need this code to delete the PermissionItem(s) associated with a Role when role.PermissionItems == null. Here is the code: RoleRepository roleRep = new RoleRepository(); Role role = roleRep.Get(roleId); role.PermissionItems = null; roleRep .SaveOrUpdate(role); But this is not happening. What should be the correct way to cope with this situation? What/how should I change, hbm-file or persistance code? Role.cs public class Role { public virtual string RoleName { get; set; } public virtual bool IsActive { get; set; } public virtual IList<Permission> PermissionItems { get; set; } } Role.hbm.xml <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="POCO" namespace="POCO"> <class name="Role" table="Role"> <id name="ID" column="ID"> <generator class="native" /> </id> <property name="RoleName" column="RoleName" /> <property name="IsActive" column="IsActive" type="System.Boolean" /> <bag name="PermissionItems" table="Permission" cascade="all" inverse="true"> <key column="RoleID"/> <one-to-many class="Permission" /> </bag> </class> </hibernate-mapping> Permission.cs public class Permission { public virtual string MenuItemKey { get; set; } public virtual int RoleID { get; set; } public virtual Role Role { get; set; } } Permission.hbm.xml <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="POCO" namespace="POCO"> <class name="Permission" table="Permission"> <id name="ID" column="ID"> <generator class="native"/> </id> <property name="MenuItemKey" column="MenuItemKey" /> <property name="RoleID" column="RoleID" /> <many-to-one name="Role" column="RoleID" not-null="true" cascade="all"> </many-to-one> </class> </hibernate-mapping>

    Read the article

  • PHP Classes: parent/child communication

    - by Fffff
    Hi all, I'm having some trouble extending Classes in PHP. Have been Googling for a while. $a = new A(); $a->one(); $a->b1(); // something like this, or... class A { public $test1; public function one() { echo "this is A-one"; $this->two(); $parent->two(); $parent->B->two(); // ...how do i do something like this (prepare it for using in instance $a)? } } class B extends A { public $test2; public function two($test) { echo "this is B-two"; } } I'm ok at procedural PHP.

    Read the article

  • Entity Filter child without include

    - by Lic
    i'm a C# developer and i have a trouble with Entity Framework 5. I have mapped my database with Entity using the default code generation strategy. In particolar there are three classes: menus, submenus and submenuitems. The relationships about three classes are: one menu - to many submenus one submenu - to many submenuitems. All classes have a boolean attribute called "Active". Now, i want to filter all the Menus with the SubMenus active, and the SubMenus with the SubMenuItems active. To get this i've tried this: var tmp = _model.Menus.Where(m => m.Active) .Select => new { Menu = x, SubMenu = x.SubMenus.Where(sb => sb.Active) .Select(y => new { SubMenu = y, SubMenuItem = y.SubMenuItems.Where(sbi => sbi.Active) }) }) .Select(x => x.Menu).ToList(); But didn't work. Someone can help me? Thank you for your help!

    Read the article

  • Javascript Replace Child/Loop issue

    - by Charles John Thompson III
    I have this really bizarre issue where I have a forloop that is supposed to replace all divs with the class of "original" to text inputs with a class of "new". When I run the loop, it only replaces every-other div with an input, but if I run the loop to just replace the class of the div and not change the tag to input, it does every single div, and doesn't only do every-other. Here is my loop code, and a link to the live version: live version here function divChange() { var divs = document.getElementsByTagName("div"); for (var i=0; i<divs.length; i++) { if (divs[i].className == 'original') { var textInput = document.createElement('input'); textInput.className = 'new'; textInput.type = 'text'; textInput.value = divs[i].innerHTML; var parent = divs[i].parentNode; parent.replaceChild(textInput, divs[i]); } } }

    Read the article

  • how to get the child node in div using javascript

    - by Khushi
    Below is the structure of my div: <div id="ctl00_ContentPlaceHolder1_Jobs_dlItems_ctl01_a" onmouseup="checkMultipleSelection(this,event);"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td style="width:50px; text-align:left;">09:15 AM</td> <td style="width:50px; text-align:left;">Item001</td> <td style="width:50px; text-align:left;">10</td> <td style="width:50px; text-align:left;">Address1</td> <td style="width:50px; text-align:left;">46545465</td> <td style="width:50px; text-align:left;">ref1</td> </tr> </table> </div> Now, if i have the id of the div, how can i get the time and address for this div using JavaScript? Thanks & Regards, Khushi

    Read the article

  • jquery : ul, li parent multiple child sub-child toggling

    - by user360826
    hello, my main question is as follows: how to show only the first subchild of a ul or li upon clicking the enclosing parent. eg: <ul> Grandparent <li> Child1 <li> Grandchild11</li></li> <li> Child2 <li>GrandChild21</li><li>grandchild22</li></li> </ul> so, for example I would like something to the effect of <script> $('ul').click(function(){ $('ul').children('first li').toggle() }); $('li').click(function(){ $('li').children('first li').toggle() }); </script> meaning: when i click ul, i only see the first child node (child1 and child2 will be shown, but not the grandchildren). when i click child1 or child2 i see the respective grandchild. grandchild is not shown upon clicking grandparent, only upon clicking child1 or child2. i know i am reinventing the wheel of some pre-coded solution, but any help would be largely appreciated!

    Read the article

  • Why do child elements cause 'dropleave' to be called (drag-n-drop file upload)?

    - by tundoopani
    I have a HTML5 drag-n-drop script that allows users to drop files in #droparea. The #droparea div has child elements that are also div elements. <div id="droparea"> <div id="showif_no_dragover">Drag files here!</div> <div id="showif_dragover">Drop the files!</div> </div> The associated javascript/jquery is: var droptarget = "#droparea"; $(droptarget).live('dragenter', dragEnter); $(droptarget).live('dragleave', dragExit); $(droptarget).live('dragover', nothing); $(droptarget).live('drop', dropGo); (Side question: should I use .live(), .on() or .bind() here?) I have created a sample jsFiddle with some additional code here: http://jsfiddle.net/PwFr9/3/ If you look at the console, you will notice that as you drag a file within #droparea, dragenter() and dragleave() are called multiple times, even though the drag is still inside #droparea. If you remove the child elements (#child1 and #child2), the problem is gone because the child elements are gone. How can I keep the child elements and prevent them from messing up the drag events? I have searched Stackoverflow and Google for hours without much help. I found this questions here at Stackoverflow: How to keep child elements from interfering with HTML5 dragover and drop events? I don't know why it works, though. I have tried placing 2 div elements on top of each other (via CSS positioning). The top-most div has the drag events attached whereas the bottom-most div has the child elements. I do not like this approach because it doesn't work with the rest of my page and does not allow mouse-click interaction with the bottom-most div. Any help is appreciated! Thank you in advance. Regards, tundoo

    Read the article

  • Comments Parent-Child query with indentation

    - by poldoj
    I've been trying to retrieve comments to articles in a pretty common blog fashion way. Here's my sample code: -- ---------------------------- -- Sample Table structure for [dbo].[Comments] -- ---------------------------- CREATE TABLE [dbo].[Comments] ( [CommentID] int NOT NULL , [AddedDate] datetime NOT NULL , [AddedBy] nvarchar(256) NOT NULL , [ArticleID] int NOT NULL , [Body] nvarchar(4000) NOT NULL , [parentCommentID] int NULL ) GO -- ---------------------------- -- Sample Records of Comments -- ---------------------------- INSERT INTO [dbo].[Comments] ([CommentID], [AddedDate], [AddedBy], [ArticleID], [Body], [parentCommentID]) VALUES (N'1', N'2011-11-26 23:18:07.000', N'user', N'1', N'body', null); GO INSERT INTO [dbo].[Comments] ([CommentID], [AddedDate], [AddedBy], [ArticleID], [Body], [parentCommentID]) VALUES (N'2', N'2011-11-26 23:18:50.000', N'user', N'2', N'body', null); GO INSERT INTO [dbo].[Comments] ([CommentID], [AddedDate], [AddedBy], [ArticleID], [Body], [parentCommentID]) VALUES (N'3', N'2011-11-26 23:19:09.000', N'user', N'1', N'body', null); GO INSERT INTO [dbo].[Comments] ([CommentID], [AddedDate], [AddedBy], [ArticleID], [Body], [parentCommentID]) VALUES (N'4', N'2011-11-26 23:19:46.000', N'user', N'3', N'body', null); GO INSERT INTO [dbo].[Comments] ([CommentID], [AddedDate], [AddedBy], [ArticleID], [Body], [parentCommentID]) VALUES (N'5', N'2011-11-26 23:20:16.000', N'user', N'1', N'body', N'1'); GO INSERT INTO [dbo].[Comments] ([CommentID], [AddedDate], [AddedBy], [ArticleID], [Body], [parentCommentID]) VALUES (N'6', N'2011-11-26 23:20:42.000', N'user', N'1', N'body', N'1'); GO INSERT INTO [dbo].[Comments] ([CommentID], [AddedDate], [AddedBy], [ArticleID], [Body], [parentCommentID]) VALUES (N'7', N'2011-11-26 23:21:25.000', N'user', N'1', N'body', N'6'); GO -- ---------------------------- -- Indexes structure for table Comments -- ---------------------------- -- ---------------------------- -- Primary Key structure for table [dbo].[Comments] -- ---------------------------- ALTER TABLE [dbo].[Comments] ADD PRIMARY KEY ([CommentID]) GO -- ---------------------------- -- Foreign Key structure for table [dbo].[Comments] -- ---------------------------- ALTER TABLE [dbo].[Comments] ADD FOREIGN KEY ([parentCommentID]) REFERENCES [dbo]. [Comments] ([CommentID]) ON DELETE NO ACTION ON UPDATE NO ACTION GO I thought I could use a CTE query to do the job like this: WITH CommentsCTE(CommentID, AddedDate, AddedBy, ArticleID, Body, parentCommentID, lvl, sortcol) AS ( SELECT CommentID, AddedDate, AddedBy, ArticleID, Body, parentCommentID, 0, cast(CommentID as varbinary(max)) FROM Comments UNION ALL SELECT P.CommentID, P.AddedDate, P.AddedBy, P.ArticleID, P.Body, P.parentCommentID, PP.lvl+1, CAST(sortcol + CAST(P.CommentID AS BINARY(4)) AS VARBINARY(max)) FROM Comments AS P JOIN CommentsCTE AS PP ON P.parentCommentID = PP.CommentID ) SELECT REPLICATE('--', lvl) + right('>',lvl)+ AddedBy + ' :: ' + Body, CommentID, parentCommentID, lvl FROM CommentsCTE WHERE ArticleID = 1 order by sortcol go but the results have been very disappointing so far, and after days of tweaking I decided to ask for help. I was looking for a method to display hierarchical comments to articles like it happens in blogs. [edit] The problem with this query is that I get duplicates because I couldn't figure out how to properly select the ArticleID which I want comments from to display. I'm also looking for a method that sorts children entries by date within a same level. An example of what I'm trying to accomplish could be something like: (ArticleID[post retrieved]) ------------------------- ------------------------- (Comments[related to the article id above]) first comment[no parent] --[first child to first comment] --[second child to first comment] ----[first child to second child comment to first comment] --[third child to first comment] ----[first child to third child comment to first comment] ------[(recursive child): first child to first child to third child comment to first comment] ------[(recursive child): second child to first child to third child comment to first comment] second comment[no parent] third comment[no parent] --[first child to third comment] I kinda got myself lost in all this mess...I appreciate any help or simpler ways to get this working. Thanks

    Read the article

  • custom events in child userControls c# .net or Child to Parent Communication in UserControls

    - by Asad Malik
    Okay here is the scenario: I have a parent "SalesUC" UserControl which contains a "itemDetailsUC" UserControl, as well as a status label. (plz see sample below) What I want: If there occurs any exception in itemDetailsUC, it should be able to communicate the exception text to parent control (i.e. SalesUC). Remember: the "ItemDetailsUC" is also used in other controls that may or may not have status label. any suggestions, answers... please. Framework: .net 3.0/3.5 Language: c# Domain: Windows Application, WinForms, etc. Sample ScreenShot regards.

    Read the article

  • How to get the child elementsvalue , when the parent element contains different number of child Elem

    - by Subhen
    Hi, I have the following XML Structure: <DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/"> <item id="1268" parentID="20" restricted="1"> <upnp:class>object.item.audioItem.musicTrack</upnp:class> <dc:title>Hey</dc:title> <dc:date>2010-03-17T12:12:26</dc:date> <upnp:albumArtURI dlna:profileID="PNG_TN" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0">URL/albumart/22.png</upnp:albumArtURI> <upnp:icon>URL/albumart/22.png</upnp:icon> <dc:creator>land</dc:creator> <upnp:artist>sland</upnp:artist> <upnp:album>Change</upnp:album> <upnp:genre>Rock</upnp:genre> <res protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000" size="9527987" duration="0:03:58">URL/1268.mp3</res> <res protocolInfo="http-get:*:image/png:DLNA.ORG_PN=PNG_TN;DLNA.ORG_CI=01;DLNA.ORG_FLAGS=00f00000000000000000000000000000" colorDepth="24" resolution="160x160">URL/albumart/22.png</res> </item> <item id="1269" parentID="20" restricted="1"> <upnp:class>object.item.audioItem.musicTrack</upnp:class> <dc:title>Indian </dc:title> <dc:date>2010-03-17T12:06:32</dc:date> <upnp:albumArtURI dlna:profileID="PNG_TN" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0">URL/albumart/13.png</upnp:albumArtURI> <upnp:icon>URL/albumart/13.png</upnp:icon> <dc:creator>MC</dc:creator> <upnp:artist>MC</upnp:artist> <upnp:album>manimal</upnp:album> <upnp:genre>Rap</upnp:genre> <res protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000" size="8166707" duration="0:03:24">URL/1269.mp3</res> <res protocolInfo="http-get:*:image/png:DLNA.ORG_PN=PNG_TN;DLNA.ORG_CI=01;DLNA.ORG_FLAGS=00f00000000000000000000000000000" colorDepth="24" resolution="160x160">URL/albumart/13.png</res> </item> <item id="1277" parentID="20" restricted="1"> <upnp:class>object.item.videoItem.movie</upnp:class> <dc:title>IronMan_TeaserTrailer-full_NEW.mpg</dc:title> <dc:date>2010-03-17T12:50:24</dc:date> <upnp:genre>Unknown</upnp:genre> <res protocolInfo="http-get:*:video/mpeg:DLNA.ORG_PN=(NULL);DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000" size="98926592" resolution="1920x1080" duration="0:02:30">URL/1277.mpg</res> </item> </DIDL-Lite> Here in the last Elemnt Item , there are few missing elements like icon,albumArtURi ..etc. Now whhile Ity to access the Values by following LINQ to XML query, var vAudioData = from xAudioinfo in xResponse.Descendants(ns + "DIDL-Lite").Elements(ns + "item").Where(x=>!x.Elements(upnp+"album").l orderby ((string)xAudioinfo.Element(upnp + "artist")).Trim() select new RMSMedia { strAudioTitle = ((string)xAudioinfo.Element(dc + "title")).Trim(),//((string)xAudioinfo.Attribute("audioAlbumcoverImage")).Trim()=="" ? ((string)xAudioinfo.Element("Song")).Trim():"" }; It show object reference is not set to reference of object. I do undersrand this is because of missing elements, is there any way I can pre-check if the elements exist , or check the number of elemnts inside item or any other way. Any help is deeply appreciated. Thanks, Subhen

    Read the article

  • Fluent NHibernate - Cascade delete a child object when no explicit parent->child relationship exists

    - by John Price
    I've got an application that keeps track of (for the sake of an example) what drinks are available at a given restaurant. My domain model looks like: class Restaurant { public IEnumerable<RestaurantDrink> GetRestaurantDrinks() { ... } //other various properties } class RestaurantDrink { public Restaurant Restaurant { get; set; } public Drink { get; set; } public string DrinkVariety { get; set; } //"fountain drink", "bottled", etc. //other various properties } class Drink { public string Name { get; set; } public string Manufacturer { get; set; } //other various properties } My db schema is (I hope) about what you'd expect; "RestaurantDrinks" is essentially a mapping table between Restaurants and Drinks with some extra properties (like "DrinkVariety" tacked on). Using Fluent NHibernate to set up mappings, I've set up a "HasMany" relationship from Restaurants to RestaurantDrinks that causes the latter to be deleted when its parent Restaurant is deleted. My question is, given that "Drink" does not have any property on it that explicitly references RestaurantDrinks (the relationship only exists in the underlying database), can I set up a mapping that will cause RestaurantDrinks to be deleted if their associated Drink is deleted? Update: I've been trying to set up the mapping from the "RestaurantDrink" end of things using References(x => x.Drink) .Column("DrinkId") .Cascade.All(); But this doesn't seem to work (I still get an FK violation when deleting a Drink).

    Read the article

  • Call child's method or cast parent to child in Rails

    - by Brian
    I have some STI structure like following: class Box has_many :part,:class_name = "Part" end class Part def self.dosomething() end end class TypeA class TypeB assuming we have some codes like boxtypeA = Box.new. I am wondering if there is a way to make boxtypeA.part.dosomething() to call TypeA's method not Part's or TypeB's. I think basically what we need to do is to convert the part to TypeA, how can we achieve that? Thx in advance!

    Read the article

  • Call child's method or cast parent to child in Rails

    - by Brian
    I have some STI structure like following: class Box has_many :part,:class_name = "Part" end class Part def self.dosomething() end end class TypeA<Part def self.dosomething() end end class TypeB<Part def self.dosomething() end end assuming we have some codes like boxtypeA = Box.new. I am wondering if there is a way to make boxtypeA.part.dosomething() to call TypeA's method not Part's or TypeB's. I think basically what we need to do is to convert the part to TypeA, how can we achieve that? Thx in advance!

    Read the article

  • Building a maven child project that depends on another projects child project with Bamboo

    - by kosoant
    I have two maven projects Project AAA * AAA-Core * AAA-Other Project BBB * BBB-Core * BBB-AAA-specific I want to create a build plan in Bamboo to build the BBB-AAA-specific project. The plan configuration is such that this project depends on the AAA-Other projec build. Thus everything should work ok. But when I try to run the BBB-AAA-specific Bamboo plan I get an error that states: "Unable to find resource 'foo.bar.AAA:AAA:pom:0.0.1-SNAPSHOT' in repository snapshots (http://foo.bar.com)" What is going on? The bamboo builds for "AAA-Core" and "AAA-Other" work as expected.

    Read the article

  • How to eager fetch a child collection while joining child collection entities to an association

    - by ShaneC
    Assuming the following fictional layout Dealership has many Cars has a Manufacturer I want to write a query that says get me a Dealership with a Name of X and also get the Cars collection but use a join against the manufacturer when you do so. I think this would require usage of ICriteria. I'm thinking something like this.. var dealershipQuery = Session.CreateCriteria< Dealership>("d") .Add(Restrictions.InsenstiveLike("d.Name", "Foo")) .CreateAlias("d.Cars", "c") .SetFetchMode("d.Cars", FetchMode.Select) .SetFetchMode("c.Manufacturer", FetchMode.Join) .UniqueResult< Dealership>(); But the resulting query looks nothing like I would have expected. I'm starting to think a DetachedCriteria may be required somewhere but I'm not sure. Thoughts?

    Read the article

  • Including JavaScript/CSS into a Master Page from a Child Page as a User Control

    This article describes the method of including the JavaScript/CSS as a user control into a master page from: a child page, a user control included in the child page, a web control included in the child page....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >