w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
ExtJs - Triggering Column Header Sorting programmatically (e.g. with QTP)
The simplest way would be to tell QTP to generate mouse events, this way all the events that are fired when a real human clicks the header will be fired when QTP clicks it. As seen here origReplayType = Setting.WebPackage("ReplayType") Setting.WebPackage("ReplayType") = 2 Browser("B").Page("P").WebElement("column header").Click ' your script line here Setting.WebPackage("ReplayType") = origReplayType If this is a common occurrence you can use RegisterUserFunc to define a new DeviceClick function to your test objects. A slightly more complex way is to debug the application and see which event triggers sorting the column and then use FireEvent with the correct event.

Categories : Sorting

How can I programmatically set selected tab of UITabBarController while also triggering shouldSelectViewController in UITabBarControllerDelegate
If you have implemented - (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController in your tabBarController's delegate than you can call it manually. [self.tabBarController.delegate tabBarController:self.tabBarController shouldSelectViewController:[[tabBar viewControllers] objectAtIndex:2]]; [self.tabBarController setSelectedIndex:2]; Hope this helps.

Categories : IOS

Need js method of triggering button
jQuery Mobile or TouchSwipe have swipe events which you could use to call the same function the button is calling.

Categories : Javascript

Back button not triggering the method within the "beforeunload" in Chrome
I am not sure why this happens but, personally, I wouldn't rely on this. What if the users' computer crashes? A browser will not fire that event - it won't have the chance to. Best bet would be to call a page via ajax or something similar, every 5 seconds or so, and that page updates a date related to the user. You then show users where the date is within the last minute, or whatever you decide, in the list of currently active users. If their computer crashes, the date will no longer be updated. Regards, Clarkey

Categories : Google Chrome

jQuery - triggering show(),hide() on button click
($this) is wrong without assigning, instead use this.id You can use indeed like var id = this.id; switch (id) And remove # in your cases and make like below switch (this.id) { case 'dateMenu': //removed # $('.date-chart').show(); $('.jc-chart').hide(); $('.jp-chart').hide(); $('.ws-chart').hide(); break; case 'jcMenu': //removed # $('.date-chart').hide(); $('.jc-chart').show(); $('.jp-chart').hide(); $('.ws-chart').hide(); break; case 'jpMenu': //removed # $('.date-chart').hide(); $('.jc-chart').hide(); $('.jp-chart').show(); $('.ws-chart').hide(); break; case 'wsMenu'

Categories : Jquery

How to disable the enter button from triggering the onkeyup event?
Hope this helps. <script type="text/javascript"> function stopRKey(evt) { var evt = (evt) ? evt : ((event) ? event : null); var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if ((evt.keyCode == 13) && (node.type=="text")) {return false;} } document.onkeypress = stopRKey; </script>

Categories : Javascript

ASP.NET button inside bootstrap modal not triggering click event
You can use the ASP Button like in your example <div class="modal-footer"> <button data-dismiss="modal" class="btn btn-large"> Close</button> <asp:Button runat="server" ID="btnSaveImage" Text="Save Image" CssClass="Greengradiant btn- large" OnClick="btnSaveImage_Click" /> </div> just try the UseSubmitBehavior="false" like said skhurams and combine it with the data-dismiss="modal" <div class="modal-footer"> <button data-dismiss="modal" class="btn btn-large"> Close</button> <asp:Button runat="server" ID="btnSaveImage" Text="Save Image" CssClass="Greengradiant btn- large" OnClick="btnSaveImage_Click" UseSubmitBehavior="false" data-dismiss="modal" /> </div> this will close the modal and trigger the postback

Categories : C#

IE issue - jQuery .change() is not triggering callback when using checkbox/radio button?
Use the click binding rather then the change binding.. change is not registered until the element loses focus. (in IE) $(element).click(function(){ //do something });

Categories : Javascript

Triggering a UIButton's method when user drags finger into button's area?
Make you method such as -(IBAction)btnTap and connect to these properties When the user taps the button. - Use Touch Down method for this When the user presses the button and drags his/her finger out of the button's area - Use Touch Up Inside for this purpose When the user drags his/her finger from outside the button's area to inside the button's - Touch Drag Inside

Categories : IOS

jQuery UI input inside button - how to prevent triggering click event?
You can make it work in two steps: Use the same name in the inputs as in the selectors. You have both inputs name="size_y", but you are using selectors $('input[name="y_size"]') and $('input[name="x_size"]'). See the difference? Add the click-event on the button before the inputs: $('.btn_size').button({icons: { primary: "ui-icon-arrow-4-diag" }}).click(function(){ console.log('clicked'); }); $('input[name="size_x"]').click(function(e){ console.log('x'); e.stopPropagation(); }); $('input[name="size_y"]').click(function(e){ console.log('y'); e.stopPropagation(); }); See fiddle. And if that doesn't work, you could try changing <button> to <div> and use .button() to style it.

Categories : Jquery

Button in my Google Maps application is accidentally triggering my save form
You shouldn't be using a submit button for your google maps function. Because the button is sitting within a <form> it's trigger the call to the server. Strip off type="submit". It's also looks like you're trying to do two forms, the first for submission to the server, the second for google maps function. If that's the case, I'd move the </form> tag above the <!-- End of map route page --> comment.

Categories : Ruby On Rails

Triggering segue causes view to change only after i press home button and click on app again ios storyboard
It might be because the UI in iOS is only updated on the main thread. It's possible that the function you are calling the segue in is somehow blocking the main runloop. See NSTextField waits until the end of a loop to update for more information.

Categories : IOS

how to call the server serving the page with a URL which references a python object function like "csvExport" and triggering it with a button
The solution is to use the window.location.host DOM indirection to get the server reference and it has to be preceded by 'HTTP://' The two will produce a URL like HTTP://soandso.com:8050 with a port number to identify the running site. That site can now be supplemented with an object function like csvExport to get a final and full URL reference to the call you are trying to make. e.g. 'HTTP://soandso.com:8050/csvExport' and that is sufficient to refer to any server running this site. Here is a practical way of planting this event into a button with jQuery: dLoadCall = window.location.host+"/csvExport"; dLoadCall2 = "window.open('http://"+dLoadCall+"')"; $("#dload").attr("onClick",dLoadCall2); The HTML button might look like this before the event insertion: &l

Categories : Python

Resizing a button in iOS programmatically
You are probably using autolayout: When using autolayout you cannot manually change your outlets frames. You have two options: you can either disable autolayout (then your code should work), or create outlets to your constraints and then modify the constrains programmatically: @property (weak, nonatomic) IBOutlet NSLayoutConstraint *widthConstraint; and then in your code: self.widthConstraint.constant = 123; and so on with all the constraints that need to be modified.

Categories : IOS

Programmatically Disable Button
Use .prop() .prop("disabled", true); Also, enable jQuery on the left side of the fiddle. Update: http://jsfiddle.net/tymeJV/zMKg5/1/

Categories : Jquery

Google+ SDK for iOS Add Signin button programmatically
First of all you should call the sign in method on a action of your googlePlusSignInButton So the code should be: -(void) setGooglePlusButtons { self.googlePlusSignInButton = [[UIButton buttonWithType:UIButtonTypeCustom] retain]; UIImage *backgroundButtonImage = [UIImage imageNamed:@"bt_search_cancel.png"]; googlePlusSignInButton_.frame = CGRectMake(0.0f, 0.0f, backgroundButtonImage.size.width, backgroundButtonImage.size.height); googlePlusSignInButton_.titleLabel.textColor = [UIColor whiteColor]; googlePlusSignInButton_.titleLabel.font = [UIFont boldSystemFontOfSize:11.0f]; googlePlusSignInButton_.titleLabel.numberOfLin

Categories : IOS

How to programmatically add a button to remove a WebView?
remove these two lines from your code and check it, UINavigationBar *myBar = [[UINavigationBar alloc]initWithFrame:CGRectMake(0, 0, 320, 50)]; [self.view addSubview:myBar]; or you can add like this, UINavigationBar *myBar = [[UINavigationBar alloc]initWithFrame:CGRectMake(0, 0, 320, 50)]; [self.view addSubview:myBar]; UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"remove" style:UIBarButtonItemStyleDone target:self action:@selector(remove:)]; UINavigationItem *item = [[UINavigationItem alloc]initWithTitle:@"remove"]; [item setLeftBarButtonItem:backButton]; [myBar setItems:[NSArray arrayWith

Categories : Iphone

How to modify a Done button programmatically from UIActionSheet?
Replace: UIBarButtonItem *doneBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(dismissActionSheet:)]; with: UIBarButtonItem *doneBtn = [[UIBarButtonItem alloc] initWithTitle:@"Ready" style: UIBarButtonItemStyleBordered target:self action:@selector(dismissActionSheet:)]; You may want to use UIBarButtonItemStyleDone for the style.

Categories : IOS

Programmatically created a button on iOS, but no action when pressed
1) You don't need to "resignFirstResponder" on a button (seems like most of the time I see "resignFirstResponder" is in text fields or text views). 2) Change the control event from UIControlEventTouchUpInside to UIControlEventTouchDown 3) The parent UIImageView might not have "userInteractionEnabled" set to true, which means events won't be propogated (or sent along) to subviews. To make those events available to subviews, change the parent view's userInteractionEnabled property via: backImageView.userInteractionEnabled = YES; before adding that subview.

Categories : IOS

Button methods do not work after adding it programmatically?
Your method signature should look like this: -(void)addButton:(NSString *)name :(NSString *)buttonId :(UIButton **)outButton { or, better, - (UIButton *)addButtonWithTitle:(NSString *)title index:(NSInteger)buttonID { In the former case, the implementation would be something like … UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; *outButton = button; In the latter, int height = buttonID * 45; UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; … return button; where you’d then initially call it with, say, button1 = [self addButtonWithTitle:@"Button one!" index:1];

Categories : Objective C

Add radio button list items programmatically in asp.net
You don't need to to do a FindCOntrol. As you used the runat="server" attributes, just get the reference of your RadioList via its name "radio1" protected void Page_Load(object sender, EventArgs e) { radio1.Items.Add(new ListItem("Apple", "1")); }

Categories : C#

Setting button flat style programmatically
This is a workaround that works. Add a style based on ToolBar.ButtonStyleKey to Window.Resources as follows: <Window.Resources> <Style x:Key="MyStyle" BasedOn="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" TargetType="Button" /> </Window.Resources> Then, in code, refer to it as per first link in this question: button.Style = this.Resources["MyStyle"] as Style; I'd prefer to have a code-only solution (no XAML) for this, but this works just as well.

Categories : C#

How to trigger radio button's event handler programmatically?
You can call the event handlers like any other method: public Form1() { InitializeComponent(); calculator = new Calculator(); maleRadio_CheckedChanged(maleRadio, null); englishRadio_CheckedChanged(englishRadio, null); }

Categories : C#

Android - set button width programmatically inside a tablerow
Try This: LayoutParams lp = new TableRow.LayoutParams(android.widget.TableRow.LayoutParams.WRAP_CONTENT,android.widget.TableRow.LayoutParams.MATCH_PARENT); btn.setLayoutParams(lp); Try use Weight in button. Give table row weightsum=10. and divide it to buttons as per your req. like btn1.weight=3; btn2.weight=5;btn3.weight=2; this is like using % in HTML. if you set weightsum = 10 that means it will use 100% of its parent view. and using weight=3 for button means it will use 3/10 of total row size. it is just for width so you need to set width =0 for every view where you are assigning weight. for weight use like this: LayoutParams lp = new TableRow.LayoutParams(0,android.widget.TableRow.LayoutParams.MATCH_PARENT,3f); where 3f is weight. but first setweight sum to 10 in tablerow. Hop

Categories : Android

Issue with adding a StateListDrawable with LayerDrawable to a Button programmatically
I finally found some time to come back to this issue. After trying a lot of different possibilities I got it working through adding the same drawable individually (!) for each state (when the button is pressed and when it is disabled). The other states are covered through a drawable added with a wild card for the other states. public MyStateListDrawable(Context c) { addState(new int[] {android.R.attr.state_pressed}, getStateDrawable(c, true)); addState(new int[] {-android.R.attr.state_enabled}, getStateDrawable(c, true)); addState(StateSet.WILD_CARD, getStateDrawable(c, false)); } ....

Categories : Android

Android -Programmatically Manipulate Button Position below ListView
To keep the image from stretching, you can create a LinearLayout and place the button inside it. By setting the gravity attribute, you can position the button in the center, left or right of the ListView footer. After adding the button to the LinearLayout, the LinearLayout can be added to ListView footer. See if the following code gets you the layout you want: @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.load_main_groups_activty, container, false); // Getting listview from xml ListView lv = (ListView) rootView.findViewById(android.R.id.list); // Creating a button - Load More Button btnLoadMore = new Button(mContext);

Categories : Java

programmatically adding custom button messing with eachother
After you declare deleteBtn you set the title as @"decline1" but call inviteToLocationBtn. [inviteToLocationBtn setTitle:@"decline1" forState:UIControlStateNormal] should refer to deleteBtn. this line above: UIButton *deleteBtn=[UIButton buttonWithType:UIButtonTypeCustom]; deleteBtn.frame=CGRectMake(130.0, 15.0, 80.0, 50.0); [inviteToLocationBtn setTitle:@"decline1" forState:UIControlStateNormal]; inviteToLocationBtn.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size: 22.0f]; inviteToLocationBtn.titleLabel.textColor = [UIColor whiteColor]; [deleteBtn addTarget:self action:@selector(callDeny) forControlEvents:UIControlEventTouchUpInside]; [self.bottomDrawer addSubview:deleteBtn]; should be: UIButton *deleteBtn=[UIButton buttonWithType:UIButtonTypeCustom]; deleteBtn.fr

Categories : IOS

Click button programmatically and show pressed animation
You can call the VisualStateManager.GoToState method before raising the event. VisualStateManager.GoToState(Button1, "Pressed", true); Button1.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent)); The problem with this is that animations run asynchronously so any lines of code after the event is raised will execute immediately. One way around it would be to get hold of the Storyboard that is called when GoToState is called. To do this, you can use GetVisualStateGroups var vsGroups = VisualStateManager.GetVisualStateGroups(VisualTreeHelper.GetChild(Button1, 0) as FrameworkElement); VisualStateGroup vsg = vsGroups[0] as VisualStateGroup; if (vsg!= null) { //1 may need to change based on the number of states you have //in this example, 1 represents the "Pressed" state var

Categories : C#

applying setLayoutParams on a button programmatically causes the whole layout to get mixed and abnormal
Use setVisibility(View.GONE); *Remove this * modifyButton.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); And set android:layout_width="0dp" in both button

Categories : Android

jquery mobile - programmatically change radio button color
Select the next <label> and then its <span> children: $('#cur2') .next('label') .children('span') .css('background-color', 'red'); Fiddle

Categories : Jquery

How to hide ExtJS.Toolbar button( inside buttongroup ) programmatically
Try with Ext.get, Once i got the same problem, i resolve by replacing Ext.getCmp with Ext.get Try btn= Ext.get('b4_id'); btn.setVisible(false); or btn.hide(); if you like to hide initially, then use config as below. hidden: true Thanks

Categories : Extjs

Add UISearchBar programmatically to a programmatically added UITableView in a normal ViewController
Is your object implementing the delegate methods in UISearchDisplayDelegate? In other words, you have to define what happens when text is entered in the search bar, it does not happen automatically for you.

Categories : Objective C

Toggle between big view and normal view for android notification programmatically by using notification action button
No, you have no control on that part. It is handled by the system and before Android 4.1 you wouldn't haven get the "big view". You are using notifications for something that they aren't supposed to be used. If the user chose to swipe away your notification he is not interested in the notification and you can't do anything about it. An user may also decide to stop your app for issuing notifications. You can't rely on the notification for things like this. If you explain exactly what your flow is I may be more helpful.

Categories : Android

$app->finish not triggering
See comments by Igor Wiedler: There may be a way to achieve it with two changes to the Response class. The first is adding ob_flush() before flush() in Response::send(). The second is setting the content-length header. I was able to achieve the same effect without modifying the Response class. First, you need to move the callback you set in finish middleware outside of the get method, and check manually the route ('GET_' in this case responds to '/' path): $app->finish(function() { if ('GET_' === $request->attributes->get('_route')) { long_process(); } }); Then here is how you get method should look like: $app->get('/', function(Request $request) use ($app) { $content = json_encode(array( 'status' => 'ok', )); $

Categories : Symfony2

OnLoadCompleteListener never triggering
Okay, finally solved it. Reason was that the AudioFlinger was failing to load with an error -12. Ended up having to swap to using a Media Player for the background music, since I have no idea how I ran out of memory.

Categories : Java

Triggering a URL on startup?
I had this problem, kept popping up when Chrome was first run even after changing the homepage. Try this, there's a separate section in the settings for your start up page. I'd missed it about half a dozen times until I found this help page. https://support.google.com/chrome/answer/95421?hl=en-GB

Categories : Javascript

IsMouseOver not triggering
The reason is that, you set the Trigger's Property to Canvas.IsMouseOver, so it will fire when the Canvas is Mouser Over. But as you set the Trigger in the Path's Style, this will limited within the area of the Path. I know the IsMouseOver is a Property, but i want to use MouseEnter as an example. MouseEnter is a Routed Event, so when the mouse is hover the TextBlock, it will fire as Routed Event, the TextBlock's MouseEnter Event will fire, and maybe the TextBlock's IsMouseOver became true, not the Path and the Canvas. Because now the TextBlock's ZIndex is the highest. So, what we need to do is let the TextBlock's IsMouseOver don't change when it get hovered. We can set the TextBlock's IsHitTestVisible="False"; And the Code can be like this: I have tested this code, it works! <Can

Categories : Wpf

After triggering how to get a 5 sec delay
You can use setTimeout, to put delay. $('.history .enter').trigger('click'); if( peCount != 7) { $('.btn_physical').trigger('click'); setTimeout(function(){ $('.black_bg').fadeIn(300); }, 5000); }

Categories : Jquery

Alarm not triggering
The time will only be in the future if you run this in the first 5 seconds of a minute. You should use calendar.add(field, value); to add to the time. If you're in a time zone except GMT, that might also be throwing Calendar off. To set an alarm for 5 seconds time, it easiest to do it like this: alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + (5 * 1000), pendingIntent);

Categories : Android

Click triggering anywhere on page
Wrong JQuery :Change your code and try $(document).on('click', '.ac', ab ){ // do some thing }; As @Adeno mentioned in existing comment on() does not accept a jQuery object as it's second argument, only strings should be used for the selector.

Categories : Javascript



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