Search Results

Search found 21817 results on 873 pages for 'last child'.

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

  • Display database content which is last inserted using last inserted ID

    - by user2330772
    What i am doing is i am displaying last inserted data when form data is submitted,the form is multipart/form-data. I am getting this form data using jquery,here i am sending this data to php file using Ajax POST.In that php file i am inserting that data in db table..where i am getting the id of inserted data..on success of Ajax call i am sending that id to another PHP file..where using that id i am displaying the last inserted data... My form is: <form method="post" enctype="multipart/form-data" name="upload_form" id="data"> <select id="sel"> <option>Select the Project Stream</option> <option value="1">Computer Science</option> <option value="2">Mechanical</option> <option value="3">IT</option> <option value="4">Web Development</option> <option value="5">MCA</option> <option value="6">Civil</option> </select><br /> <input type="text" id="title" placeholder="Project Title"/><br /> <input type="text" id="vurl" placeholder="If You have any video about project write your video url path here" style="width:435px;"/><br /> <textarea id="prjdesc" name="prjdesc" rows="20" cols="80" style="border-style:groove;box-shadow: 10px 10px 10px 10px #888888;"placeholder="Please describe Your Project"></textarea> <label for="file">Filename:</label> <input type="file" name="file" id="file"/><br /> <button>Submit</button> </form> My js file: $("form#data").submit(function() { alert("update"); var sid=$("#sel").val(); alert(sid); var ttle = $("#title").val(); alert(ttle); var text = $("#prjdesc").val(); var vurl = $("#vurl").val(); /*var dataString = 'param='+text+'&param1='+vurl+'&param2='+ttle+'&param3='+id;*/ var formData = new FormData($(this)[0]); formData.append('param',text); formData.append('param1',vurl); formData.append('param2',ttle ); formData.append('param3',sid ); $.ajax({ type:'POST', data:formData, url:'insert.php', success:function(id) { alert(id); window.location ="another.php?id="+id; }, cache: false, contentType: false, processData: false }); return false; }); insert.php: <?php print_r($_FILES); $desc = $_POST['param']; echo $desc; $video = $_POST['param1']; echo $video ; $title = $_POST['param2']; echo $title; $tech_id=$_POST['param3']; echo $tech_id; $host="localhost"; $username="root"; $password=""; $db_name="geny"; $tbl_name="project_details"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $allowedExts = array("gif", "jpeg", "jpg", "png"); $extension = end(explode(".", $_FILES["file"]["name"])); $url_dir = "C:/wamp/www/WebsiteTemplate4/upload/"; if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/jpg") || ($_FILES["file"]["type"] == "image/pjpeg") || ($_FILES["file"]["type"] == "image/x-png") || ($_FILES["file"]["type"] == "image/png")) && ($_FILES["file"]["size"] < 50000) && in_array($extension, $allowedExts)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { if (file_exists($url_dir . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"],$url_dir. $_FILES["file"]["name"]); // echo "Stored in: " . "upload/" . $_FILES["file"]["name"]; $tmp = "C:/wamp/www/WebsiteTemplate4/upload/" . $_FILES["file"]["name"]; $sql="INSERT INTO $tbl_name (title, content, img_path, video_url, project_tech_Id) VALUES ('$title','$desc','$tmp','$video','$tech_id')"; if(mysql_query($sql)) { echo mysql_insert_id(); } else { echo "Cannot Insert"; } } } } else { echo "Invalid file"; } ?> another.php: <?php $temp=$_GET['id']; echo $temp; $host="localhost"; $username="root"; $password=""; $db_name="geny"; $tbl_name="project_details"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $query = mysql_query("SELECT content FROM project_details WHERE id=". $temp); if (!$query) { echo 'Could not run query: ' . mysql_error(); exit; } $row = mysql_fetch_row($query); echo "<div id='uprjct' style='background:#336699;'> <p>$row[0]</p> </div>"; ?> but the ID what i am returning in insert.php containg array of elements...i dont want all these thing i want only ID(which is number).. please tell me what is wrong in my code...

    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

  • 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

  • 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

  • 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

  • SQL SERVER – Validating If Date is Last Day of the Year, Month or Day

    - by Pinal Dave
    Here is one more question I recently received in an email- “Pinal, is there any ready made function which will display if the given date is the last day or the year, month or day? For example, if a date is the last day of the Year and last day of the month, I want to display Last Day of the Year and if a date is the last date of the month and last day of the week, I want to display the last day of the week. “ Well, very interesting question and there is no such function available for the same. However, here is the function I have written earlier for my personal use where I almost accomplish same task. -- Example of Year DECLARE @Day DATETIME SET @Day = '2014-12-31' SELECT CASE WHEN CAST(@Day AS DATE) = CAST(DATEADD(ms,-3,DATEADD(yy,0,DATEADD(yy,DATEDIFF(yy,0,@Day)+1,0))) AS DATE) THEN 'LastDayofYear' WHEN CAST(@Day AS DATE) = CAST(DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,@Day)+1,0)) AS DATE) THEN 'LastDayofMonth' WHEN CAST(@Day AS DATE) = CAST(DATEADD(s,-1,DATEADD(wk, DATEDIFF(wk,0,@Day),0)) AS DATE) THEN 'LastDayofWeek' ELSE 'Day' END GO -- Example of Month DECLARE @Day DATETIME SET @Day = '2014-06-30' SELECT CASE WHEN CAST(@Day AS DATE) = CAST(DATEADD(ms,-3,DATEADD(yy,0,DATEADD(yy,DATEDIFF(yy,0,@Day)+1,0))) AS DATE) THEN 'LastDayofYear' WHEN CAST(@Day AS DATE) = CAST(DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,@Day)+1,0)) AS DATE) THEN 'LastDayofMonth' WHEN CAST(@Day AS DATE) = CAST(DATEADD(s,-1,DATEADD(wk, DATEDIFF(wk,0,@Day),0)) AS DATE) THEN 'LastDayofWeek' ELSE 'Day' END GO -- Example of Month DECLARE @Day DATETIME SET @Day = '2014-05-04' SELECT CASE WHEN CAST(@Day AS DATE) = CAST(DATEADD(ms,-3,DATEADD(yy,0,DATEADD(yy,DATEDIFF(yy,0,@Day)+1,0))) AS DATE) THEN 'LastDayofYear' WHEN CAST(@Day AS DATE) = CAST(DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,@Day)+1,0)) AS DATE) THEN 'LastDayofMonth' WHEN CAST(@Day AS DATE) = CAST(DATEADD(s,-1,DATEADD(wk, DATEDIFF(wk,0,@Day),0)) AS DATE) THEN 'LastDayofWeek' ELSE 'Day' END GO Let me know if you know any other smarter trick and we can post it here with due credit. Reference: Pinal Dave (http://blog.SQLAuthority.com)Filed under: PostADay, SQL, SQL Authority, SQL DateTime, SQL Query, SQL Server, SQL Tips and Tricks, T SQL

    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

  • Rotating a child shape relative to its parent's orientation

    - by user1423893
    When rotating a shape using a quaternion value I also wish rotate its child shape. The parent and child shapes both start with different orientations but their relative orientations should always be the same. How can I use the difference between the previous and current quaternions of the parent shape in order to transform the child segment and rotate it relative to its parent shape? public Quaternion Orientation { get { return entity.Orientation; } set { Quaternion previousValue = entity.Orientation; entity.Orientation = value; // Use the difference between the quaternion values to update child orientation } }

    Read the article

  • How do I Scroll parent page to top when child page is click within iframe?

    - by Evan
    Hello, When someone clicks on a link within an iframe (child page), how do I get the parent page to scroll to the top? The issue is the child page will remain in the same spot of the page, because the iframe has a lot of height larger than the parent page. Please note: the parent and child pages are on different sub domains. I created a demo to show this: http://www.apus.edu/_test/iframe/index.htm

    Read the article

  • How do i select the 1st and then every 4th row in a html-table with nth-child()-selector?

    - by Nils
    Ok, math isn't my strong side, I admit it. All I want to do is to select the first, 5th, 9th, 13th, 17th etc row in a html-table. Can anybody with better math-skills point me in the right directionor perhaps supply a "nth-child-for-dummies" guide? I tried nth-child(1n+4) (which selects the 4th row and everyone after), and i also tried nth-child(0n+4) which selects the fourth row and nothing after that. Thanks in advance.

    Read the article

  • Iterate through all form fields within a specified DIV tag.

    - by user344255
    I need to be able to iterate through all the form fields within a specified DIV tag. Basically, any given DIV tag can have multiple form fields (which is easy enough to parse through), but it can also any number of tables or even additional DIV tags (adding additional levels of hierarchical layering). I've written a basic function that goes through each of the direct descendants of the parent node (in this case, the DIV tag) and it clears out its value. This part works fine. The problem is getting it to parse children when children (grandchildren) of their own. It winds up getting caught up in an infinite loop. In this case, I need be able to find all the form fields within DIV tag "panSomePanel", which will include some direct children (txtTextField1), but also some grandchildren who are within nested TABLE objects and/or nested DIV tags (radRadioButton, DESC_txtTextArea). Here is a sample DIV and its contents: <DIV id="panSomePanel"> <INPUT name="txtTextField1" type="text" id="txtTextField1" size="10"/><BR><BR> <TABLE id="tblRadioButtons" border="0"> <TR> <TD> <INPUT id="radRadioButton_0" type="radio" name="radRadioButton" value="1" /><LABEL for="radRadioButton_0">Value 1</LABEL> </TD> <TD> <INPUT id="radRadioButton_5" type="radio" name="radRadioButton" value="23" /><LABEL for="radRadioButton_5">Value 23</LABEL> </TD> </TR> <TR> <TD> <INPUT id="radRadioButton_1" type="radio" name="radRadioButton" value="2" /><LABEL for="radRadioButton_1">Value 2</LABEL> </TD> <TD> <INPUT id="radRadioButton_6" type="radio" name="radRadioButton" value="24" /><LABEL for="radRadioButton_6">Value 24</LABEL> </TD> </TR> <TR> <TD> <INPUT id="radRadioButton_2" type="radio" name="radRadioButton" value="3" /><LABEL for="radRadioButton_2">Value 3</LABEL> </TD> <TD> <INPUT id="radRadioButton_7" type="radio" name="radRadioButton" value="25" /><LABEL for="radRadioButton_7">Value 25</LABEL> </TD> </TR> <TR> <TD> <INPUT id="radRadioButton_3" type="radio" name="radRadioButton" value="21" /><LABEL for="radRadioButton_3">Value 21</LABEL> </TD> <TD> <INPUT id="radRadioButton_8" type="radio" name="radRadioButton" value="4" /><LABEL for="radRadioButton_8">Value 4</LABEL> </TD> </TR> <TR> <TD> <INPUT id="radRadioButton_4" type="radio" name="radRadioButton" value="22" /><LABEL for="radRadioButton_4">Value 22</LABEL> </TD> </TR> </TABLE> <DIV id="panAnotherPanel"><BR> <TABLE cellpadding="0" cellspacing="0" border="0" style="display:inline;vertical-align:top;"> <TR> <TD valign="top"> <TEXTAREA name="DESC:txtTextArea" rows="3" cols="48" id="DESC_txtTextArea"></TEXTAREA>&nbsp; </TD> <TD valign="top"><SPAN id="DESC_lblCharCount" style="font-size:8pt;"></SPAN> </TD> </TR> </TABLE> </DIV> </DIV> Here is the function I've written: function clearChildren(node) { var child; if (node.childNodes.length > 0) { child= node.firstChild; } while(child) { if (child.type == "text") { alert(child.id); child.value = ""; } else if (child.type == "checkbox") { child.checked = false; } else if (child.type == "radio") { alert(child.id); child.checked = false; } else if (child.type == "textarea") { child.innerText = ""; } //alert(child.childNodes.length); if (child.childNodes.length > 0) { var grandchild = child.firstChild; while (grandchild) { clearChildren(grandchild); } grandchild = grandchild.nextSibling; } child = child.nextSibling; } }

    Read the article

  • Loading child entities with JPA on Google App Engine

    - by Phil H
    I am not able to get child entities to load once they are persisted on Google App Engine. I am certain that they are saving because I can see them in the datastore. For example if I have the following two entities. public class Parent implements Serializable{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true") private String key; @OneToMany(cascade=CascadeType.ALL) private List<Child> children = new ArrayList<Child>(); //getters and setters } public class Child implements Serializable{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true") private String key; private String name; @ManyToOne private Parent parent; //getters and setters } I can save the parent and a child just fine using the following: Parent parent = new Parent(); Child child = new Child(); child.setName("Child Object"); parent.getChildren().add(child); em.persist(parent); However when I try to load the parent and then try to access the children (I know GAE lazy loads) I do not get the child records. //parent already successfully loaded parent.getChildren.size(); // this returns 0 I've looked at tutorial after tutorial and nothing has worked so far. I'm using version 1.3.3.1 of the SDK. I've seen the problem mentioned on various blogs and even the App Engine forums but the answer is always JDO related. Am I doing something wrong or has anyone else had this problem and solved it for JPA?

    Read the article

  • LINQ to XML: suppressing redundant namespace attribute in child nodes

    - by GSerg
    If a node belongs to a namespace, it's children by default belong to the same namespace. So there's no need to provide an xmlns attribute on each child, which is good. However. If I create two nodes like this: Dim parent = <parent xmlns="http://my.namespace.org"/> Dim child = <child xmlns="http://my.namespace.org">value</child> parent.Add(child) Console.WriteLine(parent.ToString) The result is this: <parent xmlns="http://my.namespace.org"> <child xmlns="http://my.namespace.org">value</child> </parent> But, if create them in a less convenient way: Dim parent = <parent xmlns="http://my.namespace.org"/> Dim child As New XElement(XName.Get("child", "http://my.namespace.org")) With {.Value = "value"} parent.Add(child) Console.WriteLine(parent.ToString) The result is more desirable: <parent xmlns="http://my.namespace.org"> <child>value</child> </parent> Obviously, I'd prefer to use the first way because it is so much more intuitive and easy to code. There's also another reason to not use method 2 -- sometimes I need to create nodes with XElement.Parse, parsing a string that contains an xmlns attribute, which produces exactly same results as method 1. So the question is -- how do I get the pretty output of method 2, creating nodes as in method 1? The only option I see is to create a method that would clone given XElement, effectively recreating it according to method 2 pattern, but that seems ugly. I'm looking for a more obvious solution I overlooked for some reason.

    Read the article

  • BizTalk 2009 - Service Instances: Last 100

    - by StuartBrierley
    Having previously talked about the lack of the traditional HAT in BizTalk 2009, the question then becomes how do you replicate some of the functionality that was previsouly relied on? I have already covered the Last 100 Messages Received, the Last 100 Messages Sent, and the Last 50 Suspended Messages queries so what about service instances? The BizTalk 2009 Group Hub allows you to search for suspended service instances and also running service instances, but not the two together. In BizTalk 2004 we had a query in HAT to return the last 100 service instances.  Lets create a direct replacement in the BizTalk 2009 Hatless environment. Basically we are creating a query to search for the last one hundred tracked service instances:

    Read the article

  • BizTalk 2009 - Messages: Last 100 Sent

    - by StuartBrierley
    Having previously talked about the lack of the traditional HAT in BizTalk 2009, the question then becomes how do you replicate some of the functionality that was previsouly relied on? I have already covered the Last 100 Messages Received query so what about sent messages? In BizTalk 2004 we had a query in HAT to return the messages sent in the last day.  While not a direct replacement the following query replicates some of the usefullness of this query in a BizTalk 2009 Hatless environment. Basically we are creating a query to search for the last one hundred tracked messages that were sent by BizTalk: Coming up Messages - last 50 suspended Service instances - last 100

    Read the article

  • BizTalk 2009 - Messages: Last 50 suspended

    - by StuartBrierley
    Having previously talked about the lack of the traditional HAT in BizTalk 2009, the question then becomes how do you replicate some of the functionality that was previsouly relied on? I have already covered the Last 100 Messages Received  and the Last 100 Messages Sent queries so what about suspended messages? In BizTalk 2004 we had a query in HAT to return the last 100 suspended message instances.  Lets create a direct replacement in a BizTalk 2009 Hatless environment. Basically we are creating a query to search for the last fifty messages that were suspended by BizTalk: Coming up Service instances - Last 100

    Read the article

  • jQuery: How to find and change multiply th classes between n & n

    - by Ravex
    Hi everyone. I have some table structure: <tr class="row-2"><tr> <tr class="row-3">..<tr> <tr class="row-4">..<tr> <tr class="row-5">..<tr> <tr class="row-6">..<tr> <tr class="row-7"><tr> <tr class="row-8">..<tr> <tr class="row-9">..<tr> <tr class="row-10">..<tr> <tr class="row-11">..<tr> ...etc for this example TR with classes "row-2" and "row-7" is parrent product link wich expand child rows. <script> $(function() { $('tr.parent') .css("cursor","pointer") .css("color","red") .attr("title","Click to expand/collapse") .click(function(){ $(this).siblings('.child-'+this.id).toggle(); }); $('tr[@class^=child-]').hide().children('td'); }); </script> Rows -3...-6 is child of row-2 and Rows -8...-11 is child of row-7 How i can find row-2, row-7, etc then add second class "parrent" and ID similar class (id="row-2", id="row-7", etc)? Also i need add in each TR between row-2 and row-7 class equal previous parrent row. In bottom line i need something like this: <tr class="row-2 parrent" id="row-2"><tr> <tr class="row-3 child-row2">..<tr> <tr class="row-4 child-row2">..<tr> <tr class="row-5 child-row2">..<tr> <tr class="row-6 child-row2">..<tr> <tr class="row-7 parrent" id="row-7"><tr> <tr class="row-8 child-row7">..<tr> <tr class="row-9 child-row7">..<tr> <tr class="row-10 child-row7">..<tr> <tr class="row-11 child-row7">..<tr> ..etc Thanks for any Help.

    Read the article

  • MVVM - child windows and data contexts

    - by GlenH7
    Should a child window have it's own data context (View-Model) or use the data context of the parent? More broadly, should each View have its own View-Model? Are there are any rules to guide making that decision? What if the various View-Models will be accessing the same Model? I haven't been able to find any consistent guidance on my question. The MS definition of MVVM appears to be silent on child windows. For one example, I have created a warning message notification View. It really didn't need a data context since it was passed the message to display. But if I needed to fancy it up a bit, I would have tapped the parent's data context. I have run into another scenario that needs a child window and is more complicated than the notification box. The parent's View-Model is already getting cluttered, so I had planned on generating a dedicated VM for the child window. But I can't find any guidance on whether this is a good idea or what the potential consequences may be. FWIW, I happen to be working in Silverlight, but I don't know that this question is strictly a Silverlight issue.

    Read the article

  • OIM 11g - Multi Valued attribute reconciliation of a child form

    - by user604275
    This topic gives a brief description on how we can do reconciliation of a child form attribute which is also multi valued from a flat file . The format of the flat file is (an example): ManagementDomain1|Entitlement1|DIRECTORY SERVER,EMAIL ManagementDomain2|Entitlement2|EMAIL PROVIDER INSTANCE - UMS,EMAIL VERIFICATION In OIM there will be a parent form for fields Management domain and Entitlement.Reconciliation will assign Servers ( which are multi valued) to corresponding Management  Domain and Entitlement .In the flat file , multi valued fields are seperated by comma(,). In the design console, Create a form with 'Server Name' as a field and make it a child form . Open the corresponding Resource Object and add this field for reconcilitaion.While adding , choose 'Multivalued' check box. (please find attached screen shot on how to add it , Child Table.docx) Open process definiton and add child form fields for recociliation. Please click on the 'Create Reconcilitaion Profile' buttton on the resource object tab. The API methods used for child form reconciliation are : 1.           reconEventKey =   reconOpsIntf.createReconciliationEvent(resObjName, reconData,                                                            false); ·                                    ‘False’  here tells that we are creating the recon for a child table . 2.               2.       reconOpsIntf.providingAllMultiAttributeData(reconEventKey, RECON_FIELD_IN_RO, true);                RECON_FIELD_IN_RO is the field that we added in the Resource Object while adding for reconciliation, please refer the screen shot) 3.    reconOpsIntf.addDirectBulkMultiAttributeData(reconEventKey,RECON_FIELD_IN_RO, bulkChildDataMapList);                 bulkChildDataMapList  is coded as below :                 List<Map> bulkChildDataMapList = new ArrayList<Map>();                   for (int i = 0; i < stokens.length; i++) {                            Map<String, String> attributeMap = new HashMap<String, String>();                           String serverName = stokens[i].toUpperCase();                           attributeMap.put("Server Name", stokens[i]);                           bulkChildDataMapList.add(attributeMap);                         } 4                  4.       reconOpsIntf.finishReconciliationEvent(reconEventKey); 5.       reconOpsIntf.processReconciliationEvent(reconEventKey); Now, we have to register the plug-in, import metadata into MDS and then create a scheduled job to execute which will run the reconciliation.

    Read the article

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