Search Results

Search found 7007 results on 281 pages for 'nested lists'.

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

  • flex 3 using nested repeaters

    - by ccdugga
    I'm trying to loop through a row of an arraycollection using nested repeater; <mx:Repeater id="rp1" dataProvider="{arrayCollection}"> <mx:Repeater id="rp2" dataProvider="{rp1.currentItem}"> <mx:Button height="49" width="50" label="{rp2.currentItem.name}" /> </mx:Repeater> </mx:Repeater> What im trying to do is make the repeater loop through all the attributes in the currentRow, eg. name,age, address etc. At the moment all i do is call rp2.currentItem.name which explicitly calls out the name of the attribute and then the value is returned. Is it possible instead of explicity naming the attribute to just loop through them all and dispplay button for each using the nested repeater?thanks

    Read the article

  • Nested function inside literal Object...

    - by Andrea
    Hello guys, if in a literal object i try to reference a function using "this" inside a nested property/function, this don't work. Why? A nested property have it's own scope? For example, i want to call f1 from inside d.f2: var object = { a: "Var a", b: "Var b", c: "Var c", f1: function() { alert("This is f1"); }, d: { f2: function() { this.f1(); } }, e: { f3: function() { alert("This is f3"); } } } object.f1(); // Work object.d.f2(); // Don't Work. object.e.f3(); // Work Thanks, Andrea.

    Read the article

  • gcc returns error with nested class

    - by Nate
    Howdy, I am attempting to use the fully qualified name of my nested class as below, but the compiler is balking! template <class T> class Apple { //constructors, members, whatevers, etc... public: class Banana { public: Banana() { //etc... } //other constructors, members, etc... }; }; template <class K> class Carrot{ public: //etc... void problemFunction() { Apple<int>::Banana freshBanana = someVar.returnsABanana(); //line 85 giveMonkey(freshBanana); //line 86 } }; My issue is, the compiler says: Carrot.h:85: error: expected ';' before 'freshBanana' Carrot.h:86: error: 'freshBanana' was not declared in this scope I had thought that using the fully qualified name permitted me to access this nested class? It's probably going to smack me in the face, but what on earth am I not seeing here??

    Read the article

  • using nested arrays by php http_build_query() and recieve them in flash AS3

    - by Mahmoud
    hi, i am having this hard time figuring what is needed to do, i am using URLVariables to send/recieve values between flash and PHP the problem is, i am unable to access nested arrays ( array inside an array ) with flash heres an example: $dgresult = array("total" = $results); echo http_build_query($dgresult,"flf_"); in flash, all i need to do is to use: var variables:URLVariables = new URLVariables(e.target.data); then i can access it with : variables.total the problem now is when i have nested arrays: $dgresult = array("total" = $results); array_push($dgresult,$another_array); http_build_query($dgresult,"flf_"); i can still access variables.total but what about anything that has flf_ ? how is that possible?

    Read the article

  • Mysql SELECT nested query, very complicated?

    - by smartbear
    Okay, first following are my tables: Table house: id | items_id | 1 | 1,5,10,20 | Table items: id | room_name | refer 1 | kitchen | 3 5 | room1 | 10 Table kitchen: id | detail_name | refer 3 | spoon | 4 5 | fork | 10 Table spoon: id | name | color | price | quantity_available | 4 | spoon_a | white | 50 | 100 | 5 | spoon_b | black | 30 | 200 | How to do a nested select statement, where I want to select id, name, color, price and quantity_available column, from the each value inside the 'items_id' column in 'house' table? This is very challenging!! EDIT: after read robin's answer Table house: id | items_id | house1 | 1 | house1 | 5 | house1 | 10 | house2 | 20 | If this it the house table, how to do the nested, join, or whatever select statement??

    Read the article

  • AssociationTypeMismatch with Expected Type on Nested Model Forms

    - by Craig Walker
    I'm getting this exception when doing a nested model form: ActiveRecord::AssociationTypeMismatch in RecipesController#update Ingredient(#35624480) expected, got Ingredient(#34767560) The models involved are Recipe and Ingredient. Recipe has_many and accepts_nested_attributes_for :ingredients, which belongs_to :recipe. I get this exception when attempting to _destroy (=1) one of the preexisting Ingredients on a nested Ingredient form for the Recipe Edit/Update. This makes very little sense, mostly because the association types are as expected (by the exception's own admission). What makes even less sense is that it works just fine in a functional test. Any ideas what might be causing this, or what I should be looking for?

    Read the article

  • Nested form using accepts_nested_attributes_for with pre-population from another table

    - by mikeydelamonde
    I'm using Rails 2.3.5 and have a nested structure as follows: Lists has_many Items Items_Features has_many Features Items_Features has_many Items Items_Features has a text field to hold the value of the feature Then I have a nested form with partials to update and display this so that it updates Lists, Items and Items_Features What I want to do is generate input fields for each of the rows in features so that the user can fill in a value and it gets inserted/updated in items_features. I also want a label next to the box to display the feature name. It might look like this: List name: Cheeses Item1 name: Edam Feature, hardness: - fill in - <= this list of features from feature table Feature, smell: - fill in - How can I interrupt the nice and easy accepts_nested_attributes_for system to display this as I want?

    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

  • Nested Set - for CMS with two versions (edit / publish) mode

    - by Rick
    Hi! I'm looking for a solution (PHP/Symfony/Doctrine) for the following problem. I'm creating a table called 'pages'. This table is a nested set. I also want to create a table called 'pages_published' which has ofcourse also a nested set. Once i create a record in table 'pages' at some point i want to publish this to the 'pages_published)-table. How do make sure the sort order and the level in the structure keeps ok. Is there some standard solution for my approach?

    Read the article

  • Modularity Java: top level vs. nested classes

    - by an00b
    The Java tutorials that I read, like to use nested classes to demonstrate a concept, a feature or use. This led me to initially implement a sample project I created just like that: Lots of nested classes in the main activity class. It works, but now I got a monstrous monolithic .java file. I find it somewhat inconvenient and I now intend to break to multiple .java files/classes. It occurred to me, however, that sometimes there may be reasons not to take classes out of their enclosing class. If so, what are good reasons to keep a module large, considering modularity and ease of maintenance?

    Read the article

  • Xcode debugger showing assembler for nested classes in a static library

    - by Massif
    I have a project A which creates a static library. I have a project B which uses this library. When I am debugging project B, certain functions within project A will display assembler when stepped into or when a breakpoint set inside them is hit. In the debug navigator, the line containing the function is grey instead of black. The strange part is that other functions in the same source file have no problems displaying. The thing that all these functions seem to have in common is that they belong to nested classes. However, I'm not totally convinced that this is the issue since functions from other nested classes display correctly. Does anyone know the cause of this?

    Read the article

  • TVirtualStringTree compatibility between Delphi 7 and Delphi 2010 - 'Parameter lists differ'

    - by Brian Frost
    Hi, I've made a form containing a TVirtualStringTree that works in Delphi 7 and Delphi 2010. I notice that as I move between the two platforms I get the message '...parameter list differ..' on the tree events and that the string type is changing bewteen TWideString (D7) and string (D2010). The only trick I've found to work to suppress this error is to use compiler directives as follows: {$IFDEF TargetDelphi7} procedure VirtualStringTree1GetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType; var CellText: WideString); {$ELSE} procedure VirtualStringTree1GetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType; var CellText: string); {$ENDIF} and to repeat this where the events are implemented. Am I missing a simple solution? Thanks.

    Read the article

  • Newbie Python programmer tangling with Lists.

    - by Sergio Tapia
    Here's what I've got so far: # A. match_ends # Given a list of strings, return the count of the number of # strings where the string length is 2 or more and the first # and last chars of the string are the same. # Note: python does not have a ++ operator, but += works. def match_ends(words): counter = 0 for word in words: if len(word) >= 2 and word[0] == word[-1]: counter += counter return counter # +++your code here+++ return I'm following the Google Python Class, so this isn't homework, but me just learning and improving myself; so please no negative comments about 'not doing my homework'. :P What do you guys think I'm doing wrong here? Here's the result: match_ends X got: 0 expected: 3 X got: 0 expected: 2 X got: 0 expected: 1 I'm really loving Python, so I just know that I'll get better at it. :)

    Read the article

  • Replicating multicolumn lists from the Django admin CSS

    - by mfalcon
    Hi, I'm developing a Django project and I've to show a multicolumn list for the different objects of a table. I like the design of the django-admin for showing list-objects so I looked at the code to see how it works. As I am a CSS begginer the code seemed a bit difficult and extensive to comprehend. Is there a simplier way to make what I want or actually the CSS code of the django-admin is the path to follow?

    Read the article

  • Flatten (an irregular) list of lists in Python

    - by telliott99
    Yes, I know this subject has been covered before (here, here, here, here), but AFAIK, all solutions save one choke on a list like this: L = [[[1, 2, 3], [4, 5]], 6] where the desired output is [1, 2, 3, 4, 5, 6] or perhaps even better, an iterator. The only solution I saw that works for an arbitrary nesting is from @Alabaster Codify here: def flatten(x): result = [] for el in x: if hasattr(el, "__iter__") and not isinstance(el, basestring): result.extend(flatten(el)) else: result.append(el) return result flatten(L) So to my question: is this the best model? Did I overlook something? Any problems?

    Read the article

  • what's faster: merging lists or dicts in python?

    - by tipu
    I'm working with an app that is cpu-bound more than memory bound, and I'm trying to merge two things whether they be sets or dicts. Now the thing is i can choose either one, but I'm wondering if merging dicts would be faster since it's all in memory? Or is it always going to be O(n), n being the size of the smaller set. The reason I asked about dicts rather than sets is because I can't convert a set to json, because that results in {key1, key2, key3} and json needs a key/value pair, so I am using a dict so json dumps returns {key1:1, key2:1, key3:1}. Yes this is wasteful, but if it proves to be faster then I'm okay with it.

    Read the article

  • Custom Items in Lists in C# forms?

    - by chaz
    I'm a bit new to the C#-form app developing and I want know, what's the best way around at making a control that holds a list of horizontal items. In which each of these items are horizontally ruled to it's parent control, contain a thumbnail to the left and a large text block to the right of image and a smaller text block underneath that. So basically this isn't a predefined control I can find in the toolbox. Any ideas?

    Read the article

  • Skip Lists -- ever used them?

    - by Head Geek
    I'm wondering whether anyone here has ever used a skip list. It looks to have roughly the same advantages as a balanced binary tree, but is simpler to implement. If you have, did you write your own, or use a pre-written library (and if so, what was its name)?

    Read the article

  • Predicates and Lists

    - by George
    Hello guys, I have a generic list. Some elements of this list belong to a parent element. I retrieved all these elements from a database and i want to recursively build a tree with them. So, here's what i'm thinking: Here is my predicate: public static bool FindChildren(Int32 parentId,CategoryMapping catMapping) { if (catMapping.parentId == parentId) { return true; } else { return false; } } root = list[0]; root.childrenElements = root.FindAll(FindChildren(root.id,???) I can't figure out how this would work. How can i do this kind of predicate?

    Read the article

  • Common elements comparison between 2 lists.

    - by Daniel
    def common_elements(list1, list2): """ Return a list containing the elements which are in both list1 and list2 >>> common_elements([1,2,3,4,5,6], [3,5,7,9]) [3, 5] >>> common_elements(['this','this','n','that'],['this','not','that','that']) ['this', 'that'] """ for element in list1: if element in list2: return list(element) Got that so far, but can't seem to get it to work! Thanks

    Read the article

  • android nested lists

    - by Raogrimm
    i'm new to programming android and i have found some useful things for my app, but i can't seem to find how to make a list filled with an string array display a new list that is going to be populated with a string array. i would like to have the user choose an item from the top_menu list and from there go to the desired area and have that array appear. this is what i have so far: public class HelloListActivity extends ListActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String[] top_menu = getResources().getStringArray(R.array.top_menu); setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, top_menu)); ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { ??? } }); } all my arrays are working fine, i just don't know how to repopulate a new list with the other array depending on the choice the user made. any help is greatly appreciated

    Read the article

  • Rails Nested Forms Attributes not saving if Fields Added with jQuery

    - by looloobs
    Hi I have a rails form with a nested form. I used Ryan Bates nested form with jquery tutorial and I have it working fine as far as adding the new fields dynamically. But when I go to submit the form it does not save any of the associated attributes. However if the partial builds when the form loads it creates the attribute just fine. I can not figure out what is not being passed in the javascript that is failing to communicate that the form object needs to be saved. Any help would be great. class Itinerary < ActiveRecord::Base accepts_nested_attributes_for :trips end itinerary/new.html <% form_for ([@move, @itinerary]), :html => {:class => "new_trip" } do |f| %> <%= f.error_messages %> <%= f.hidden_field :move_id, :value => @move.id %> <% f.fields_for :trips do |builder| %> <%= render "trip", :f => builder %> <% end %> <%= link_to_add_fields "Add Another Leg to Your Trip", f, :trips %> <p><%= f.submit "Submit" %></p> <% end %> application_helper.rb def link_to_remove_fields(name, f) f.hidden_field(:_destroy) + link_to_function(name, "remove_fields(this)") end def link_to_add_fields(name, f, association) new_object = f.object.class.reflect_on_association(association).klass.new fields = f.fields_for(association, new_object, :child_index => "new_#{association}") do |builder| render(association.to_s.singularize, :f => builder) end link_to_function(name, h("add_fields(this, \"#{association}\", \"#{escape_javascript(fields)}\")")) end application.js function add_fields(link, association, content) { var new_id = new Date().getTime(); var regexp = new RegExp("new_" + association, "g") $(link).parent().before(content.replace(regexp, new_id)); }

    Read the article

  • How to add and remove nested model fields dynamically using Haml and Formtastic

    - by Brightbyte8
    We've all seen the brilliant complex forms railscast where Ryan Bates explains how to dynamically add or remove nested objects within the parent object form using Javascript. Has anyone got any ideas about how these methods need to be modified so as to work with Haml Formtastic? To add some context here's a simplified version of the problem I'm currently facing: # Teacher form (which has nested subject forms) [from my application] - semantic_form_for(@teacher) do |form| - form.inputs do = form.input :first_name = form.input :surname = form.input :city = render 'subject_fields', :form => form = link_to_add_fields "Add Subject", form, :subjects # Individual Subject form partial [from my application] - form.fields_for :subjects do |ff| #subject_field = ff.input :name = ff.input :exam = ff.input :level = ff.hidden_field :_destroy = link_to_remove_fields "Remove Subject", ff # Application Helper (straight from Railscasts) def link_to_remove_fields(name, f) f.hidden_field(:_destroy) + link_to_function(name, "remove_fields(this)") end def link_to_add_fields(name, f, association) new_object = f.object.class.reflect_on_association(association).klass.new fields = f.fields_for(association, new_object, :child_index => "new_#{association}") do |builder| render(association.to_s.singularize + "_fields", :f => builder) end link_to_function(name, h("add_fields(this, \"#{association}\", \"#{escape_javascript(fields)} \")")) end #Application.js (straight from Railscasts) function remove_fields(link) { $(link).previous("input[type=hidden]").value = "1"; $(link).up(".fields").hide(); } function add_fields(link, association, content) { var new_id = new Date().getTime(); var regexp = new RegExp("new_" + association, "g") $(link).up().insert({ before: content.replace(regexp, new_id) }); } The problem with implementation seems to be with the javascript methods - the DOM tree of a Formtastic form differs greatly from a regular rails form. I've seen this question asked online a few times but haven't come across an answer yet - now you know that help will be appreciated by more than just me! Jack

    Read the article

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