Search Results

Search found 15231 results on 610 pages for 'presentation model'.

Page 57/610 | < Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >

  • ASP.NET MVC Model Binders, html id

    - by Stacey
    Using the Model Binders in ASP.NET MVC 2.0, you can do something like this... [DisplayName("User Name")] public string Name { get; set; } <%: Html.TextBoxFor( m => m.Name ) :%> and then in your HTML, you get a result like this.. <label for="UserName">User Name</label> <input type="text" id="UserName" name="UserName" /> That works fine, but I want to have better control over the HTML ID. Is there any way to do this through the model binding method?

    Read the article

  • How do I pass a javascript parameter to an asp.net MVCmodel from within a View?

    - by Josh
    Hi everyone! I am having an issue trying to access a list property on a model from within a javascript. My basic situation is this: I have an ArticleController and an ArticleViewModel. An Article has a number of properties, one of which is Text, which is just a string that contains the contents of the article. The ArticleViewModel contains a Pages property, which is just a List of Strings. When the ArticleViewModel constructor is called, I populate the Pages list by dividing up the article text based on some delimeters. I have a View which inherits the ArticleViewModel type. What I want to do is only display one page at a time, and then when the user clicks a page number (from a list at the bottom of the article), I want to use javascript to load that page into the #dynamicContent div. The problem: I can't seem to pass a parameter to the Model.Pages property from within javascript... Is this possible? I get an error stating, "Expression Expected" when I try what I have below. I don't want to have to worry about AJAX calls or anything like that since I already have the entire article... I just need a way to access each individual page from within the javascript function. Alternatively, if there is a better solution for "paginating" an article so that I can load each articlePage without having to refresh the entire html page, I would certainly be open to that as well. Any help would be much appreciated!! Thanks for your time! ArticleView Code: Script at the top of the view: function loadPage(pageNumber) { try { alert(pageNumber); $('#dynamicContent').html('<%=Model.Pages(' + pageNumber + ') %>'); } catch (e) { alert('in here'); alert(e.description); } } HTML for view: [...] <div id="articleBody"> <div id="dynamicContent"> <%=Model.Pages(0)%> </div> </div> [...] Page Links at bottom of page: [...] <div> <ul style="display:block"> <li style="display:inline"> <a href="#articleTitle" onclick="loadPage(0)"> 1 </a> </li> <li style="display:inline"> <a href="#articleTitle" onclick="loadPage(1)"> 2 </a> </li> </ul> </div>

    Read the article

  • Change find() type of contained model or array transformation

    - by Ramon Marco Navarro
    I have the following model associations: Response->Survey Response->Question Response->Choice Survey->Question Question->Choice I want to create a form where I could answer all the questions for one survey. So I used the following to return the needed data: $questions = $this->Response->Question->find('all', array( 'conditions' => array('survey_id' => $id), 'contain' => array('Choice') ) ); Sample output for debug($questions). Questions Is there a contain() option so that an associated model returns in the find('list') format so that I could use: foreach($question as $questions) { $this-Form-select('field_name', $question['Choice']); } If no option is available, how could I do this using PHP's builting array methods? PS: The foreach block won't turn into a code block. If someone could edit and fix it, please do so and delete this line. Thank you.

    Read the article

  • Flex 4: Loading XML into a Model Actionsript Class

    - by Steve
    I'm trying to create an actionscript class to serve as a data model for my Flex app. I already have a formatted XML file to read from, and when I was simply declaring the data service in my MXML app I used this code inside the declarations: I'm now trying to create a model class and can't seem to get the same functionality. I've tried importing mx.rpc.http.HTTPService but i think this is different. And using the XML class doesn't seem to allow the ability to define a source url. I'm assuming that I am able to declare a public var inside my class that will read this XML source file as I had done in the main app. If this is possible, how do I do it?

    Read the article

  • Access to related Objects inside a model propery

    - by aliem
    Hi, I just run into some problems with django models. Example code is better than any word: class Cart(models.Model): updated_at = models.DateTimeField(auto_now=True) created_at = models.DateTimeField(auto_now_add=True) def __unicode__(self): return u'date %s;'%(self.created_at) def __str__(self): return self.__unicode__() def _total_items(self): """ Totale n di oggetti """ a = 0 for i in self.items.all: a += i.quantity return a total_items = property(_total_items) class Item(models.Model): cart = models.ForeignKey(Cart) quantity = models.PositiveIntegerField() def __unicode__(self): return u'product %s'%(self.id) def __str__(self): return self.__unicode__() but, when i call the cart property here's what i get in the python console: >>> a.total_items Traceback (most recent call last): File "<console>", line 1, in <module> File "models.py", line 49, in _total_items for i in self.item_set.all: TypeError: 'RelatedManager' object is not callable

    Read the article

  • c# .net MVC4 Model to represent table or form

    - by Matthew Chambers
    Hello I am a little confused with regards to models in mvc 4 and thought someone may be able to point me in the right direction. This would be most appreciated. For example if i have a table that has the following fields [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 5)] public string UserName { get; set; } [Required(ErrorMessage="Email Address is Required")] [StringLength(15, ErrorMessage = "Email Address must be between {0} and {1} in size",MinimumLength = 5 )] [DataType(DataType.EmailAddress)] [Display(Name="Email")] public string Email { get; set; } [MaxLength(25)] [Display(Name="Mobile Telephone Number")] public string Mobile {get;set;} [MaxLength(500)] [Display(Name="Headline")] public string Headline {get;set;} [Required] [StringLength(200)] [Display(Name = "First Name")] public string FirstName {get;set;} [Required] [StringLength(200)] [Display(Name="Surname")] public string Surname { get; set;} public virtual int? DayOfBirthId { get; set; } public virtual DayOfBirth DayOfBirth { get; set; } public virtual int? MonthOfBirthId { get; set; } public virtual MonthOfBirth MonthOfBirth { get; set; } public virtual int? YearOfBirthId { get; set; } public virtual YearOfBirth YearOfBirth{get;set;} This is my user profile table in the database. However I would like a form that the user registers to the site with. When they first register i do not need all the details such as telephone all i really need is there username, email address and password. Do i create another model for this. Or do i have one model and on the controller set the fields to null or empty string that are not required on registration. I have validation also so would this be set for data that has not been entered on the form. My question is ultimately should all forms represent models- should the database be redesigned to meet this required. Or should the controller set the values that are not required. Or should there be another model that represents the form be created which maps to this table. I am a little confused on this and clarification of anyone would be most appreciated.

    Read the article

  • About presenter pattern in rails. is a better way to do it?

    - by Totty
    I have in my model: def presenter @presenter ||= ProfilePresenter.new(self) @presenter end The ProfilePresenter is a class that has methods like, get_link(), get_img_url(size), get_sex(), get_relationship_status() and other methods that have not to do with the model, not even with the controller but is used multiple times in the view. So now i use them by doing this: Profile.presenter.get_link # or Profile.presenter.get_img_url('thumb') # returns the path of the image. is not used to make a db query

    Read the article

  • Oracle BI and XS Energy Drinks – Don’t Miss the Amway Presentation!

    - by Maria Forney
    Amway is a global leader in the direct sales industry with $10.9B in annual sales in more than 100 countries and territories. The company has implemented a global BI framework that provides accurate, consistent, and timely insights to support global, regional and local analytical research, business planning, performance measurement and assessment. Oracle BI EE is used by 1500 employees across Amway sales, marketing, finance, and supply chain business units as well as Amway affiliates in Europe, Russia, South Africa, Japan, Australia, Latin America, Malaysia, Vietnam, and Indonesia. Last week, I spoke with Lead Data Analyst with Amway Global Sales, Dan Arganbright, and IT Manager with Amway BI Competency Center, Mike Olson, about their upcoming presentation at Oracle OpenWorld in San Francisco. Scheduled during a prime speaking slot on Monday, October 1 at 12:15pm in Moscone West, 2007, Dan and Mike will discuss their experience building Amway’s Distributor Consulting solution, powered by Oracle BI EE. You can find more information here. As background, Amway offers people an opportunity to own their own businesses and consumers exclusive products in health and wellness, beauty and home care.  The Amway internal Sales organization is charged with consulting leadership-level Distributors to help them with data insights and ultimately grow their business. Until recently, this was a resource-intense process of gathering and formatting data. In some markets, it took over 40 hours to collect the data and produce the analysis needed for one consultation session. Amway began its global BI journey in 2006 and since then the company has migrated from having multiple technology providers and integration points to an integrated strategic vendor approach. Today, the company has standardized on Oracle technology for BI.  Amway has achieved cost savings through the retirement of redundant technology platforms. In addition, Mike’s organization has led the charge to align disparate BI organizations into a BI Competency Center.  The following diagram highlights the simplicity of the standardized architecture of Amway today. Dubbed Distributor Consulting, Amway has developed a BI solution using the Oracle technology stack to help Distributor leaders grow their businesses. The Distributor Consulting solution provides over 40 metrics for Sales staff to provide data-driven insights on the Distributors and organizations they support.  Using Oracle BI EE, Exadata, and Oracle Data Integrator, Amway provides customized and personalized business intelligence, and the Oracle BI EE dashboards were developed by the Amway Sales organization, which demonstrates business empowerment of the technology. Amway is also leveraging the power of BI to drive business growth in all of its markets.  A new set of Distributor Segmentation metrics are enabling a better understanding of distributor behaviors. A Global Scorecard that Amway developed provides key metrics at a market and global level for executive-level discussions. Product Analysis teams can now highlight repeat purchase rates, product penetration and the success of CRM campaigns. In the words of Dan and Mike, the addition of Exadata 11 months ago has been “a game changer.”  Amway has been able to dramatically reduce complexity, improve performance and increase business productivity and cost savings. For example, the number of indexes on the global data warehouse was reduced from more than 1,000 to less than 20.  Pulling data for the highest level distributors or the largest markets in the company now can be done in minutes instead of hours.  As a result, IT has shifted from performance tuning and keeping the system operational to higher-value business-focused activities. •       “The distributors that have been introduced to the BI reports have found them extremely helpful. Because they have never had this kind of information before, when they were presented with the reports, they wanted to take action immediately!”  -     Sales Development Manager in Latin America Without giving away more, the Amway case study presentation will be one of the unique customer sessions at OpenWorld this year. Speakers Dan Arganbright and Mike Olson have planned an interactive and entertaining session on Monday October 1 at 12:15pm in Moscone West, 2007. I’ll see you there!

    Read the article

  • Oracle BI and XS Energy Drinks – Don’t Miss the Amway Presentation!

    - by Michelle Kimihira
    By Maria Forney Amway is a global leader in the direct sales industry with $10.9B in annual sales in more than 100 countries and territories. The company has implemented a global BI framework that provides accurate, consistent, and timely insights to support global, regional and local analytical research, business planning, performance measurement and assessment. Oracle BI EE is used by 1500 employees across Amway sales, marketing, finance, and supply chain business units as well as Amway affiliates in Europe, Russia, South Africa, Japan, Australia, Latin America, Malaysia, Vietnam, and Indonesia. Last week, I spoke with Lead Data Analyst with Amway Global Sales, Dan Arganbright, and IT Manager with Amway BI Competency Center, Mike Olson, about their upcoming presentation at Oracle OpenWorld in San Francisco. Scheduled during a prime speaking slot on Monday, October 1 at 12:15pm in Moscone West, 2007, Dan and Mike will discuss their experience building Amway’s Distributor Consulting solution, powered by Oracle BI EE. You can find more information here. As background, Amway offers people an opportunity to own their own businesses and consumers exclusive products in health and wellness, beauty and home care.  The Amway internal Sales organization is charged with consulting leadership-level Distributors to help them with data insights and ultimately grow their business. Until recently, this was a resource-intense process of gathering and formatting data. In some markets, it took over 40 hours to collect the data and produce the analysis needed for one consultation session. Amway began its global BI journey in 2006 and since then the company has migrated from having multiple technology providers and integration points to an integrated strategic vendor approach. Today, the company has standardized on Oracle technology for BI.  Amway has achieved cost savings through the retirement of redundant technology platforms. In addition, Mike’s organization has led the charge to align disparate BI organizations into a BI Competency Center.  The following diagram highlights the simplicity of the standardized architecture of Amway today. Dubbed Distributor Consulting, Amway has developed a BI solution using the Oracle technology stack to help Distributor leaders grow their businesses. The Distributor Consulting solution provides over 40 metrics for Sales staff to provide data-driven insights on the Distributors and organizations they support.  Using Oracle BI EE, Exadata, and Oracle Data Integrator, Amway provides customized and personalized business intelligence, and the Oracle BI EE dashboards were developed by the Amway Sales organization, which demonstrates business empowerment of the technology. Amway is also leveraging the power of BI to drive business growth in all of its markets.  A new set of Distributor Segmentation metrics are enabling a better understanding of distributor behaviors. A Global Scorecard that Amway developed provides key metrics at a market and global level for executive-level discussions. Product Analysis teams can now highlight repeat purchase rates, product penetration and the success of CRM campaigns. In the words of Dan and Mike, the addition of Exadata 11 months ago has been “a game changer.”  Amway has been able to dramatically reduce complexity, improve performance and increase business productivity and cost savings. For example, the number of indexes on the global data warehouse was reduced from more than 1,000 to less than 20.  Pulling data for the highest level distributors or the largest markets in the company now can be done in minutes instead of hours.  As a result, IT has shifted from performance tuning and keeping the system operational to higher-value business-focused activities. •       “The distributors that have been introduced to the BI reports have found them extremely helpful. Because they have never had this kind of information before, when they were presented with the reports, they wanted to take action immediately!”  -     Sales Development Manager in Latin America Without giving away more, the Amway case study presentation will be one of the unique customer sessions at OpenWorld this year. Speakers Dan Arganbright and Mike Olson have planned an interactive and entertaining session on Monday October 1 at 12:15pm in Moscone West, 2007. I’ll see you there!

    Read the article

  • How to rotate a group of objects around a common center?

    - by user1662292
    I've made a model in 3D Studio Max 9. It consists of a variety of cubes, clyinders etc. In XNA I've imported the model okay and it shows correctly. However, when I apply rotation, each component in the model rotates around it's own centre. I want the model to rotate as a single unit. I've linked the components in 3D Max and they rotate as I want in Max. protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); model = Content.Load<Model>("Models/Alien1"); } protected override void Update(GameTime gameTime) { camera.Update(1f, new Vector3(), graphics.GraphicsDevice.Viewport.AspectRatio); rotation += 0.1f; base.Update(gameTime); } protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); Matrix[] transforms = new Matrix[model.Bones.Count]; model.CopyAbsoluteBoneTransformsTo(transforms); Matrix worldMatrix = Matrix.Identity; Matrix rotationYMatrix = Matrix.CreateRotationY(rotation); Matrix translateMatrix = Matrix.CreateTranslation(location); worldMatrix = rotationYMatrix * translateMatrix; foreach (ModelMesh mesh in model.Meshes) { foreach (BasicEffect effect in mesh.Effects) { effect.World = worldMatrix * transforms[mesh.ParentBone.Index]; effect.View = camera.viewMatrix; effect.Projection = camera.projectionMatrix; effect.EnableDefaultLighting(); effect.PreferPerPixelLighting = true; } mesh.Draw(); } base.Draw(gameTime); } More Info: Rotating the object via it's properties works fine so I'm guessing there's something up with the code rather than with the object itself. Translating the object also causes the objects to get moved independently of each other rather than as a single model and each piece becomes spread around the scene. The model is in .X format.

    Read the article

  • MVC and delegation

    - by timjver
    I am a beginning iOS programmer and use the Model-View-Controller model as a design pattern: my model doesn't know anything about my view (in order to make it compatible with any view), my view doesn't know anything about my model so they interact via my controller. A very usual way for a view to interact with the controller is through delegation: when the user interacts with the app, my view will notify my controller, which can call some methods of my model and update my view, if necessary. However, would it make sense to also make my controller the delegate of my model? I'm not convinced this is the way to go. It could be handy for my model to notify my controller of some process being finished, for example, or to ask for extra input of the user if it doesn't have enough information to complete the task. The downside of this, though, is that my controller would be the delegate for both my controller and my model, so there wouldn't be really a proper way to notify my model of changes in my view, and vice versa. (correct me if I'm wrong.) Conclusion: I don't really think it's a good idea to to have my controller to be the delegate of my model, but just being the delegate of my view would be fine. Is this the way most MVC models handle? Or is there a way to have the controller be the delegate of both the controller and the model, with proper communication between them? Like I said, I'm a beginner, so I want to do such stuff the right way immediately, rather than spending loads of hours on models that won't work anyway. :)

    Read the article

  • Convert .png images into a .ppt presentation on Linux?

    - by darenw
    I've created a presentation as a series of .png images, one per slide. What is a good way to convert these into a .ppt (PowerPoint) that I can give to some audio-visual person? I'm entirely on Linux, with no Windows or Mac software available. (Or maybe PowerPoint isn't the only game in town for presentation file formats?)

    Read the article

  • Imagine Cup 2011 : présentation de la catégorie Développement Embarqué du concours de Microsoft pour les étudiants, inscriptions jusqu'au 27 janvier

    Imagine Cup 2011 : présentation de la catégorie Développement Embarqué Du concours de Microsoft pour les étudiants, inscriptions jusqu'au 27 janvier La désormais célèbre compétition de développement organisée par Microsoft pour les étudiants touche aussi au développement embarqué. Une catégorie exigeante mais dont les résultats peuvent être impressionnants. Dans cette catégorie, le but est de développer une application sur une plateforme Windows CE qui aura elle-même été adaptée aux besoins des candidats organisés en équipe de 1 à 4 membres (la présence d'un mentor est conseillée). Rappelons que les version Embedded de Windows sont particulièrement conçues pour être modulables et ...

    Read the article

  • BindAttribute, Exclude nested properties for complex types

    - by David Board
    I have a 'Stream' model: public class Stream { public int ID { get; set; } [Required] [StringLength(50, ErrorMessage = "Stream name cannot be longer than 50 characters.")] public string Name { get; set; } [Required] [DataType(DataType.Url)] public string URL { get; set; } [Required] [Display(Name="Service")] public int ServiceID { get; set; } public virtual Service Service { get; set; } public virtual ICollection<Event> Events { get; set; } public virtual ICollection<Monitor> Monitors { get; set; } public virtual ICollection<AlertRule> AlertRules { get; set; } } For the 'create' view for this model, I have made a view model to pass some additional information to the view: public class StreamCreateVM { public Stream Stream { get; set; } public SelectList ServicesList { get; set; } public int SelectedService { get; set; } } Here is my create post action: [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create([Bind(Include="Stream, Stream.Name, Stream.ServiceID, SelectedService")] StreamCreateVM viewModel) { if (ModelState.IsValid) { db.Streams.Add(viewModel.Stream); db.SaveChanges(); return RedirectToAction("Index", "Service", new { id = viewModel.Stream.ServiceID }); } return View(viewModel); } Now, this all works, apart from the [Bind(Include="Stream, Stream.Name, Stream.ServiceID, SelectedService")] bit. I can't seem to Include or Exclude properties within a nested object.

    Read the article

  • Where should 'CreateMap' statements go?

    - by jonathanconway
    I frequently use AutoMapper to map Model (Domain) objects to ViewModel objects, which are then consumed by my Views, in a Model/View/View-Model pattern. This involves many 'Mapper.CreateMap' statements, which all must be executed, but must only be executed once in the lifecycle of the application. Technically, then, I should keep them all in a static method somewhere, which gets called from my Application_Start() method (this is an ASP.NET MVC application). However, it seems wrong to group a lot of different mapping concerns together in one central location. Especially when mapping code gets complex and involves formatting and other logic. Is there a better way to organize the mapping code so that it's kept close to the ViewModel that it concerns? (I came up with one idea - having a 'CreateMappings' method on each ViewModel, and in the BaseViewModel, calling this method on instantiation. However, since the method should only be called once in the application lifecycle, it needs some additional logic to cache a list of ViewModel types for which the CreateMappings method has been called, and then only call it when necessary, for ViewModels that aren't in that list.)

    Read the article

  • Why does my data not pass into my view correctly?

    - by dmanexe
    I have a model, view and controller not interacting correctly, and I do not know where the error lies. First, the controller. According to the Code Igniter documentation, I'm passing variables correctly here. function view() { $html_head = array( 'title' => 'Estimate Management' ); $estimates = $this->Estimatemodel->get_estimates(); $this->load->view('html_head', $html_head); $this->load->view('estimates/view', $estimates); $this->load->view('html_foot'); } The model (short and sweet): function get_estimates() { $query = $this->db->get('estimates')->result(); return $query; } And finally the view, just to print the data for initial development purposes: <? print_r($estimates); ?> Now it's undefined when I navigate to this page. However, I know that $query is defined, because it works when I run the model code directly in the view.

    Read the article

  • How to nest joins with CakePHP?

    - by Daren Thomas
    I'm trying to behave. So, instead of using following SQL syntax: select * from tableA INNER JOIN tableB on tableA.id = tableB.tableA_id LEFT OUTER JOIN ( tableC INNER JOIN tableD on tableC.tableD_id = tableD.id) on tableC.tableA_id = tableA.id I'd like to use the CakePHP model->find(). This will let me use the Paginator too, since that will not work with custom SQL queries as far as I understand (unless you hardcode one single pagination query to the model which seems a little inflexible to me). What I've tried so far: /* inside tableA_controller.php, inside an action, e.g. "view" */ $this->paginate['recursive'] = -1; # suppress model associations for now $this->paginate['joins'] = array( array( 'table' => 'tableB', 'alias' => 'TableB', 'type' => 'inner', 'conditions' => 'TableB.tableA_id = TableA.id', ), array( 'table' => 'tableC', 'alias' => 'TableC', 'type' => 'left', 'conditions' => 'TableC.tableA_id = TableA.id', 'joins' = array( # this would be the obvious way to do it, but doesn't work array( 'table' => 'tableD', 'alias' => 'TableD', 'type' => 'inner', 'conditions' => 'TableC.tableD_id = TableD.id' ) ) ) ) That is, nesting the joins into the structure. But that doesn't work (CakePHP just ignores the nested 'joins' element which was kind of what I expected, but sad. I have seen hints in comments on how to do subqueries (in the where clause) using a statement builder. Can a similar trick be used here?

    Read the article

  • Model Object called in NSOutlineView DataSource Method Crashing App

    - by Alec Sloman
    I have a bewildering problem, hoping someone can assist: I have a model object, called Road. Here's the interface. @@@ @interface RoadModel : NSObject { NSString *_id; NSString *roadmapID; NSString *routeID; NSString *title; NSString *description; NSNumber *collapsed; NSNumber *isRoute; NSString *staff; NSNumber *start; NSArray *staffList; NSMutableArray *updates; NSMutableArray *uploads; NSMutableArray *subRoads; } @property (nonatomic, copy) NSString *_id; @property (nonatomic, copy) NSString *roadmapID; @property (nonatomic, copy) NSString *routeID; @property (nonatomic, copy) NSString *title; @property (nonatomic, copy) NSString *description; @property (nonatomic, copy) NSNumber *collapsed; @property (nonatomic, copy) NSNumber *isRoute; @property (nonatomic, copy) NSString *staff; @property (nonatomic, copy) NSNumber *start; @property (nonatomic, copy) NSArray *staffList; @property (nonatomic, copy) NSMutableArray *updates; @property (nonatomic, copy) NSMutableArray *uploads; @property (nonatomic, copy) NSMutableArray *subRoads; - (id)initWithJSONObject:(NSDictionary *)JSONObject; @end This part is fine. To give you some background, I'm translating a bunch of JSON into a proper model object so it's easier to work with. Now, I'm trying to display this in an NSOutlineView. This is where the problem is. In particular, I have created the table and a datasource. - (id)initWithRoads:(NSArray *)roads { if (self = [super init]) root = [[NSMutableArray alloc] initWithArray:roads]; return self; } - (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item { if (item == nil) return root.count; return 0; } - (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item { return NO; } - (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item { if (item == nil) item = root; if (item == root) return [root objectAtIndex:index]; return nil; } - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item { return [item title]; } In the final datasource method, it attempts to return the "title" string property of the model object, but for some reason crashes each time. I have checked that the method is taking in the correct object (I checked [item class] description], and it is the right object), but for some reason if I call any of the objects accessors the app immediately crashes. This is totally puzzling because in the init method, I can iterate through root (an array of RoadModel objects), and print any of its properties without issue. It is only when I'm trying to access the properties in any of the datasource methods that this occurs. I wonder if there is something memory-wise that is going on behind the scenes and I am not providing for it. If you can shed some light on to this situation, it would be greatly appreciated! Thanks in advance!

    Read the article

  • MVC 2 - Name Attributes on HTML Input Field when using Parent/Child Entities

    - by Click Ahead
    Hi All, I'm pretty new to MVC 2 using the Entity Framework. I have two tables Company {ID int identity PK,Name nvarchar} and User {ID int identity PK,UserName nvarchar,CompanyID int FK}. A Foreign Key exists between User and Company. I generated my ADO.NET Entity Data Model, a Controller and a view to insert a record. My HTML form has the fields Company and UserName and the idea is when I click save a Company and User is inserted into the database. Sounds straight forward right! My question is as follows: I created a strongly-typed view derived from my 'User' entity. I'm using the the html helper Html.TextBoxFor(model = model.Organisation.Name) but the html name attribute for this input field is 'Organisation.Name'. My problem with this is that the dot throws up all sorts of issues in JQuery, which sees this as a property. If I want to change the name I read that I can use DataAnnotations but because I used the Entity Designer this involves using Buddy Classes. Seems like a bit of overkill just to change the html name attribute on this input field. Am I approaching this the right way or am I missing something here? Thanks for the help !

    Read the article

  • How do I get started designing and implementing a script interface for my .NET application?

    - by Peter Mortensen
    How do I get started designing and implementing a script interface for my .NET application? There is VSTA (the .NET equivalent of VBA for COM), but as far as I understand I would have to pay a license fee for every installation of my application. It is an open source application so this will not work. There is also e.g. the embedding of interpreters (IronPython?), but I don't understand how this would allow exposing an "object model" (see below) to external (or internal) scripts. What is the scripting interface story in .NET? Is it somehow trivial in .NET to do this? Background: I have once designed and implemented a fairly involved script interface for a Macintosh application for acquisition and analysis of data from a mass spectrometer (Mac OS, System 7) and later a COM interface for a Windows application. Both were designed with an "object model" and classes (that can have properties). These are overloaded words, but in a scripting interface context object model is essentially a containment hiarchy of objects of specific classes. Classes have properties and lists of contained objects. E.g. like in the COM interfaces exposed in Microsoft Office applications, where the application object can be used to add to its list of documents (with the side effect of creating the GUI representation of a document). External scripts can create new objects in a container and navigate through the content of the hiarchy at any given time. In the Macintosh case scripts could be written in e.g. AppleScript or Frontier. On the Macintosh the implementation of a scripting interface was very complicated. Support for it in Metroworks' C++ class library (the name escapes me right now) made it much simpler.

    Read the article

  • How to maintain an ordered table with Core Data (or SQL) with insertions/deletions?

    - by Jean-Denis Muys
    This question is in the context of Core Data, but if I am not mistaken, it applies equally well to a more general SQL case. I want to maintain an ordered table using Core Data, with the possibility for the user to: reorder rows insert new lines anywhere delete any existing line What's the best data model to do that? I can see two ways: 1) Model it as an array: I add an int position property to my entity 2) Model it as a linked list: I add two one-to-one relations, next and previous from my entity to itself 1) makes it easy to sort, but painful to insert or delete as you then have to update the position of all objects that come after 2) makes it easy to insert or delete, but very difficult to sort. In fact, I don't think I know how to express a Sort Descriptor (SQL ORDER BY clause) for that case. Now I can imagine a variation on 1): 3) add an int ordering property to the entity, but instead of having it count one-by-one, have it count 100 by 100 (for example). Then inserting is as simple as finding any number between the ordering of the previous and next existing objects. The expensive renumbering only has to occur when the 100 holes have been filled. Making that property a float rather than an int makes it even better: it's almost always possible to find a new float midway between two floats. Am I on the right track with solution 3), or is there something smarter?

    Read the article

  • How to validate properties across Models without repeating the validation logic

    - by Mano
    Hello All, I am building a ASP.NET Mvc app. I have a Data model say User public class user { public int userId {get; private set}; public string FirstName {get; set;} } The validation to be done is that the firstname cannot exceed 50 characters. I have another presentation model in which i have the property FirstName too. I do not want to repeat the validation logic in both the models. I want to have it in one place and that should be it. I can do it in a simpler way by adding a function which can be called while setting the property like private string firstName; public string FirstName { get { return firstName; } set { if (PropertyValidator.ValidName(value)) // assuming ValidName exists and it will throw an exception if the value is not valid { firstName = value; } } } But I am looking for something much simpler so that I do not need to add this for every property I need to have it validated. I looked at ValidationAttribute but then again I can validate this only from a controller (ModelState.IsValid). Since this model could be used by some other type of apps like console app, I could not choose that. But if there is a way to use the Mvc's ModelState.IsValid from outside of a controller, that would be awesome. Any suggestions are greatly appreciated. Thanks!!

    Read the article

< Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >