Search Results

Search found 9178 results on 368 pages for 'nth element'.

Page 37/368 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • How to use Map element as text of a JComboBox

    - by llm
    I am populating a JComboBox (using addItem()) with all the elements of a collection. Each element in the collection is a HashMap (so its a ComboBox of Hashmaps..). My question is - Given that I need each item to be a HashMap how do I set the text to apear in the combobox on the GUI? It needs to be the value of a certain key in the map. Normally if I am populating a combobox with my own type, I would just overide the toString() method...but I am not sure how to acheive this since I am using a Java HashMap. Any ideas (if possible, without implementing my own HashMap)? Update: It seems like there isn't anyway to avoid having the object int the JComboBox overide toString() if I want custom functionality..I wish there was a way to (1) specify the objects to be loaded into the JComboBox and (2) specify how these objects are to appear in the GUI.

    Read the article

  • JAXB Marshalling supply name space for root element dynamically

    - by Venkat
    I have to pass the namespace for root element dynamically while marshalling using jaxb (JAXB 2.1.10 - JDK 6). i will be using the genrated xml to call different webservices which is qualified with different namespaces but same input xml. here is my sample jaxb annotated class .....guide me with your valuable inputs. @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "taskName", "taskType" }) @XmlRootElement(name = "TaskRequest") public class TaskRequest { @XmlElement(name = "TaskName", required = true) protected String taskName; @XmlElement(name = "TaskType", required = true) protected String taskType; public String getTaskName() { return taskName; } public void setTaskName(String value) { this.taskName = value; } public String getTaskType() { return taskType; } public void setTaskType(String value) { this.taskType = value; } }

    Read the article

  • get all widgets inside an element

    - by peirix
    From the dojo documents on dijit.registry, I see the forEach method accepts a last parameter thisObject. But it doesn't way what that object is. Is it a dijit widget or a dojo object? I want to destroy all widgets inside an element (that will be replaced by AJAX) so they can be parsed again without conflicting id's. dijit.registry.forEach(function(w) { w.destroyRecursive(); }, dojo.byId("ajaxElement")); But this destroys ALL widgets on the page...

    Read the article

  • Apply function to one element of a list in Python

    - by user189637
    I'm looking for a concise and functional style way to apply a function to one element of a tuple and return the new tuple, in Python. For example, for the following input: inp = ("hello", "my", "friend") I would like to be able to get the following output: out = ("hello", "MY", "friend") I came up with two solutions which I'm not satisfied with. One uses a higher-order function. def apply_at(arr, func, i): return arr[0:i] + [func(arr[i])] + arr[i+1:] apply_at(inp, lambda x: x.upper(), 1) One uses list comprehensions (this one assumes the length of the tuple is known). [(a,b.upper(),c) for a,b,c in [inp]][0] Is there a better way? Thanks!

    Read the article

  • add element to the DOM with JS

    - by john
    I want add element with JS. I have code: var collection = document.getElementsByTagName('body');<br> var a = document.createElement('div');<br> a.innerHTML = 'some text';<br> collection.item(0).firstChild.appendChild(a);<br> and simple HTML: <html> <head> </head> <body> </body> </html> When is misstake?

    Read the article

  • Visual Studio 2010 element names for theming

    - by Anthony Potts
    I am trying to figure out what the element name for the tooltip is in Visual studio so that I can change the style using the extension found here. Anyone know what that is? I am using the default theme which seems to have a white to light grey gradient on it. This is less than optimal since the text for the functions are also white. In a more general question (and perhaps better), is there anything that maps the names as they are found in the theme to where they are in the IDE.

    Read the article

  • jquery: animating html5 video element?

    - by mathiregister
    is it possible to animate a html5 video element <div id="cont"> <video id="movie" width="320" height="240" preload controls> <source src="pr6.ogv" type='video/ogg; codecs="theora, vorbis"'> <source src="pr6.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'> <source src="pr6.webm" type='video/webm; codecs="vp8, vorbis"'> </video> </div> <script type="text/javascript"> $(document).ready(function(){ $('#cont').animate({"left": "500px"}, "fast"); //$('#movie').css("left", "300px"); }); </script> this seems not to work! thank you for your help

    Read the article

  • Get element using id problem

    - by Ebe
    I am modifying existing legacy webpages(which i shouldn't modify existing parts but adding) and the webpage uses document.write to write certain html elements. when i use <script type="text/javascript" language="javascript"> var v = document.getElementById('td_date_cal_0'); alert(v); </script> v becomes null and when i create button and click <input type="button" id="mnbutton" onclick="mnLoader();" value="Click Me!" />; <script type="text/javascript" language="javascript" > function mnLoader() { var v = document.getElementById("td_date_cal_0"); alert(v); } <br /> </script> Any idea, how to get the element without need of user action, such as clicking? Thanks, Ebe

    Read the article

  • calculate the height of parent element

    - by shruti
    Hi, I have three datagrids inside VBox container. Since I don't want scrollbar in my flex widget i am increasing the height of SWF through javascript, which increases with each addition of row in my datagrid. My query is how can I get the exact height of my VBox which is the parent element of datagrid. I am not able to get the height of VBox. I have tried to use measuredHeight,height with no success. Could anybody please suggest me the way out for the same. Thanks in advance!!!

    Read the article

  • Javascript to sort contents of select element

    - by Jangwenyi
    Hi, is there a quick way to sort the items of a select element? Or I have to resort to writing javascript? Please any ideas. <select size="4" name="lstALL" multiple="multiple" id="lstALL" tabindex="12" style="font-size:XX-Small;height:95%;width:100%;"> <option value="0"> XXX</option> <option value="1203">ABC</option> <option value="1013">MMM</option> </select>

    Read the article

  • Jquery return element html instead of content

    - by jim smith
    I have something like this <ul> <li class="aclass" id="a">content</li> <li class="aclass" id="b">content</li> <li class="aclass" id="c">content</li> <li class="aclass" id="d">content</li> <li class="aclass" id="e">content</li> <li class="aclass" id="f">content</li> </ul> I have code like $(".aclass").live("mousedown",function() { alert($this.html()); }); This will alert the content, what I would like to do is alert the entire element like <li class="aclass" id="f">content</li> I've tried $(this).parent() but that returns the whole UL

    Read the article

  • JQuery add hidden element to form programmatically

    - by vanzylv
    Hi Guys This is really getting to me now.I have a form that loads when the page loads.In my jquery 'ready' function I append a hidden to that form like so : $("<input id='thehidden' type='hidden' name='thehidden' value='hiddenval'>").appendTo("#MenuForm") When I check the form content with firebug i can see the element is added. ["$(\"#MenuForm\").children()"] is [div, input#thehidden hiddenval] All good so far.When I submit this form and try and read the elemet again,i can't get the value of the new hidden val I added. alert($('#thehidden').val()) is undefined Any help would be appreciated

    Read the article

  • jQuery selector after dynamically created element

    - by Bryan Williams
    I am trying to get an dynamically created element using a jQuery selector but it is returning an empty array. The first thing I am doing is grabbing an empty div: var packDiv = document.getElementById('templates'); packDiv.innerHTML = ""; then adding items to it in a loop: packDiv.innerHTML = packDiv.innerHTML + "<img id='" + thumbName + "' src='thumbs/" + thumbName + "'/>"; after the loop finishes I try to select an item using: console.log($("#"+thumbName)); and it returns the empty array. All the things I search on show to use .on but all the examples show that is to set event handlers. My question is how do I format a selector for dynamically created elements?

    Read the article

  • XML Parsing Error: no element found

    - by Anilkumar
    XML Parsing Error: no element found Line Number 1, Column 1: I want to download a Excel file. I wrote the data in a html table format and appending to the response. The code is following : Response.Buffer = false; Response.Expires = 0; Response.Clear(); Response.ContentType = "application/vnd.ms-excel"; Response.AddHeader("Content-Disposition", "attachment; filename=" + FileName); Response.Write(str); Response.End();

    Read the article

  • SQL query showing element more than once.

    - by Sorin Cioban
    Hi guys, I have the following SQL query but it doesn't entirely work because it shows each element more than once. select c.name, c.director, c.title, count(c.title) as numfilms from casting c join casting c1 on c1.name = c.name Group by c.name, c.director, c.title Having count (c.title) > 1 order by numfilms So what it does it shows which actors have made more than 1 film. But unfortunately, this query shows each actor as many times as the number of movies he made. Using distinct doesn't work as actor may have been in different movie with same title and different director.

    Read the article

  • Zend Studio 7.1 PHPUnit Test Case wizard does not populate "Element to Test"

    - by Mike
    When I follow the instructions in ZS documentation to create a phpunit test case, the wizard returns no objects to select on the "Element to Test" line. Selecting "browse" provides an empty dialog box. The PHPUnit path in my preferences shows "/Applications/zend/zs710/plugins/com.zend.php.phpunit_7.1.0.v20091120-0900/resources/library/". What else can I check to see why I cannot create a test case? I'm new to ZS and PHP, so I have no idea how to troubleshoot this. Thanks.

    Read the article

  • duplicate one element from php array

    - by robertdd
    how i can duplicate one element from array: for example, i have this array: Array ( [LRDEPN] => 0008.jpg [OABCFT] => 0030.jpg [SIFCFJ] => 0011.jpg [KEMOMD] => 0022.jpg [DHORLN] => 0026.jpg [AHFUFB] => 0029.jpg ) if i want to duplicate this: 0011.jpg , how to proceed? i want to get this: Array ( [LRDEPN] => 0008.jpg [OABCFT] => 0030.jpg [SIFCFJ] => 0011.jpg [NEWKEY] => 0011.jpg [KEMOMD] => 0022.jpg [DHORLN] => 0026.jpg [AHFUFB] => 0029.jpg )

    Read the article

  • how do i specify the element when loading content ajax jquery

    - by phukkie
    How can I specify an element where the content is to be retrieved from within the pageurl in the code below? $(function () { $("a[rel='sort']").click(function (e) { //e.preventDefault(); /* if uncomment the above line, html5 nonsupported browers won't change the url but will display the ajax content; if commented, html5 nonsupported browers will reload the page to the specified link. */ //get the link location that was clicked pageurl = $(this).attr('href'); //to get the ajax content and display in div with id 'content' $.ajax({ url: pageurl + '?rel=sort', success: function (data) { $('#content1').html(data); } }); //to change the browser URL to 'pageurl' if (pageurl != window.location) { window.history.pushState({ path: pageurl }, '', pageurl); } return false; }); });

    Read the article

  • Get other classes from an element with Jquery

    - by Jigs
    I am working on a small bit of script that will allow for easy and flexible creation of buttons. My buttons are made of three parts, a left, a right and a streched middle piece. There are three different sizes and three different colours of each. I have written the code that resizes the button to fit the text. Now I am looking to add the ability to easily set the colour and size. I was thinking of using three classes something like <div class="button blue big"> My script already loops through the button classes using each. Now I need to find out what other classes are set and adjust the pictures and dimentions used to fit. So how can I find out what other class selectors an element has? Also I am fairly new to jquery/javascript so I am wondering if storing the design as class selectors is the best way.

    Read the article

  • Sorting a meta-list by first element of children lists in Python

    - by thismachinechills
    I have a list, root, of lists, root[child0], root[child1], etc. I want to sort the children of the root list by the first value in the child list, root[child0][0], which is an int. Example: import random children = 10 root = [[random.randint(0, children), "some value"] for child in children] I want to sort root from greatest to least by the first element of each of it's children. I've taken a look at some previous entries that used sorted() and a lamda function I'm entirely unfamiliar with, so I'm unsure of how to apply that to my problem. Appreciate any direction that can by given Thanks

    Read the article

  • jquery dynamically genearate element id in a loop

    - by phil
    This is a loop in a function intending to create elements <li> and give each <li> an unique id. But it's not working. I suspect it's a simple syntax error with the use of quote in .attr(). But I can't get a straight answer from Google. for (i=0;i<array.length;i++) { //create HTML element of tag li $('#suggest').append("<li></li>"); $("li").attr("id",'li'+i); $('#li'+i).html(array[i]); }

    Read the article

  • jQuery access each matched element from '.find' by an index

    - by GHarping
    Using jQuery's .find() method to return a set of elements, I am trying to access items in the returned set by their order in that set. For example, a table with two rows and in each row a select box and two text input fields, accessed with the following: $('table#tbl').find('tr.row').each(function(i) { }); To get the first element I would have thought I could use $('table#tbl').find('tr.row').each(function(i) { alert( $(this).find(':input').get(1).val() ); }); And variations of the above, but apparently this doesn't work. Could anyone suggest the correct method to access item x of n elements returned?

    Read the article

  • Scrolling through list element causes text elements to scroll as well

    - by DMK
    I'm using a list element with variableRowHeight and word-wrap set to true like in the example below: http://blog.flexexamples.com/2007/10/27/creating-multi-line-list-rows-with-variable-row-heights/ When I scroll through the list with a mouse scrollwheel the text in the listItems also scroll. I know that this is to do with the height of the textField... but I am unsure how to best resolve this issue. Any thoughts are appreciated! The issue that I am experiencing also occurs in the example above.

    Read the article

  • jquery(selector) how to select the last element from two different classes

    - by Yasir Laghari
    for the following html <div> <div class="col1" > I dont want to select this </div> <div class="col2"> I dont want to select this </div> <div class="col1"> I dont want to select this </div> <div class="col1"> I dont want to select this </div> <div class="col2"> I WANT to select this </div> </div> How do I select the last element with two different class names? Tried using $("col1:last,col2:last) but it gives back 2 elements tried $("col1,col2:last") and this gives all col1 and last of col2

    Read the article

  • Cant get the proper use for DropDownListFor with a model and a viewbag element

    - by EH_warch
    I have a list of locations set in the ViewBag element like this: public ActionResult Create() { var db = new ErrorReportingSystemContext(); IEnumerable<SelectListItem> items = db.Locations .AsEnumerable() .Select(c => new SelectListItem { Value =c.id.ToString(), Text = c.location_name }); ViewBag.locations = items; return View(); } I'm trying to get the values from ViewBag.locations from the view like this @Html.DropDownListFor(model => model.location_fk_id, ViewBag.locations); //@Html.DropDownListFor(model => model.location_fk_id, @ViewBag.locations); //@Html.DropDownListFor(model => model.location_fk_id, "locations"); But no avail. How can i use it?

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >