nested

Java: getting inner type in nested parameterized types (reflection)

Most of the documentation regarding type erasure handling in Java assumes that the use case is handling a type like SomeType<ParamType>. I am trying to process method parameter for the following method: public void setOtherReferenceRanges(List<ReferenceRange<T>> referenceRanges) When the container class is instantiated with a type DvQ...

DefaultModelBinder Problem with nested levels + other binders

I have what I would think is a somewhat normal situation where I need to bind form posts to an "order" model. This model has a few levels of information to it: Order.Billing.FirstName Order.Billing.Address.City Order.Billing.Address.Country Using the DefaultModelBinder, if I POST a form to an action that takes this Order model as the ...

PHP - problem with nested mysql_fetch_array() driving me crazy

The MySQL query: SELECT title,alias,parent FROM '._prefix.'categories WHERE (language = \''._language.'\' || language = \'all\') && status = \'published\' ORDER BY rank ASC The Result (from phpMyAdmin): title | alias | parent Home | home | 0 Todo | todo | 0 Multiuser| todo_mu | 21 Modulsys | todo_mo...

RUby on Rails nested dynamic fields

Hi guys! I have a problem to find the right way to program dynamic fields. For example: I have two radio buttons and depending on how the user selects one radio button, it extends the form with different fields. Start form: - Radio button: car - Radio button: ship - Text field: name If the user clicks on the radio button "car" the for...

.NET nested repeater - Button click calls OnItemCreated eventhandler, not OnItemCommand

I have a project with a simple nested repeater. When i click the button, the OnItemCommand event is not called but the OnItemCreated is called (however, it does not call the Page_Load event handler). What am I misssing? MARKUP <table width="100%"> <tr> <td>my row</td> <td>my description</td> </tr> <asp:Rep...

Nested class in javascript, inheritance of private methods.

Hi to all, i'm quite a newbie in javascript, and i'm spending some time trying to create namespaced objects in js. Now, that's what i'm trying to do: MainObject = function() { var privateVariable = "i'm private"; var privateMethod = function() { // doSomething } this.publicMethod = function() { // doP...

setBaseQuery not working on Tasks in Symfony

Hi, I'm building a Task in Symfony with Doctrine. I'm getting all the places to make a batch update to a particular field. This has to be done in two languages. I'm using setBaseQuery() to make the JOIN on the query with the language I want. If I do the following in an action, it works without any problem. However, If I do it in a task...

How do you make a nested class that can access the members of the class that created it?

Im programming in C#.NET. I want to create a nested class that can access members of the instance that created it but I can't seem to figure out how. This is what I want to do: Car x = new Car() x.color = "red"; x.Door frontDoor = new x.Door(); MessageBox.Show(frontDoor.GetColor()); // So I want the method GetColor of the class Fron...

Nested Set rollback in Doctrine

Hi, I'm importing some content into a Nested Tree model, and I'm implementing a Transaction to be sure each object has been saved; and if not, remove it from the tree. I'm using Doctrine 1.1.6. // Start the transaction $conn = Doctrine_Manager::connection(); try { $conn->beginTransaction(); // add it as a child of the suburb $ob...

Nested forms and automatic creation of parent, children

Guys, I was wondering if it was possible to create new parent, children in a has many relationship, using rails nested forms. Rails documentation clearly says that this works in a one to one relationship. Not sure if its the same in has many relationship. For example: If params = { :employee => { :name => "Tester", :ac...

Rails will return an object successfully, but complains that the object is NIL if I try to access an attribute of it

I am trying to populate a nested field, product_name, it an Item. In my Item model: class Item < ActiveRecord::Base attr_writer :product_name belongs_to :order belongs_to :product def product_name #Product.find_by_id(self.product_id) #=> returns the product object #self.product #=> returns the product object ...

rails complex form and ordering with build

I have complex form similar to a recent Ryan Bates screencast The nested elements work fine however. I'm creating or updating a grid of data such as this through a form where the day's prices are the input. My problem begins when they leave one blank. I have the nested_attributes_for option for not saving nils and it works, if they o...

Editing multiple nested records simultaneously in Rails

I'm creating a simple quiz application where a question can have multiple answers. To improve the usability of my app, I want users to be able to edit ALL the answers for a given question in the same form: I found this great Railscast/Asciicast episode which does almost EXACTLY what I want to do http://asciicasts.com/episodes/198-edit-...

rails validation contigent on multiple elements

I've been using accepts_nested_attributes_for for a few different models and I've got an odd situation. I can skip creation blanks thru the top model, and I can validate_presence of individual records thru the bottom, but is it possible to do a most complex validation on a set of records? I have the models Rooms and Rates. Rooms has_m...

PCRE: Find matching brace for code block

Is there a way for PCRE regular expressions to count how many occurrences of a character it encounters (n), and to stop searching after it has found n occurrences of another character (specifically { and }). This is to grab code blocks (which may or may not have code blocks nested inside them). If it makes it simpler, the input will be...

My includes dont seem to be working now that i have uploaded the files to the production server

They were all working fine on my XAMMP sandbox but now nothing. Something im doing wrong. Here is the code: index.php Contains mass include, which basically has all the includes in it. <?php //Starting session session_start(); //Includes mass includes containing all the files needed to execute the full script //Also shows homepa...

MVC - Remove Master Page of a nested master Page

Hi, I would like to know if there is a way to programatically remove a master page of a nested master page. Lets say i have the following: Master A << Master B << View I am using the master pages actually like a wrapper for my View; they are containing javascript code. In some cases I don't need the Master Page A and I would like ...

How to get instance of nested class in C++

I have the following code: class outer { struct inner { int var1; int var2; inner() { var1 = 1; var2 = 2; } }; inner inner_instance; public: const inner *get_inner() { return &inner_instance; } }; int main(int argc, char *argv[]) { // 1 outer outer_instance; cout << outer_instan...

How to iterate ul and li elements in php?

I am creating dynamic menus and submenus in php.... Can't know where to start.... I have written all my queries but need suggestion to iterate the result set with Ul and li elements with it.... There may are may not be submenus for submenu and there may or may not be submenus for menus..... Menu1 submenu1 submenu11 submenu12...

Ruby on Rails: Nested named scopes

Is there any way to nest named scopes inside of each other from different models? Example: class Company has_many :employees named_scope :with_employees, :include => :employees end class Employee belongs_to :company belongs_to :spouse named_scope :with_spouse, :include => :spouse end class Spouse has_one :employee end Is ...