This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information

Use showInformation() with big message

General questions regarding the development with JavaFX UI for JVx.

Use showInformation() with big message

Postby reversedr » Tue Mar 31, 2020 12:28 pm

Hello!

Need to show a big message to the user.

I´m using the function showInformation()

showInformation(this,"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa. bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, ccccccccccccccccccccccccccccccccccccccccccccccccc.");

but it doesn´t show very well...as i can only see one line...with a scrollbar.

Any way to use the showInformation() to show the entire message or other function that i can use ?

Thank You
Attachments
Capture.JPG
Capture.JPG (15.89 KiB) Viewed 6903 times
reversedr
 
Posts: 35
Joined: Tue Oct 23, 2018 11:03 am

Re: Use showInformation() with big message

Postby Support@SIB » Wed Apr 01, 2020 10:49 am

One problem in vaadin is that windows don't calculate the frame size based on their content. So we set a fixed size. This is not good in case of a long message.

It's easy to change the size. If you use a standard JVx application, simply override the method:

Syntax: [ Download ] [ Hide ]
public <OP> IContent showInformation(OP pOpener, String pMessage) throws Throwable

of your Application class.

If you work with ProjX as application class, it's also possible to override the same method, but you also have an event for the case that you don't have a custom Application:

Syntax: [ Download ] [ Hide ]
projx.eventOpenContainer().addListener(this, "doConfigureContainer");

public void doConfigureContainer(ProjX pProjX, IContainer pContainer, IContent pContent)
{
    if (pContent instanceof Message)
    {
        if (isSizeUndefined(pContainer))
        {
            pContainer.setSize(new UIDimension(550, 300));
        }
    }
}

If you want to create a custom info dialog, create your own content:

Syntax: [ Download ] [ Hide ]
MyInfoContent info = new MyInfoContent();

//"this" is the opener        
//null sets the application as opener
application.openContent(this, "Title", true, info);

public class MyContent extends Content
{
...
}
 

Details, read this article.
User avatar
Support@SIB
 
Posts: 353
Joined: Mon Sep 28, 2009 1:56 pm


Return to Development