Form Field in Menu [message #1798467] |
Mon, 19 November 2018 10:26  |
Eclipse User |
|
|
|
Hello,
as i explored the widgets, i stumbled accross this https://scout.bsi-software.com/widgets/?dl=widget-menubar nice piece of menu.
Now i was wondering if i could put it on my tablepage. As said in the release notes of 7.1, one should be ablte to add this menu in any menu supporting environment.
I tried it like in the github linked to the widget with
@Order(50)
public class MyMenuMenu extends AbstractFormFieldMenu {
@Order(10)
public class MenuDateField extends AbstractDateField {
private final SimpleDateFormat m_dateFormatter = new SimpleDateFormat("MM-dd-yyyy hh:mm");
@Override
protected String getConfiguredLabel() {
return "DateField in MenuBar";
}
@Override
protected byte getConfiguredLabelPosition() {
return LABEL_POSITION_ON_FIELD;
}
@Override
protected boolean getConfiguredLabelVisible() {
return false;
}
@Override
protected boolean getConfiguredStatusVisible() {
return true;
}
@Override
protected void execChangedValue() {
getDateFieldValueField().setValue(Optional.ofNullable(getValue()).map(v -> m_dateFormatter.format(v)).orElse(null));
System.out.println("Date changed to: " + getValue());
}
}
}
I put it inside my table on a tablepage. My other menus on this page work just fine and i wonder what i need to specify to make it work too.
Because i think its a great tool for loading data for a user specified period of time (e.g. in my case the chosen month)
So what part of the implementation did i mess up in the first place?
Thank you in advance!
|
|
|
|
Re: Form Field in Menu [message #1798532 is a reply to message #1798517] |
Tue, 20 November 2018 03:48   |
Eclipse User |
|
|
|
Hey Patrick,
thank you for the answer. Im using Scout 8.0.0.021_Simrel_2018_09 at the moment.
I thought i did that, maybe i have to investigate further, the codesnippet i poseted is inside the table, just like other menus like a new or edit menu (those are showing without any problem). But the datepicker is not.
So to simplify the snippet:
public class Table extends AbstractTable {
@Order(10)
public class EditMenu extends AbstractMenu {...}
@Order(20)
public class NewMenu extends AbstractMenu {...}
@Order(50)
public class MyMenuMenu extends AbstractFormFieldMenu {
@Order(10)
public class MenuDateField extends AbstractDateField {...}
}
...all the columns etc
}
So i think i already placed it as you said or did i get you wrong?
UPDATE:
It seems the behaviour is like the behaviour of a edit menu, It shows up now, but only on selection of sth in the table. I dont get why though, and i need it to show like a new menu so i can use it to filter data for a specific month/day chosen by the user.
EDIT:
Ok nevermind, i figured it out, forgot to set it as a tablemenutype, shame on me :) But thank you so far :)
[Updated on: Tue, 20 November 2018 05:08] by Moderator
|
|
|
|
Powered by
FUDForum. Page generated in 1.56691 seconds