"Changes made" notifycation - blackberry

in my application I have some screens with focusable custom buttons, wich pushing another screens with another focusable custom buttons and so on. When I press blackberry's "back" button anter pushing 2-3 screens, it sometimes appear notification with message "Changes made", and options "save", "discard" and "cancel". Why is this? How can I avoid it? all I did is moved focus and pressed buttons.

you can avoid this overriding onclose() and setdirty(false).
public boolean onClose() {
setDirty(false);
return super.onClose();
}

Related

Removing back arrow in navigation bar keeping back button title

I have xamarin forms ios application,where I need to remove the back arrow in the navigation bar but the title should be displayed and when user clicks on on that back button title it should navigate to previous view.
I tried using `
NavigationPage.SetBackButtonTitle(this, "Cancel");
NavigationPage.SetHasBackButton(this, false);
But the back arrow is still displaying,is there any why to have only the text Cancel without <symbol?
I solved my issue by adding a custom renderer as follows
public override void ViewWillAppear(bool animated)
{
base.ViewWillAppear(animated);
this.NavigationController.TopViewController.NavigationItem.LeftBarButtonItem =new UIBarButtonItem(“Cancel”, UIBarButtonItemStyle.Plain, (sender, args) => { });
}
In your AppDelegate.cs file, in the FinishedLaunching method add these lines:
UINavigationBar.Appearance.BackIndicatorImage = new UIImage();
UINavigationBar.Appearance.BackIndicatorTransitionMaskImage = new UIImage();
This will however, remove it for every page. If you want it for just one page I would suggest like EvZ already mentioned: use a modal page or find another way.
Another way is to set the above lines to null which will restore the normal arrow. But this would mean implementing a custom renderer, dependency service or similar.
Remove navigation-bar and use image/header on navigation place and write into image/Header into navigation title...
image onclick event into write back command

want to add done button in keyboard controls to hide keyboard in ios

I want to hide the keyboard after entering data in the fields. For the situation when there is return button in device keyboard the below code works fine.
IOSDriver< WebElement> AD= (IOSDriver) driver;
AD.getKeyboard().sendKeys(Keys.RETURN);
But when there is a done button it doesn't. I suppose we have to add this button.
From java-client's IOSDriver class: http://appium.github.io/java-client/
public void hideKeyboard(String strategy, String keyName)
Description copied from interface: IOSDeviceActionShortcuts
Hides the keyboard if it is showing. Available strategies are PRESS_KEY and TAP_OUTSIDE. One taps outside the keyboard, the other presses a key of your choosing (probably the 'Done' key). Hiding the keyboard often depends on the way an app is implemented, no single strategy always works.
So you'll need to use the following command to press Done on the keyboard:
AD.hideKeyboard("PRESS_KEY", "Done");
Try this it should work after entering click on Done
((IOSDriver)driver).findElement(By.xpath("//XCUIElementTypeButton[#name='Done']")).click();

Disable back button text

I want to disable the back button text in Xamarin iOS,
along with the button itself. I already disabled the back button itself but the text is left.
Does anyone know of any way to disabling the text as well?
Thanks
You can accomplish this in two ways:
NavigationItem.SetHidesBackButton(true, false);
or
NavigationItem.BackBarButtonItem = null;
If you use the second solution, then you would have to recreate the button if you ever want to make it visible again.
With Navigation Page:-
NavigationPage.SetBackButtonTitle(this, ""); //Empty string as title
or hide the Back button with:
NavigationPage.SetHasBackButton(this, false);

How to make content navigation button (remains pressed when clicked) in Vaadin

I created basic vertical layout that work as side menu and now I want to place some buttons in it. Few of them gonna work as common side menu buttons, they just change page content so I want to mark that they are clicked in some way, how can I achive that? Or maybe there is better way?
As stated in the 5th version of Vaadin7 manual, you can attach an event listener to the Button.
button.addClickListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
// show the button has been clicked with a CSS class:
button.addStyleName("v-button-clicked");
}
});
Don’t forget to define the v-button-clicked class. Of course you’re free to add the class of your liking through the .addStyleName() method.

Child field event handling issue in custom HorizontalFieldManager

I am trying to create a customized list field where, I have more then 2 clickable buttons in each row. For that i have customized the HorizontalFieldManager and created own manager to align the field elements. Now UI is perfectly fine.
But, I am struggling to handle the events work for both.
Step-1 I have used fieldChangedListener for buttons added in row. It is working fine
public void fieldChanged(Field field, int context) {}
step-2 have used navigation click to handle event on the parent manager.
protected boolean navigationClick(int status, int time) {
Field field = getFieldWithFocus();
Dialog.alert("shops field clicked");
return super.navigationClick(status, time);
}
Now, even the navigationClick event works. But as the button is the child field added to VFM. When i click on the button both the VFM and button event comes together.
How could i restrict only to the button while it is clicked on the ButtonField.
If I understood your question correctly, you want the navigationClick() to be called only for the child field (clickable button) without being called for the manager. Sorry to disappoint you, but you can't.The navigation click event will always be called first for the manager and only than the manager will propagate the event to the child field. The same hold for keys events, touch events, focus events and etc...
Describe what you are trying to achieve, add a code snippet and I am sure we will find a solution.

Resources