w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Issue unit testing an asp.net MVC controller that inherits from a custom base controller
You maybe forget to set the membership provider in your webconfig: <system.web> <membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="20"> </system.web>

Categories : Asp Net Mvc

Creating a form for a controller inside the show of another controller
Try this @post.candidatures.build @post.candidatures.each {|candidature| candidature.responses.build } But as I wrote in comment you overcomplicated the model structure and I belive you should rethink it.

Categories : Ruby On Rails

issue with fields names when using Rails form with Angularjs client side form validation
I don't know if you since found a solution to this issue, I was facing the same problem, I found an issue had been opened on GitHub : https://github.com/angular/angular.js/issues/1201 The solution is pretty simple, in your case you simply do : <span ng-show="signUpForm['user[email]'].$error.required">

Categories : Ruby On Rails

Java servlet: issue with multipart/form-data form
Initialize a FileItem, like below: FileItem fileItem = null; Then call this method public boolean getParameters(HttpServletRequest request, PrintWriter out) { List fileItemsList = null; try { if (ServletFileUpload.isMultipartContent(request)) { ServletFileUpload servletFileUpload = new ServletFileUpload(new DiskFileItemFactory()); try { fileItemsList = servletFileUpload.parseRequest(request); } catch (FileUploadException ex) { } String optionalFileName = ""; Iterator it = fileItemsList.iterator(); while (it.hasNext()) { FileItem fileItemTemp = (FileItem) it.next(); if (fileItemTemp.isFormField()) { // for other fo

Categories : Java

Tab Bar Controller / Segue Issue
You definitely shouldn't be segueing between tab bar vc's. Just save the data and refresh the other view on viewWillAppear. Call setSelectedViewController when necessary, but never segue between tab bar vc's.

Categories : Misc

Issue with controller generation in rails
You are not following the convention for generating controllers. Generating a controller will not create a database table. You have to do that by calling rails generate model, rails generate resource or rails generate scaffold. So you want a controller for a few static pages. Try this rails generate controller static_pages home help contact Notice the generator is plural and snake case (static_pages). this will generate the static controller and the home.html.erb, help.html.erb, and contact.html.erb pages Now you can access the pages with these actions in the controller def home end def help end def contact end Also need to make sure the routes are set up # routes.rb match '/home', to: 'static_pages#home' match '/help', to: 'static_pages#help' match '/contact', to: '

Categories : Ruby On Rails

Issue when submitting a param into controller
Change the parameter in PIndex to particalview [HttpPost] public ActionResult PIndex(string particalview) { if (particalview == "1") ViewBag.Page = 1; else if(particalview == "2") ViewBag.Page = 2; if(particalview == null) ViewBag.Page = 3; return View(); }

Categories : Asp Net Mvc

REST with Spring Controller issue
You forget to add the leguname to the url: use /leagues/SuperHero/levels/ instead (/leagues/levels/) If you want to filter out /leagues/levels/`, then you can try to add an additional handler method: @RequestMapping(value="/leagues/levels/") for example, to return all levels of any league

Categories : Spring

dismissViewControllerAnimated issue: presenting controller is gone
The documentation says about dismissViewControllerAnimated:completion: The presenting view controller is responsible for dismissing the view controller it presented. If you call this method on the presented view controller itself, it automatically forwards the message to the presenting view controller. If you present several view controllers in succession, thus building a stack of presented view controllers, calling this method on a view controller lower in the stack dismisses its immediate child view controller and all view controllers above that child on the stack. When this happens, only the top-most view is dismissed in an animated fashion; any intermediate view controllers are simply removed from the stack. The top-most view is dismissed using its modal transition style, whic

Categories : IOS

Delegates issue in source controller
You're missing an opening parenthesis: -(void)playerDetailsViewController: PlayerDetailsViewController *)controller ... should be: -(void)playerDetailsViewController:(PlayerDetailsViewController *)controller ...

Categories : IOS

[google form]Creating form with a script : Page Break and go to page issue
You only need to change the order of your operations; you do not need to keep the operations on item together. Here's an example, using your code: function createForm() { var title = 'Multipage Form Test'; var description = 'Stackoverflow question 17083500'; var form = FormApp.create(title) .setDescription(description) .setConfirmationMessage('Thanks for responding!'); var page1 = form.addPageBreakItem() .setTitle('First page'); var item = form.addMultipleChoiceItem(); var page2 = form.addPageBreakItem() .setTitle('Second page'); var page3 = form.addPageBreakItem() .setTitle('Third page'); item.setTitle('Question') .setChoices([ item.createChoice('Yes',page2), item.createChoice('No',page3) ]); Logger.log(fo

Categories : Forms

Issue loading View Controller from UITabBarController
It looks like -viewDidLoad is getting called before your view controller stack is added to the window. Two things you could try are: Delaying until the next time through the run loop (this should give the view controllers time to get in place) [self performSelector:@selector(loadLogin) withObject:self afterDelay:0];. This method won't allow you to call a method with two arguments directly You could use -presentViewController: animated: completion:. This will cause your login controller to slide in from the bottom.

Categories : IOS

MVC design issue with notification from view to controller
Since you didn't provide any code I'll assume that the ViewController is the object that caused the animation. If so, then the ending of the animation should be handled inside a block. Example: [UIView animateWithDuration:0.5 animations:^(void) { your animation code here } completion:^(BOOL finished) { your completion code here }];

Categories : Iphone

ASP MVC4: A issue when manipulating variable value in controller
I'm guessing you're asking because it's not giving the result you expect, rather than because you want someone to try it for you. The easy answer (assuming you meant "On the B's View Page") is "This is B". A RedirectToAction will send a redirection to the browser, which initiates a new request to the server. Unfortunately a ViewBag's life is only for a single request, so it will no longer be populated when action B runs. You will need to find another way to pass the data; for example, in a cookie or within the Session object.

Categories : Asp Net Mvc

What must I do to redirect to a Web Form from an MVC controller?
May be this link will be helpful: Response.Redirect to another url This is simular question about redirection from controller to .aspx The main idea is to use return Redirect("url");instead Response.Redirect("url");

Categories : Asp Net Mvc

ECSlidingViewController swipe gesture issue on View Controller
I've struggled too in the beginning when I used ECSlidingViewController. This video tutorial helped me a lot http://youtu.be/tJJMyzdB9uI (Check part 2 and 3 also).

Categories : IOS

Issue regarding posting data to controller using jquery $.post
500 error code means that mostly likely a runtime error was generated in your controller's action method. If you actually inspect the response in the Net tab of Firebug, it should tell you what the error was. Off the cuff, for example, I can see that you have no check to determine if any State was actually returned from the query. It could potentially be null, and if it's null then you'll get runtime errors to the effect of "null property doesn't have this method" all over the place.

Categories : Asp Net Mvc

MVC4 Entity Framework Controller Database Issue
You declared client as IEnumerable<CourierClient>. That is why compiler tells you that it does not have properties, which you expect to find in CourierClient. CourierClient client = (from c in db.CourierClients where c.ClientName == job.PickupCompanyName select c).SingleOrDefault(); if (client != null) { client.Address = job.PickupAddress1; client.City = job.PickupCity; client.State = job.PickupState; client.Zip = job.PickupZip; client.Phone = job.PickupPhone; db.Entry(client).State = EntityState.Modified; } else { client = new CourierClient(); client.ClientName = job.PickupCompanyName; client.Address = job.PickupAddress1;

Categories : Entity Framework

Action Controller: Exception caught - turbolinks issue?
As I see, you dont have 'turbolinks' in your gemfile... just add it! Add gem 'turbolinks' to your Gemfile. Run bundle install. Add //= require turbolinks to your Javascript manifest file (usually found at app/assets /javascripts/application.js). Restart your server and you're now using turbolinks!

Categories : Ruby On Rails

Design issue - sort array in controller or view?
The sorting can be done in the SQL Query itself (if the sorting is not complicated) and then you can just pass the data to the view through the controller. However, if you have a big set of rules that cannot be all achieved in the SQL statement, I would simply just do it in the controller. You can always create a stored procedure and just call that, it really is a preference in my opinion. Just for sake of MVC pattern I like to put it in the controller, since the controller is meant for this kind of thing.

Categories : Java

How to pass multiple model objects from controller and how to pass all as command objects into the form:form in spring mvc?
Just add both person and address into an enveloping object called personDetails and pass that to the form. class PersonDetails { private Person person; private Address address; ... } PersonDetails personDetails = new PersonDetails(); personDetails.setPerson(new Person()); personDetails.setAddress(new Address()); model.addAttribute(“personDetails”, personDetails); <form:form action=”registration” command=”personDetails”> Once you do that, you'll have to modify the paths appropriately. <form:input path="firstName" /> becomes <form:input path="person.firstName" /> Other more elegant option is to enclose Address within the Person and just expose the Person as a command. Just as @Seabook mentioned in his answer below.

Categories : Java

Cakephp submit form from outside of controller
The blackhole is from the Security Component. To answer your question, read the "Disabling Security Component for Specific Actions" section. Or (I'm not sure), you might be able to submit from another site if you disable CSRF protection (worth a try)

Categories : PHP

Laravel: how do I pass a value from a form to a controller?
Add {{ Form::hidden('id', $client->id) }}to the form. Then, when it's posted, you can fetch its value per usual with Input::get('id'). Also, remove the postUserRate method's argument.

Categories : PHP

form action from phtml to controller
See below your it is very help full to you. Custom Module with Custom Database Table http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/custom_module_with_custom_database_table you can take help from above link and make your own front end custom form and module

Categories : Magento

symfony 2- fill up the form in controller
There is better place than controller to set (even override) your form fields - event listener. You should write listener for prePersist doctrine event and set/update field. Please look at example from docs: http://symfony.com/doc/current/cookbook/doctrine/event_listeners_subscribers.html#configuring-the-listener-subscriber

Categories : Symfony2

AngularJS: Error: No controller: form
You're compiling the <gtux-textfield> element without it being under the form in the DOM as you haven't appended it yet. Try: var $cr = $('<gtux-textfield></gtux-textfield>').appendTo($element); $compile($cr)($scope); In your gtuxEl link function. Demo: Fiddle

Categories : Angularjs

how can i pass form dropdown value in my controller?
yes you can save it. As per above form this will post to you controller action in view public function view() { // Has any form data been POSTed? if ($this->request->is('post')) { // If the form data can be validated and saved... if ($this->Job->save($this->request->data)) { // Set a session flash message and redirect. $this->Session->setFlash('JobSaved!'); $this->redirect('/jobs'); } } // If no form data, find the recipe to be edited // and hand it to the view. $this->set('jobs', $this->Job->findAll()); } below is just sudo code you can change as per you need and for more understanding you can visit cakephp.org

Categories : PHP

Segue to same view controller issue when going back down the navigation stack
@property (nonatomic,strong) NSMutableArray *selectedItemList; I needed to add a second property called selectedItemList. @interface MenuViewController : UITableViewController <JSONURLConnectionDelegate> @property (nonatomic,strong) JSONURLConnection *jsonConnection; @property (nonatomic,strong) NSURL *jsonURL; @property (nonatomic,strong) DataBase *db; @property (nonatomic,strong) NSString *sel_category; @property int categoryCount; @property (nonatomic,strong) NSMutableArray *itemList; @property (nonatomic,strong) NSMutableArray *selectedItemList; @end The selectedItemList is created when a cell is selected instead of changing the current itemList property. NSString *sql = [[NSString alloc]initWithFormat:@"WHERE parent_category_id = %@ ORDER BY name ASC", _sel_

Categories : IOS

Anoying simple issue, Sending data to other view controller
The controller that you get with the container view is a child view controller, so you can reference it from the parent (the controller whose view has the container view in it) with self.childViewControllers[0]. In your case, it looks like ViewControllerCalendar is the parent and CalendarMonthViewController is the child, in which you have the dateSelected property. If the modal segue to ViewControllerInsert is from the + button, then you should be able to pass the date to that controller in prepareForSegue:sender: like this (this code would be in your container controller, ViewControllerCalendar): - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if([segue.identifier isEqualToString:@"Insert"]) { ViewControllerInsert *dest = segue.destinationViewController

Categories : IOS

Background wont display on view controller. Stupid issue?
Do a bit of research on float number equivalence. The changes of the height being exactly equal to 960 or 1136 is slim (though they could be). You should check for >= or <= instead. The chances of matching 960 pr 1136 is especially slim as they are the @2x sizes. The true size of the frame will be 480 or 568. So, try something like if (height > 481) and a simple else.

Categories : IOS

Rendering data issue in JQuery Datatable with Spring MVC controller
aaData is the array of object that you pass. aoColumns define which column should receive the data. mDataProp indicate the way data would be treated (if you give a string to it, it will treat data as String) You have much more information on : http://datatables.net/ref#

Categories : Jquery

SelectBox with form controller and remote model
Virtual select box does not help you much because it's only virtual when it comes to rendering. So the data binding and the race conditions should be the same no matter which select box you choose. I don't get the root of your problem so I can't give you a precise advice how to handle your race condition. Is it possible to load / set the models sequentially to break the race condition?

Categories : Misc

How to pass Model and some form data to controller?
There are so many things wrong with your code that I don't know where to begin with. You don't post your Model back to the Controller using an ActionLink. You should use a submit button in your form to submit it to the server (Controller). Use Html Helpers instead of HTML tags. Your ViewModel should be under ViewModels folder and namespace, not under Controllers. And, if you want to submit additional data along with your Model, you should add them as properties to your View Model. Here is what your View should look like: @model BitcoinRedeemPage.ViewModels.BitcoinTransactionViewModel @using(Html.BeginForm("Send", "DepositDetails")) { @Html.TextBoxFor(model => model.WallterAddress) <input type="submit" name="submit" value="Submit" /> } And, in your Controller you'l

Categories : Asp Net Mvc

Rails Nested Form Object in other controller
I assume that you made a misstake with @lessons variable. Your are passing, model relation to url helper, instead of model. For solve it try: #controller @lesson = Lesson.find(params[:lesson_id]) #view ... <%= form_for Note.new, :url => new_lesson_note_path(@lesson) do |f| %> ...

Categories : Ruby On Rails

Zend Controller configuration to use new Search form
The default Zend Framework directory structure must look like: application controllers SearchController.php views scripts search index.phtml So instead of search.php you should name the controller SearchController.php. The index.phtml view script get called if you call the index action from the controller. (http://www.yourdomain.com/search/index or only http://www.yourdomain.com/search) The search controller should look like: class SearchController extends Zend_Controller_Action { public function indexAction() { } } If you work with Zend Framework you can take Zend_Form for forms. Quickstart Zend_Form Also please don't use mysql_* functions. With ZF there is Zend_Db. ZF is not easy (especially ZF2). But it will pay off if you take some time to learn it. I re

Categories : PHP

Post a List of Objects to Controller Without a Form
You need to specify a Prefix in your Action like this: [HttpPost] public ActionResult TestMethod([Bind(Prefix = "testList")] List<TestViewModel> testList) { // irrelevant code here }

Categories : C#

Laravel 4: pointing a form to a controller function
You can do it like {{ Form::open( array('url' => URL::to('user/search')) ) }} Because you don't have a name for the route. To define a name for the route, use following syntax, Route::post('user/search', array( 'as' => 'userSearch', 'uses' => 'UserController@search' )); So, you can use the route by it's name, as {{ Form::open( array('route' => 'userSearch') ) }} // 'search' method will be invoked Also, you can directly use the action of a controller as {{ Form::open( array('action' => 'UserController@search') ) }} Check Routing and Form.

Categories : Laravel

Passing an Extra Variable From A Form to a Controller
There's the option of using nested resources. i.e. put it in the URI. # routes.rb resources :posts do resources :comments end This will create a few routes, namely /posts/:post_id/comments(.:format) A form could look like: form_for Comment.new, url: post_comments_path(post_id: @post), method: :post do |f| # ... Though, it will be your controller's responsibility to locate the Post from the params before saving your Comment. One final note: this approach is justified only because it's a reference to the parent resource. Appending any other loose variables to the URI is lazy.

Categories : Ruby On Rails

add path of controller in form->create in Cakephp
You're probably mixing up the arrays. Should all be in one big array (as the create() method only takes 2 arguments), like this: echo $this->Form->create('User', array( 'url' => array('controller' => 'users', 'action' => 'login'), 'id' => 'form-login', 'inputDefaults' => array('label' => false, 'div' => false) ));

Categories : Cakephp

UItabBar from second view controller but all viewController have UInavigation with back to firstViewController issue
Add this code at your AppDelegate.m - (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController { self.tabBarController.selectedViewController=viewController; return YES; }

Categories : Objective C



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.