i am looking for a way to add some attributes to components (in my specific case it is a long field to a button component).
I need to build a list of buttons in program-code:
for (Integer i: intvalues) {
Button button = uiComponents.create(Button.NAME);
}
Now I need a way to do something like:
button.setMyNumber(i)
So: Is there a a way to create something like:
private class MyButton extends Button {
private Long number;
public void setNumber(Long p_number) {
number = p_number;
}
public Long getNumber() {
return number;
}
}
This would result in:
for (Integer i: intvalues) {
MyButton button = ???
button.setNumber(i);
}
thanks very much for your reply. I think, this is the way for building
an own component library. But I just need a way, to put some kinds
of addon-information (things that make work easier on just a local state)
to a component.
A thing, that would help, would be an object-store like:
component.setAddonInfo(Object addoninfo);
and
component.getAddinInfo();
With a attribute like this, some things would be easier to handle.