I wish to save information entered by user on my form using a dialogue box.
Dialog d=new.dialog();
d.show("save info","Do you want to save?","OK","Cancel");
Can i add a textfield (edit-textbox) in the dialog box for the user to enter the desired name (alphanumeric) before pressing ok. and if not interested he can simply cancel. I will be saving the information as a hashtable in an object with user selected name.
If it cannot be done in dialog what is the next best way. pl add a piece of code or tutorial for better understanding.
Its a mobile app developed in Codename one. Therefore, even LWUIT users can help.
thanks
try this:
Textfield myTF = new textfield();
Dialog abc = new Dialog();//how ever u wish to initialize it
abc.addComponenet(myTF);//add text field to dialog
abc.show();//show dialog.
Note: Dialog extends a Form. so u get the propertied of a form in your dialog.
Related
Right now I am working on a Xpage which displays data from a domino document. Based on the form of the document different fields will be displayed.
Now I want to create a "New" function. My idea here is to set the view I am previously using in edit mode.
Additionally, I want to add a radio button which enables a user to choose the form of the document he wants to create.
Based on this radio button the document form should change which should result in the elements displayed on the page changing too.
Overall if I switch between the radio button options and hit save, a new document will be created with the right form.
Yet my problem is that my elements in my view won't change dynamically. So if I switch my form there will still be elements/controls displayed for the default option but not the selected form.
My idea was to create an onChange-event for my Radio Button Group.
My questions here would be: How can I change my formValue for the Xpage (new document) and then reload it with the new set value?
Thanks for your explanation.
I understand you have one XPage suitable for multiple forms, I assume using a Switch control and custom controls per form. About the New button, you could try first to have 3 New buttons, each for a separate form, and you create a URL like yoursite.com/xpage.xsp?action=newdocument&form=someform
When the user clicks the button, your page can read the parameters (param.action and param.form) and act accordingly. Or do you intend to update the current page using partial refresh, as a single page approach?
I would like to prompt a message box that would consist of a label, text box and a button to email the form to the email address added in the text box when the Save button in Orbeon form is clicked. Is there a dialog control suitable for this? Please help.
You'll most likely need to add your own dialog for this. I imagine that this is for a form you're creating with Form Builder. Then the good news is that the upcoming Orbeon Forms 2017.2 will have a new property, oxf.fr.detail.dialogs.custom.*.*, which will allow you to include in your forms dialogs that you've defined in external files.
I have a grid layout in which I want to show a pop up when the user tries to replace a component which is already present in the grid.
For e.g. the grid layout has a Label (wrapped in a DragAndDropWrapper) which is present at 0,0 position.
If the user tries to add a new component at the same position(0,0 position), then it should show a pop up (confirmation dialog box) asking the user to confirm if the user wishes the replace the existing component or not.
Now, my issue is that the current thread does not wait for the execution to complete. It keeps going ahead after showing the pop up box. Thus, there is a lot of problem in updating the UI after the input is taken from the dialog box for the user's answer.
Can someone show how to do this? Note that I need to do this in a DragAndDropHandler's drop method call as I need to show the dialog box only when the user tries to drop a new component on an existing component of the grid layout.
A working example would be a great help.
Thanks in advance.
So I followed the comment by André Schild and it did work for me.
I just remember which component and location was used for replacing the component. Then, I ask for a confirmation and if the user says Yes, then I just go ahead and replace it.
Thanks again Andre
I have an extension pages dialog box that I placed in a custom control. The dialog box is used to search for cost centers and return information such as market, cost center number, cost center name etc.
A "Select" button is pressed and the dialog box appears. The user searches for and selects their cost center. The OK button is pressed and it closes the dialog box and updates the various fields on the xPage.
A couple of questions.
Currently the "Select" button on the CC needs to know and refer to the name of the dialog box control within the CC. Seems to me that this is not the best practice. My end user programmer needs to know the ID of that dialog box control within the CC. Is there any way for my "Select" button could "show" the CC and the CC would actually show the dialog box control?
My CC makes use of custom properties to store the various document fields from the selected cost center. The OK button then uses these properties to set the various fields on the xPage. This again does not seem to be a best practice. If I wanted to use that CC in another application then I might need to edit the code in the OK button. Is there a better way to deal with this? Like I can set properties for a CC when I drop it on my xPage, is there a way I can tell it the code that I want to execute when the OK button is pressed?
One thing I thought was to have properties for the fields that need to be updated by the OK button but that does not seem to be so flexible.
For the issue of needing to know the id not sure if theres a typo but I don't understand why its bad that a select button inside a cc needs to no the id of the dialog to open it? did you mean the select is outside the cc? either way have you tried anything like creating a property on the custom control so that from outside it you can set something maybe
<xc:mycustomControl showDialog="false">
and then when something outside it happens change showDialog and refresh the cc, then inside the cc you can have a before / after page load to determine what happens when showDialog is true / false.
For your second issue it sounds to me like this should be using a domino document structure. Rather than the dialog pulling out each piece and the ok button updating, what I would do is have a domino doc data source on the page. when something is selected through the dialog I would update the document this source is pointing to and have all the fields bound to what ever fields they need to be. This way after something is selected the fields will just update to what ever the document contains, and it will be much more re useable so long as the domino docs have the same field names
How can I display a messagebox like the Microsoft error message in C#.net
The message box should have an OK button and an Show details button.
The Show details button should display the error details. Is there a built in class for this?
Thank you
There isn't a standard dialog to do this; you'll have to create your own Form and display it with a ShowDialog.
You can have the Click event of the 'Details' button change the size of the form and toggle the visibility of the details text.
There is no built in class available to do this.
you can create a custom form with Ok and Show Details button.
set height and width as per the need.
handle click event for the button with appropriate code.
create an instance of this form and use ShowDialog() method to show the dialog box