Is it possible to add a side button to a text field? just like the actions on the pickers?
I need it to open a Screen and on close the string will return a string.
Currently I’m adding a button on a form and its taking a column and pushing everything around.
Thank you
Isn’t that what you need?
<hbox>
<textField width="50px"/>
<button caption="button"/>
</hbox>
You can remove unnecessary rounding of the corners of elements by editing styles.
Thank you for your reply
Adding a button beside it is what I have, but I’m wondering if it can be a nice button like a custom action from the screenshot above to open my screen.
Create a click handler for the button and open the desired screen.
Opening Screens :: Jmix Documentation
Or you can create your own action for this button.
Declarative Actions :: Jmix Documentation
Declare new action in descriptor:
<actions>
...
<action id="action_1" caption="MyAction" icon="UNLOCK_ACTION"/>
</actions>
And create subscription in controller for screen opening.
@Subscribe("action_1")
public void onAction_1(Action.ActionPerformedEvent event) {
screenBuilders.screen(this)
.withScreenClass(OtherScreen.class)
.withAfterCloseListener(e -> {
//Process result
})
.build()
.show();
}
Hi!
Maybe it will help?
Composite Components
https://demo.jmix.io/sampler/#main/0/sample?id=composite-component
2 Likes
This is it !!! Spasibo !!!