w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
How can I get a custom UIControl to participate in a segue as a push action?
I don't think so. Looking at the Connections Inspector pane, UIButton and UIBarButtonItem instances get special treatment—an extra "triggered segues" action you can connect to adjacent view controllers: While changing your view's class to a descendent of UIControl makes the standard suite of control events available, unfortunately Interface Builder does not let you hook up a segue. The best you can do is create a manually-triggered segue from your view controller to another, then connect your custom control to an IBAction method that performs the segue programmatically: - (IBAction)performManualSegue:(XYZCustomControl *)sender { [self performSegueWithIdentifier:@"manualPushSegue" sender:sender]; }

Categories : Iphone

Adding action and target to a custom Navigation BarButtonItem?
Add an action and target to a UIButton like this: [myButton addTarget:self action:@selector(handleMyButtonTap) forControlEvents:UIControlEventTouchUpInside]; Add an action and target to a UIBarButtonItem like this: [myBarButtonItem setAction:@selector(handleBarButtonTap)]; [myBarButtonItem setTarget:aTarget];

Categories : IOS

Custom UIControl and Gesture Recognizer
You can configure the gesture recognizer to not cancel touches in the view it's attached using the "cancels touches in view" property: myGestureRecognizer.cancelsTouchesInView = NO;

Categories : IOS

UIControl with A Custom inputView in an Alert Level Window
As so often happens, I figured it out shortly after posting... As the mach_msg_trap instruction hints, this was a threading issue, unrelated to the implementation of the date picker control. I fixed some NSLock objects elsewhere, which seems to have resolved the issue.

Categories : IOS

Defining different validations based on the action method which is called in a Struts2 action
In the action configuration via annotation you should use a parameter validateAnnotatedMethodOnly for validation interceptor, like in this example @Action(value="actionclassname", results = { @Result(name="input", location = "/actionclassname.jsp") },interceptorRefs = @InterceptorRef(value="defaultStack", params = {"validation.validateAnnotatedMethodOnly", "true"}))

Categories : Java

Using 'get' in an action for Grails controllers causes action to execute even when not called
GRAILS-9310 suggests that this is a known limitation which won't be changed, the workaround is not to name your actions get*. The root cause is If no explicit model is returned the controller's properties will be used as the model (Grails docs) When you define a getTest() method this means that the controller has a test property, and when you render the "home" view without an explicit model the controllers properties get enumerated to form the model map. The getTest() method will be called as part of this enumeration process. If you really need getTest to appear in the URL then you'll have to name the actual action something else and then define a custom URL mapping to direct the /controller/getTest URI to the renamed action.

Categories : Grails

Allow default action for target event and prevent default action for parent
Try changing $(e) to e. e.preventDefault(); When doing $(e).preventDefault() causes error Uncaught TypeError: Object [object Object] has no method 'preventDefault'

Categories : Javascript

UIBarButtonItem target/action not working
I suspect your date picker (which is as wide as the toolbar is) is somehow inhibiting your buttons from getting user touches. Try reversing these two lines to this: [self addSubview:self.datePicker]; [self addSubview:self.toolbar];

Categories : Objective C

tap gesture recognizer won't target-action
Both of the following must be true: You must ensure that you've specified the subclass in Interface Builder (e.g. if putting this method in your view controller, make sure you have the view controller's subclass specified for your scene in Interface Builder); If linking the action to an existing, the method must be in the implementation of the class for your must have a "return type" of IBAction (it behaves like a void, but you must specify IBAction or else IB won't let you link up the action), e.g.: - (IBAction)handleTap:(UITapGestureRecognizer *)gesture { // do whatever I want to handle the tap here } If a method has void or some other return type specified, Interface Builder will not let you to establish the connection. Personally, I develop the UI elements in Interface Bui

Categories : Objective C

Ajax update target id, but not action link
You could use the $.ajax() function: $.ajax({ url: '/SomeController/UpdateGridView', type: 'GET', success: function(result) { $('#configs').html(result); } }); or the $.get() equivalent: $.get('/SomeController/UpdateGridView', function(result) { $('#configs').html(result); }); or the even shorter equivalent using the load(): $('#configs').load('/SomeController/UpdateGridView'); Those 3 jQuery snippets all do the same: they send an AJAX request to /SomeController/UpdateGridView and update the DOM element with id="configs" with the returned partial result from this AJAX call.

Categories : C#

Ember.js: when using {{action}}, how to target a specific controller?
As far as I know the view class does not change the current controller. Since you are calling the view from the Application template, it remains in the ApplicationController. Emberjs.com guides on render: {{render}} does several things: When no model is provided it gets the singleton instance of the corresponding controller Simply changing your code from a view to a render call seems to do the trick: Trigger ApplicationController </p> {{render 'child'}}

Categories : Ember Js

UISegmentedControl not changing background image when using target-action
try this code: - (void)segmentToggled:(UISegmentedControl*)sender { for (int i=0; i<[sender.subviews count]; i++) { if ([[sender.subviews objectAtIndex:i] respondsToSelector:@selector(isSelected)] && [[sender.subviews objectAtIndex:i]isSelected]) { [sender setBackgroundImage:[UIImage imageNamed:@"standard_bt_h.png"] forState:UIControlStateSelected barMetrics:UIBarMetricsDefault]; } if ([[sender.subviews objectAtIndex:i] respondsToSelector:@selector(isSelected)] && ![[sender.subviews objectAtIndex:i] isSelected]) { [sender setBackgroundImage:[UIImage imageNamed:@"standard_bt.png"] forSta

Categories : IOS

my action is called twice
I used fiddler and found that It's happening because of Web Server Notifier and Web Technology Notifier extensions of chrome and they send another requests to the action.

Categories : C#

MVC action called twice (only in chrome)
I have tried your code in my mvc application.It is working perfectly.My chrome version is 45.0.2454.7 dev-m .Please download latest version of chrome i think it should be work for you

Categories : Asp Net Mvc

Want to know Partial view called by which action
You can create a property to specify the Mode in the Model that you pass to that View. public bool IsEditMode {get;set;} So in the Controller you set this property on the Model depending on the mode, so it's available in the View.

Categories : C#

Action class called twice from IE and not firefox
It could be that IE is preloading prefetching the link. To verify this, log the time when the request is received. Load the page, wait ~10 seconds, and click the link. If the difference between the log entries is ~10 seconds, it's a prefetch. The idea is the browser preloads links the user is likely to click, so the result can be server immediately form the browser cache. HTML5 makes this explicit by defining rel="prefetch". This attribute and value can be set on a, area, and link tags. Check your page for <link rel="prefetch" href="url" /> or <link rel="next" href="url" /> in the HEAD element. Also, check your A tags for rel attributed as well. MicroSoft claims to officially support this in IE 11. All of this is intended to make pages appear more responsive to the user.

Categories : Java

WebApi Action filter called twice
I have a suspicion, that this strange behavior can be fixed by either overriding AllowMultiple property of filter and returning false, or applying AttributeUsage attribute with AllowMultiple set to false too (this influences on default implementation of AllowMultiple property of filter. At least in our project this helped (we have filters injected via Autofac).

Categories : Asp Net Mvc

How to Check if an Argument Was Called Without an Action?
You can use the store_true action. This will set the value to True if the argument was specified, or False otherwise: parser = argparse.ArgumentParser() parser.add_argument('--foo', action='store_true') args = parser.parse_args() if args.foo: print('--foo was specified')

Categories : Python

JSF action not called OR selectbox value is null
If your page have any of the required fields kept as empty the submit from the popup panel will not work. In that case include the popup panel inside a form and domElementAttachment="form" , and perform the submit.

Categories : JSF

Primefaces remotecommand action called only once
@FacesConverter("user") public class UserConverter implements Converter{ private List<User> users; public UserConverter(){ this.users = myController.getAllUsers(); } public Object getAsObject(FacesContext context, UIComponent component, String value) { return this.getUser(value); } public String getAsString(FacesContext context, UIComponent component, Object value) { return String.valueOf(((User) value).getId()).toString(); } public User getUser(String id) { Iterator<User> iterator = this.users.iterator(); while(iterator.hasNext()) { User user = iterator.next(); if(user.getId() == Integer.valueOf(id)) { return user; } } return null;

Categories : JSF

MVC / jQuery - Action not being hit when called via $.ajax()?
Try this: var data={}; $.getJSON("@Url.Action("GetMapMarkers")", data, function(result) { }); Your controller should look like: public JsonResult GetMapMarkers() { return Json(result, JsonRequestBehavior.AllowGet); }

Categories : Jquery

C# MVC, controller action not being called on view render
I think it's likely that your problem is due to using @RenderPage instead of @Html.Action. Using @Html.Action means your view will go via the controller, and therefore get the necessary model when doing so. @RenderPage is simply including the view in the response. I encourage you to read this SO entry for the differences: Html.Partial vs Html.RenderPartial & Html.Action vs Html.RenderAction What you'll (probably) end up with is something like this... <div class="span2 offset1"> <div class="span12"> @Html.Action("PlayerDisplayStats") </div> <div class="span2"> @Html.Action("GameNavigator") </div> </div> <div class="span8"> @Html.Action("MainWindow") </div> You will need to alter your controller to r

Categories : C#

cakephp isAuthorized being called on every action call
Technically speaking, HTTP is stateless and each request does not have any affinity to any other request from the same user. State-fullness is created by using sessions. You could store the ACL check result in a session variable. But you would need some way to reset it if the users access were to change while logged in.

Categories : PHP

Action Method does't Called on Jquery Dialog oad
can you refactor your code to this.. im not sure wether this will help but i dont like calling .appendTo and .load on the same line. function createNewSetClick() { debugger; var $div = $("<div></div>"); $('body').append($div); $div.load("/ClaimAuditAdmin/OpenCreateNewSetDialog"); $div.dialog({ modal: true, title: STATICPOPUPTITLE }) } if still the action method isnt being called check whther the url is correct and mention the error you you are getting when sending the request

Categories : Jquery

Devise - 'create' action of overridden SessionsController not being called
Found it. I had a before_filter in my application_controller.rb which raised a CanCan::AccessDenied error by mistake. Why did this cause to execute the method from the "original" devise controller??? No idea... I fixed the error in the filter and everything seems to be ok, my overriden action is executed.

Categories : Ruby On Rails

Primefaces command button action is not called for the second time
In case anyone faces the same issue. I noticed that the Primefaces showcase is using JSF-Mojarra-2.1.22. I downgraded my JSF-Mojarra version from 2.2 to 2.1.22 and it worked like a charm. If I am not wrong, I guess it should be reported to primefaces (if it isn't a current issue).

Categories : Ajax

Trying to use simple authentication in Play Framework, but my action is called twice
Perhaps it's because you're using System.err to log, instead of the default logger in play? Regardless, for authentication, I'm using this module: https://github.com/joscha/play-authenticate

Categories : Java

VS Solution in custom cmake target sometimes hangs
It seems that you need to specify devenv.com instead of devenv.exe. See the output of the following commands: E:folder>devenv.exe "E:foldersolution.sln" /build Debug E:folder>devenv.com "E:foldersolution.sln" /build Debug Microsoft (R) Visual Studio Version 10.0.40219.1. Copyright (C) Microsoft Corp. All rights reserved. ========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ========== E:folder>

Categories : Visual Studio 2010

passing values to nlog custom target
You need to define your ApplicationUser with the type Layout then you can get the current user with "rendering the layout" using the ApplicationUser.Render(logevent): [Target("CustomTraceListener")] public sealed class MyFirstTarget : TargetWithLayout { public Layout ApplicationUser { get; set; } protected override void Write(LogEventInfo logEvent) { string logMessage = this.Layout.Render(logEvent); string applicationUser = ApplicationUser.Render(logEvent); // ... Write where you want } }

Categories : C#

Delphi XE custom build target is always disabled
Delphi generates the entire dproj content itself and this custom import will always be deleted. You could write your own msbuild xml files but the dproj belongs to Delphi. Unless you have source code or are willing to monkey patch the ide you cant do that. If you really want a flexible xml way to build delphi projects and create targets galore try want or want vnext (my fork on bitbucket)

Categories : Delphi

UIControl track touches outside its view
Put one view behind your menu that cover whole area of your device with background of clear color. when your menu is open make that view visible. as it has same height and width as your device whenever you click outside the menu you can identify that view using TapGesture or make it UIControl. than call method to hide both your menu and that uiview. Hope this will help.

Categories : Iphone

How can I detect interaction anywhere outside of a UIControl, non-invasively?
You can think of a UITapGestureRecognizer placed on top of everything that triggers the dismiss only when the touch happens outside of you UIControl bounds. Something like - (void)presentConfirm { // whatever self.dismissRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismiss:)]; self.dismissRecognizer = self; [self.view addGestureRecognizer:self.dismissRecognizer]; } - (void)dismiss:(UIGestureRecognizer *)gestureRecognizer { // do stuff [self.view removeGestureRecognizer:self.dismissRecognizer]; } - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { CGPoint touchPoint = [touch locationInView:self.view]; return !CGRectContainsPoint(self.control.frame, touch)); } Bas

Categories : IOS

How does the control state work in UIControl?
A control can have more than one states at a time eg. selected and highlighted can co-exist, and so on. So you can specify titles and images for combinations of states. Eg. UIButton * button; //initialization code NSString * title = @"Title"; [button setTitle:title forState:UIControlStateHighlighted | UIControlStateSelected]; title = [button titleForState:UIControlStateHighlighted | UIControlStateSelected]; The bitmasks are used so as to produce unique value for each and every combination of values - try them using bitwise OR and you will get it. It is not very much unlike currency notes of $1,$2,$5,$10 etc that are capable of paying any integer amount e.g. $1 and $2 bills can be used to pay $3, $4 and so on, so you only need definite number of bills.

Categories : IOS

Route pattern matches but desired action Method is not getting called - Orchard 1.7
Checklist: Give your route a higher priority - something greater than 0 (eg. 100) Check if the feature your controller (and implementation of IRouteProvider) is in is enabled And btw - avoid having whitespaces (encoded as %20) in paths. This can lead to lots of trouble. Better encode those as dashes etc.

Categories : Asp Net Mvc

Redirecting back to the correct location when action is called from multiple locations
The redirect_to :back is redirecting to the link contained in the HTTP header "HTTP_REFERER" (contained in the request variable which is a ActionDispatch::Request object). You could test what contains this referer and behave differently for some value(s): def update @object = MyObject.find(params[:id]) # etc... if request.env['HTTP_REFERER'].present? if request.env['HTTP_REFERER'].include?('/some/path/to/edit/') redirect_to object_path(@object) else redirect_to :back end else redirect_to root_path end

Categories : Ruby On Rails

How to target element on a Google Maps custom InfoBox?
You want to use addDomListener instead of addListener for click, and you'll need to bind it to the DOM Element: google.maps.event.addDomListener(this.div, 'click', function() { ... });

Categories : Javascript

target a custom page using plugin function in wordpress
You can use these hooks for page templates. http://adambrown.info/p/wp_hooks/hook/page_template Or may be something like this... add_filter( 'page_template', 'check_the_template' ); function check_the_template( $template ) { if( 'custom_page.php' == basename( $template ) ) { // do some things here by calling functions, hooks etc.. } return $template; } If you want to just echo "Hello World" : add_filter( 'page_template', 'check_the_template' ); function check_the_template( $template ) { if( 'pagetemplete.php' == basename( $template ) ) { add_action( 'the_content', 'echofunction' ); } return $template; } function echofunction() { echo "Hello World"; }

Categories : Wordpress

How to Deploy a Custom WebPartPage to a specific target site (Web)
using powershell, specify the web application in the command. Install-SPSolution -Identity <SolutionName> -WebApplication <URLname> take a look at this link & do a ctrl+F for "To deploy a solution package to a single Web application by using Windows PowerShell" http://technet.microsoft.com/en-us/library/cc262995(v=office.14).aspx

Categories : Sharepoint

How do I format the string of a uicontrol to not use scientific notation?
imple example of : f=figure; L=uicontrol('parent',f,'style','popupmenu','string',{'1','2','6000000'}); Isn't showing this behaviour. What code is generating these values? As popupmenu uses a cell array of strings to represent its value, it is likely that the code generating the GUI is using sprintf('%0.5g',value); Or something along those lines to input values to the popupmenu. If you change this to sprintf('%d',value); or sprintf('%.0f',value); for floating point values (although number of samples should be an integer, I imagine), it should have the behaviour you want. Edit: Addition to answer your extra info. To use sprintf to format as you wish using a numerical array, you can use this syntax for arbitrary array X: arrayfun(@(x) {sprintf('%d',x)},X); So in your popu

Categories : Matlab

Custom PhaseListener called twice in jsf 2
It's because you've registered your phase listener twice in the JSF application. The "why" for that is in turn not constuctively answerable. If you're bothered about the same phase listener being registered twice, just remove the second registration.

Categories : JSF



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