This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
How to create a custom dialog
I am making a dialog .
I want to creat two button is (" View " ) and " Cancel " button.
How do I creat " View " button on Dialog ?
Instead of creating a custom dialog, you can use the dialog.ask like the code below:
int i = Dialog.ask(""Your text", new String[] {"View", "Cancel"}, new int[] {1, 2}, 1);
if (i == 1)
//your code for view button
else if (i == 2)
//your code for cancel button
Extend your CustomDiaolog from Dialog class
Create the button object that you want to create
Add required listeners or navigationClick or keyChar event
Add them to the CustomDiaolog
that's all.
Related
How to disable menu button press in TVML? For some scenarions in my project,like while playing Ads in video, I dont want user to skip it by pressing menu button.I did not see any solution on internet. Please help.
function loadingDoc() {
var Template = `
<document>
<divTemplate>
<title style="tv-position: bottom-right;">1/1</title>
</divTemplate>
</document>`
var templateParser = new DOMParser();
parsedTemplate = templateParser.parseFromString(Template, "application/xml");
parsedTemplate.addEventListener("disappear", highlightThumbnail.bind(this));
player.interactiveOverlayDocument = parsedTemplate;
player.interactiveOverlayDismissable = true;
}
var highlightThumbnail = function (event){
loadingDoc();
}
Two solutions that might work are:
1) Native + TVML: find the topmost view controller as mentioned in iPhone -- How to find topmost view controller and apply UITapGestureRecognizer to it.
2) TVML only: with interactiveOverlayDismissable and interactiveOverlayDocument, you can push another overlay document when the user dismisses the current one. Thus-- they will never be able to menu out.
I am new to AX, and I am struggling with the basics.
My requirement is to save the record in a table from form controls on a button click event. What is the best approach?
Because I also see "Override" method "CreateRecord". If I go with "CreateRecord" method, then is it possible invoke the method in "Button Click Event"?
In form you need to add a Button, then expand, right click in methods, Override method and select Clicked.
Here put your code, For example:
void clicked()
{
TableExample TableExample;
;
TableExample.clear();//clear fields
TableExample.Field1 = "Your Value 1";
TableExample.Field2 = "Your Value 2";
TableExample.Field3 = "Your Value 3";
TableExample.Field4 = "Your Value 4";
TableExample.Insert();//Insert in table
info("Record create");//Display a message (Optional, only an example)
super();
}
I have been set to make some changes to a Xamarin IOS project (which I am total new to), and I quickly found out, that our project does not work as it should.
// save our uiview owner
this._owner = owner;
// configure the title label
_titleLabel.BackgroundColor = UIColor.Clear;
_titleLabel.TextColor = Colors.backgroundcolor;
_titleLabel.Font = Fonts.HelveticaNeueLight();
// configure the done button
_doneButton.SetTitle("OK", UIControlState.Normal);
_doneButton.TouchUpInside += (s, e) => { _actionSheet.DismissWithClickedButtonIndex(0, true); };
_doneButton.SetTitleColor(Colors.backgroundcolor, UIControlState.Normal);
_doneButton.SetFont(eFontType.HelveticaNeue_Light, 14);
// create + configure the action sheet
_actionSheet = new UIActionSheet() { Style = UIActionSheetStyle.BlackTranslucent };
_actionSheet.Clicked += (s, e) => { Console.WriteLine("Clicked on item {0}", e.ButtonIndex); };
// add our controls to the action sheet
_actionSheet.AddSubview(picker);
_actionSheet.AddSubview(_titleLabel);
_actionSheet.AddSubview (_doneButton);
^this was how it was created, and added some label, button and a datepicker.
We were using a UIActionSheet to show a Datepicker. But as I can see, IOS8 does not support this way to handle it anymore.
And I am clueless how we can make it work with UIAlertController - I cannot find any good examples.
Please see this post from the Xamarin Forums iOS 8 Datepicker
To quote,
Now the Actionsheet can't add Subviews anymore
So here is a Github link for a replacement for the ActionSheet Datepicker. I just implemented this in my app and its working well. Github Replacement
In the forum post there is a step by step link to integrate into your project.
I am new on Vaadin.
How to pass Table component to new popup screen in Vaadin 7? Assume I already created table using com.vaadin.ui.Table.
Table aaa = new Table();
Currently Vaadin tutorial just show how to create print popup without pass component/data.
Based on below code
public static class PrintUI extends UI {
#Override
protected void init(VaadinRequest request) {
// Have some content to print
setContent(new Label(
"<h1>Here's some dynamic content</h1>\n" +
"<p>This is to be printed.</p>",
ContentMode.HTML));
// Print automatically when the window opens
JavaScript.getCurrent().execute(
"setTimeout(function() {" +
" print(); self.close();}, 0);");
}
}
...
// Create an opener extension
BrowserWindowOpener opener =
new BrowserWindowOpener(PrintUI.class);
opener.setFeatures("height=200,width=400,resizable");
// A button to open the printer-friendly page.
Button print = new Button("Click to Print");
opener.extend(print);
Appreciated if someone could show me how to pass Table aaa into PrintUI class.
Window window = new Window("my test table popup");
window.setContent(table);
window.setModal(true);
getUI().addWindow(window);
The only way that I have found to pass objects to the UI class in popup window is to store them in session:
Table table = new Table();
VaadinSession.getCurrent().setAttribute("table", table);
In the popup window:
Table t = (Table) VaadinSession.getCurrent().getAttribute("table");
You can also initialize your Table in your PrintUI class. If you need to initialize a specific Table instance, you can pass, let's say, your table id parameter to the UI via .getParameter("idTable") (which, in the end, works as adding a GET parameter to the URL) and then retrieve it in your PrintUI's init() method via the request parameter with .getParameter("idTable").
I want to create an empty dialog box with a text field inside. When the user enters data inside the box he must be redirected to another screen. I want the Dialog box to come up without any statements but must include a textfield
That should be doable with a PopupScreen, EditField and maybe a ButtonField so the user can let you know he/she is done entering data.
Just create standard OK dialog and then add an EditField to it.
BasicEditField inputField = new BasicEditField();
Dialog d = new Dialog(Dialog.D_OK_CANCEL, "Enter your Username:", Dialog.OK, null, Dialog.DEFAULT_CLOSE);
d.add(inputField);
int i = d.doModal();
if (i == Dialog.OK) {
Dialog.inform("Your Username is : " + inputField.getText());
}
Here's a complete tutorial