I'm trying to build a form using the Zend_Form component, but the number of elements varies. The information for each Zend_Form element is stored in a database (name, options, validators, filters, etc.).
The application I'm working on consists of building surveys which contain a varying number of questions. Each question is associated w...
I'd like to supply instance of logged User (or null if nobody logged yet) for all views in my MVC application. I've already succesfully implemented my own ControllerActionInvoker class which overrides InvokeAction and supplies logged user instance in ViewData (controllerContext.Controller.ViewData["LoggedUser"] = xxx). The problem is tha...
I'm toying with Zend Framework and trying to use the "QuickStart" guide against a website I'm making just to see how the process would work. Forgive me if this answer is obvious, hopefully someone experienced can shed some light on this.
I have three database tables:
CREATE TABLE `users` (
`id` int(11) NOT NULL auto_increment,
`ema...
There are lots of great examples around on MVVM but I'm still confused.
Lets say you have a CustomerModel and a CustomerViewModel. It seems there would be a Name property on the CustomerModel and one on the CustomerViewModel. The setter on the CustomerViewModel will set the CustomerModel Name property and then call the OnPropertyChange...
I am using object code model to retrieve search result from sharepoint search..Can any one suggest how do i put advanced search option for my search.Do object code model has the feature to perform advanced search.
...
I have read questions and answers about this topic but I still have some question without answer.
If I create a method to convert Entity to DTO i'll run into some circular calling methods (probably caused by errors in Model), for example:
Product class has a property Supplier that point to a Supplier class that contains a List property...
I'd like to move my models to a separate directory, similar to the way it's done with Rails to cut down on code clutter. Is there any way to do this easily?
Thanks,
Collin
...
I'm using an AJAX form to update an item to the database. When it gets done, it returns a partial view that re-lists all the items and displays them all in a table. The problem occurs when I have to add a modelstate error in my controller action. I don't want to return the list of items when there is a modelstate error because I want ...
I was wondering if anyone knows of existing C++ parsers/code models that can be used programmatically in Java. I'm looking for something similar to the Eclipse CDT that can be used as a library from Java (and that does not rely upon Eclipse). Thanks in advance.
...
Let's say I have four completely independent models (Movie, Book, Game, Album) that control the types of things I have in my media collection. With them I can CRUD and tag individual albums, movies etc.
But I need to keep track, and do some stuff that is common to, all of them. So I figured I need an Item model that would give me a tabl...
Here is the model (I am using SQLLite3):
class School < ActiveRecord::Base
validates_uniqueness_of :name
end
For example, after I add "Yale", I cannot add "Yale" but can add "yale." How can I make the validation case insensitive?
EDIT: Found it - Active Record Validations
...
Using cakephp:
I am trying to update customer information and the address the customer is linked to.
such that Customer.address_id = Address.id, and
Customer Model
$belongsTo = 'Address';
From the customers_controller
function profile($id = null)
{
if (empty($this->data['Customer']))
{
$this->Customer->id = $id;
$thi...
Hi,
I am creating a Report Model Project in Visual Studio 2005. In the data source view, I am adding the entities that represent subsets of the data of my tables. For some tables, there is a 1-many relationship.
For example, Entity A has a Primary Key of A_ID, and links to Entity B through this field which is present in both A and B. F...
I have read that errors.add_to_base should be used for errors associated with the object and not a specific attribute. I am having trouble conceptualizing what this means. Could someone provide an example of when I would want to use each?
For example, I have a Band model and each Band has a Genre. When I validate the presence of a ge...
I have a Server application with a GUI. Written in c#.
Now I want to use the MVC pattern for the whole Application.
Normally you have 1 Model, 1 Controller and maybe n views. Okay, I have one of everything, but I'm not sure with the Model.
My Situation:
There are 1 server state, that can be online / offline, that has a client count, et...
I use a snippet in http://www.djangosnippets.org/snippets/1034/ for my Model inheritance. It works fine at the first. However, after I delete some elements in database, the code works wrong.
As I debug, I found that the problem is reside in the method: as_leaf_class.
In the following code:
if (model == Meal):
return self
return mode...
I've chosen to move Form processing from Controller to MyForm class, in order to follow ThinController/FatModel rule. But some of my code in Zend_Form class needs to perform
a redirect.
In Zend_Controller_Action my redirect was:
$this->_redirect('/');
What would it become in Zend_Form?
...
I have problem in my model. I want method to use another property of model but before using it I want another method to be executed (to make property have value). Here is an example:
def medthod_one=(val)
self.value = val
end
def method_two
self.second_value = self.value / 2 #just for example
end
So, in my case self.second_...
I want to be able to take a dynamically created string, say "Pigeon" and determine at runtime whether Google App Engine has a Model class defined in this project named "Pigeon". If "Pigeon" is the name of a existant model class, I would like to then get a reference to the Pigeon class so defined.
Also, I don't want to use eval at all, s...
What's the easiest static (non-animating) 3d model format to load with Java? I used .obj in C++, but that's a pain to do in java. Is there anything better?
...