Show ExpansionComponent programmatically - smartgwt

Is it possible to trigger the "show ExpansionComponent event" programmatically?
I have already defined grid.setCanExpandRecords(true) and it works as expected but I was wondering myself if the expansion of a certain record can be initiated through any other way then hitting the icon.

I think this should work:
targetListGrid.expandRecord(targetListGrid.getSelectedRecord());

Related

Shortcut for adding UIView in Xcode

Is there anybody who knows how to create shortcut for adding UIView to Storyboard?
Or is it possible to create user's shortcuts for custom actions in Xcode? Or maybe it's already exists.
You can use this shortcut ⇧+option+⌘+L to open the Library fast and you can drag it from there
You can also use bettertouchtool to add an action when doing a specific shortcut or tapping a button on the touchbar to do this:
⇧+option+⌘+L and typing then UIView
For me works with ⌘+⇧+L.
option is not necessary.
You can add shortcuts using Xcode > Preferences > Key Bindings. Search for the command-name using the field at the top-right, then double click in the key field and type the key you want to use.
But other than predefined commands not sure if you can add custom ones.

XCUITest: Failed to find Matching Element

I have a close button on a ViewController that is being presented as a ChildViewController. I have this button's accessibility turned on and the accessibility identifier is closeButton. This button does not have any text, it just has an image.
I am attempting to test the presentation and dismissal of this view, but am running into an issue, the XCUITest cannot find the element. My test code is:
app.buttons["PresentChild"].tap()
XCTAssertTrue(app.otherElements["ChildViewController"].exists)
XCTAssertTrue(app.buttons["closeButton"].exists)
The first assert passes, but the second assert fails.
I tried to do the "Record UI Test" to select the button to have it be automatically generated, but then I just get an error saying Failed to find Matching Element. I tried erasing all the content on the simulator and deleting all derived data, and that didn't work either.
Does anyone know a workaround to this obvious bug in Xcode? I can't access the element through the recording, I can't access the element through the accessibility feature, I have zero idea how else to access this button.
I don't know what is the exact problem with your assertion. But this steps may help you.
Put a breakpoint on this line XCTAssertTrue(app.otherElements["ChildViewController"].exists)
Now run the test case. When the control reaches this line, type this line in the debugger po XCUIApplication().buttons.debugDescription then tap the enter button
It will print all buttons in your current view. Now check whether the "closeButton" exists in that list
If it exists, check the identifier name. Make sure that it is "closeButton" (Identifier is case sensitive, also spaces in the identifiers matters)
If the identifier is right, try to find out the closeButton's exact view hierarchy. Means, instead of just checking like app.buttons["closeButton"].exists, try like app.navigationBars.otherElements["someName"].buttons["closeButton"].exists
(This seems funny, but giving the exact location path of the element is a good practice, and it will work sometimes)
Note: This error "Failed to find Matching Element" on UI recording will happen if the system can not locate the element with proper identifier while doing action on it. So my guess is, your closeButton does not have proper identifier or it is not added to the current window.
Cheers!!

Release Event Handler?

Maybe I'm just over thinking this, but is there a way to capture when the user let's go of a button with iOS? So to pose my question better: I have a button on the screen, and when the user let's go of it, I want to call an event. Is there a way to do that?
Try to answer, I wonder the same idea too..
From Apple Document : UIControl Class
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIControl_Class/Reference/Reference.html
My Idea sub-class UI Control using following Task :
– beginTrackingWithTouch:withEvent:
– continueTrackingWithTouch:withEvent:
– endTrackingWithTouch:withEvent:
– cancelTrackingWithEvent:
Put a BOOL isBegin = YES at beginTrackingWithTouch to know that it was touched..
Then when endTrackingWithTouch happen (which is the user end touching the control), do what you going to do in there then set isBegin back to NO
regards,
FHW

Is there a way to programmatically configure the notification display setting for an ios app?

I tested it on two iphones : on the first the setting was set to 'none' and on the second it was set to 'banner' (seems weird). I would like to know if there's a way to explicitly code that in the app? Thanks :)
Now I know there's no way to do that.

Would it be OK to add a custom button on a system keyboard in iPad

I have a requirement wherein I have to change the text of the return key of the iPad to Sign-in. Obviously it is not one of the options available in the sdk. I have searched it over the net and it seems doing that possible.
The only question remaining is whether the app would be accepted by Apple if I modify the default system keyboard? The HIG is not clear on this , it states that "A custom input view can replace the system-provided onscreen keyboard in apps" and "You can also provide a custom input accessory view, which is a separate view that appears above the keyboard (or your custom input view)". Nothing about whether we are allowed to add an extra button on a system keyboard.
Any experiences??
#Vin you can change the name of return key of the keyboard to your requirement. I have an app that has the changed to return key name to Done and Search. And apple did not reject it.
To "Sign-In" you can use the return key UIReturnKeyJoin
textField.returnKeyType = UIReturnKeyJoin;
EDIT
Nope. You get the return key and
keyboard types defined in the OS.
Unless you want to try to hack the
keyboard's view hierarchy to change
that button, which would be a really
bad plan. (Standard recommendation
here is to file a bug report with
Apple to let them know you'd like
more/different options.)
see Custom iPhone return key text
Since I didn't get any satisfactory answer, I convinced the client that it would be inappropriate to modify the default system keyboard for a sake of one button(even if it is allowed by Apple). We are now going for the "Go" option available for return key.

Resources