DevExpress TabbedView : Create Child Form from a Child Form - devexpress

I'm using DX 15.1, and I'm trying to create a new tab from a child form.
So, basically, I have a parent form called "pForm", and a child form called "cForm".
I'm using DocumentManager module and switched it to TabbedView mode.
When I'm trying to create a new tab from pForm, it's totally fine.
the problem is, when I'm can't create a new tab from cForm into pForm's TabbedView.
How do I achieve this?
Thanks, mate :)
UPDATE :
#DmitryG, thanks for your response.
I've attached a screenshot below.
The MDI-Parent is the RGP page with a settings header. and the MDI-Child is the Class Attendance form (popped-up window, triggered by a button inside the RGP form).
Can you give a solution, how to make the Class Attendance Form (mdi-child) became a new Tab beside RGP tab when it's triggered by a button within mdi-parent? Not as a popped-up window.
thanks!

When the DocumentManager works in MDI Mode you can just work with mdi parent and child forms. So, I believe, you code for adding a new mdi-child into mdi-parent form can looks like this:
static void AddMdiChildFromMdiParent(Form mdiParent) {
Form child = new Form();
child.MdiParent = mdiParent;
child.Show();
}
Within the mdi-parent form you can call this code like this:
AddMdiChildFromMdiParent(this);
To add a new mdi-child from an existing mdi-child you can reuse the code above as follows:
static void AddMdiChildFromMdiChild(Form child) {
AddMdiChildFromMdiParent(child.MdiParent);
}

Related

JavaFX call function on random created buttons

So, I am working on this school project where I created multiple buttons with text loaded from my database. These buttons are created everytime by listing a new button with another piece of text within it. I need my other function to be called while one of those buttons is being pressed.
The simple button function:
public Button addOptionToSidebar(String Text)
{
optionSize++;
Button optionButton = new Button();
optionButton.setAlignment(Pos.CENTER);
optionButton.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
optionButton.setText(Text);
optionButton.setStyle("-fx-background-color: #fff; -fx-cursor: hand;");
//Toevoegen aan sidebar
CollectieSidebar.addRow(optionSize, optionButton);
return optionButton;
}
Everytime a button is being created, the function above is being called.
I feel extremely dumb for asking this. This issue is fixed of course by creating an onAction statement within the creation of each button.

Adding a button to a dialog

Are AX dialog buttons limited to OK and Cancel?
Is it possible to add a custom button to the dialog?
I have the following code for my dialog:
static void mitTabPage(Args _args)
{
Dialog dialog;
DialogGroup dialoggroup, dialoggroup2;
DialogField dialogfield, dialogfield2;
;
dialog = new Dialog ("A new Dialog");
dialog.addTabPage("Brand Id's");
dialoggroup = dialog.addGroup("Brand Id's");
dialogfield = dialog.addField(extendedTypeStr(SYCCarBrandId));
dialog.addTabPage("Owners");
dialoggroup2 = dialog.addGroup("Owners");
dialogfield2 = dialog.addField(extendedTypeStr(SYCOwner));
dialog.run();
}
I'd like to add another button to the dialog. How can I do that?
The Dialog framework is a simple framework for prompting users to obtain some data/settings then performing some action or canceling.
For what you're trying to do, it most likely doesn't make sense to use the dialog framework and instead you could/should create another form if you need additional functionality.
However, if you do insist on using the Dialog framework for this, you would add a runtime button and use registerOverrideMethod.
See following links:
https://msdn.microsoft.com/en-us/library/dialogfield.registeroverridemethod.aspx
https://blogs.msdn.microsoft.com/axsupport/2015/06/07/using-x-to-add-a-control-at-runtime/

How to rename dialog box buttons or create new in Ax 2012?

Is it possible to rename dialog box buttons?
For example on "okCancel" can I rename the "ok" button as "continue"?
If not please guide me how can I create my own dialog box?
Thanks ahead.
A button has a "Text" property.
You can set that property or do so by code:
okButton.text("Continue");
The Box::okCancel uses the DialogBox class which is a kernel class and cannot be changed.
The yesNoAxaptaForm method on the other hand uses an AX form, so you can roll on your own.
That said it seems to gain little value.
Also consider using the RunBase framework with a form, as demonstrated in the Tutorial_RunbaseForm class.
You can create a new method in class Dialog overwriting the control #okButton and call this method in your new dialog.
When Dialog class is create in the method new call the method initButtons, which can be overridden.
For example:
FormBuildButtonGroupControl buttonGroup;
formBuildCommandButtonControl okButton;
;
buttonGroup = dialogForm.buildDesign().control(#bottomGroup);
if (buttonGroup)
{
okButton = dialogForm.buildDesign().control(#okButton);
okButton.text("test");
}

Refreshing tableView in JavaFx after closing dialog

I have two layouts in JavaFX app. The first one contains table view whereas the second one is a simple dialog to input data. The problem is that I want to refresh data after closing the dialog. Now I have a button on the first layout which refreshes data:
data.removeAll(data);
loadDataToTable();
But I don't want to invoke methods shown above with the button but automatically right after closing the dialog. I don't know how to make this, let's say, connection between those controllers.
thanks in advance
The new Dialog, if I am not wrong must be a new Stage ! Let us consider the new Stage to be modifyStage. We can call the onSetCloseRequest of the new Stage and put your code in it.
modifyStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
#Override
public void handle(WindowEvent paramT) {
data.removeAll(data);
loadDataToTable();
}
});

Wicket custom filter without dropdown table

I want to create a custom filter for my DataTable. I would like to create a button that, when clicked on it, changes the table its data. I know about the ChoiceFilteredPropertyColumn that wicket has to offer but this is, according to my understanding of it, a dropdown filter.
I am trying to achieve something like the following picture (Pancakes is the clickable button):
Could someone point me in the right direction?
Well... the superclass of ChoiceFilteredPropertyColumn is FilteredPropertyColumn which might do the trick. Otherwise you could always implement your own Column that implements IFilteredColumn the way you like it.
Look at how the implemented `DataTable' here: http://www.packtpub.com/sites/default/files/1605OS-Chapter-5-Displaying-Data-Using-DataTable.pdf
Then you could implement your dropdown button filter like you want it and filter with the selected value the DataTable.
I solved this question by creating a custom filter (just a panel with some markup) and return it in the getFilter method of a custom FilteredPropertyColumn.
FilteredPropertyColumn:
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/extensions/markup/html/repeater/data/table/filter/FilteredPropertyColumn.html
getFilter method:
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/extensions/markup/html/repeater/data/table/filter/IFilteredColumn.html#getFilter%28java.lang.String,%20org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilterForm%29
ButtonFilter class:
public class ButtonFilter extends Panel {
...
}
In custom FilteredPropertyColumn class:
#Override
public Component getFilter(String componentId, FilterForm<?> form) {
return new ButtonFilter<Y>(componentId, getFilterModel(form), filterChoices);
}

Resources