Page 1 of 1

Use showInformation() with big message

PostPosted: Tue Mar 31, 2020 12:28 pm
by reversedr
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

Re: Use showInformation() with big message

PostPosted: Wed Apr 01, 2020 10:49 am
by Support@SIB
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.