by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 18:38
    vaadin-bot commented #8708
  • 17:48
    platosha synchronize #8708
  • 17:48

    platosha on fix

    Introduce getKeyModelSymbol to … Generate lazy-initialised bean … (compare)

  • 15:10
    vaadin-bot labeled #8709
  • 14:26
    stephan-comerge opened #8710
  • 14:21
    joheriks labeled #8709
  • 14:21
    joheriks opened #8709
  • 14:20

    joheriks on 8693-routerlink-scroll-position

    Store scroll position in state … Disable IT when using client ro… (compare)

  • 13:51
    mshabarov commented #8699
  • 12:08
    KasparScherrer commented #8629
  • 12:01
    KasparScherrer commented #8629
  • 11:59
    KasparScherrer commented #8629
  • 11:12
    vaadin-bot labeled #8708
  • 10:24
    platosha labeled #8708
  • 10:24
    platosha opened #8708
  • 10:23

    platosha on fix

    Enable lazy initialisation of O… (compare)

  • 09:44
    mshabarov commented #8699
  • 08:13
    vaadin-bot labeled #8707
  • 08:12
    vaadin-bot commented #8707
  • 07:53

    joheriks on has-item-components

    (compare)

Marco Collovati
@mcollovati
I think assertion are enabled during build test phases (eg maven failsafe plugin)
Jonatan Jönsson
@jontejj
Probably, but shouldn't the assertions run in production as well?
Knoobie
@knoobie
The assertions aren't meant for production. You can find an old explanation by Leif here https://github.com/vaadin/framework/issues/11282#issuecomment-434308545
Jonatan Jönsson
@jontejj
@knoobie thx for that link, that clarifies it. I'm still skeptical though. Network programming is hard and things happen in production that should not happen. So if the assertion is light-weight, they should always be enabled IMO. But I guess enabling -ea for production is out of the question if this is the approach taken
Enabling it during my tests is a pretty good idea though
Jonatan Jönsson
@jontejj
I don't think it's a good practice to have differences between my test environment and production though. -ea should probably only be used for local development, not for tests running in a CI environment?
Pekka Hyvönen
@pleku

can someone explain the use of pageSize in comboBox ?

basically it means of what "limit" is used in the Query

At the moment in practice the limit in Query is a multiple of the pageSize. The query might actually ask for 150 items instead of doing 3 separate queries for 50

vaithu
@vaithu
Thanks @pleku . So, should I get all 150 at a time or is it fine if it sends 3 requests for 50 each
also, how does this improve when filtering ?
Christoph Frick
@christoph-frick
it's not your choice directly - the page-size gets multiplied by three and this is the limit for the query
to my knowledge this is code inside the grid and as stated in the combobox and most likely therefor at some common core for the consumers of data providers
Pekka Hyvönen
@pleku
What is actually fetched from the data provider is decided in DataCommunicator that both ComboBox and Grid use. Basically the component ask for a range of items and then the communicator decides what is actually needed from the data provider.
There are some changes planned to that where the developer gets the option to "force" the page size to be always used for the query in case that is needed for the specific backend that is used. So this would mean that
1) page size is 50
2) grid asks for rows range 300..400
3) the data communicator makes two queries of 300..350 and 350..400 instead of one 300..400.
Nils-Florian
@Nils-Florian
Hi, i need some help with my application login. Its basicly a passwordfield, a textfield an a button. I cant manged to geht the browser take notice of this two fields so that the users cann save there user / password combination in there browser and dont have to login every time manually
vaithu
@vaithu
@pleku , I'm using a dataprovider like below
CallbackDataProvider<String, String> descDataProvider
                = DataProvider.fromFilteringCallbacks(query -> {
            String filter = query.getFilter().orElse("");
            datastore.query(Product.TARGET)
                    .restrict(query.getLimit(), query.getOffset())
                    .stream(Product.DESCRIPTION)
                    .filter(s -> StringUtils.startsWithIgnoreCase(s,filter))
                    .forEach(s -> System.out.print(s+"\t"));
            Stream<String> propertyBoxStream = datastore.query(Product.TARGET)
                    .restrict(query.getLimit(), query.getOffset())
                    .stream(Product.DESCRIPTION)
                    .filter(s -> StringUtils.startsWithIgnoreCase(s,filter));
                           // s -> s.startsWith(filter)
            return propertyBoxStream;
        }, query -> {
            String filter = query.getFilter().orElse("");
            long propertyBoxStream = datastore.query(Product.TARGET)
//                    .filter(Product.DESCRIPTION.startsWithIgnoreCase(filter))
//                    .filter(Product.DESCRIPTION.startsWithIgnoreCase(filter))
                    .stream(Product.DESCRIPTION)
            .filter(s -> StringUtils.startsWithIgnoreCase(s,filter))
                    .count();
            write("filter " + filter+"\t count :"+propertyBoxStream);
            return (int) propertyBoxStream;
        });
and getting error as java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
I've written my problem here in detail : http://blog.vaithu.com/2020/06/25/vaadin-lazy-loading-issues/
Pekka Hyvönen
@pleku
@vaithu sorry I'm not going to start investigating that for you. You need to debug it yourself, if you find an issue in the framework code then please report it with the steps to reproduce.
My guess, which all I can do since I don't even know where the error is thrown, would be that your code is returning a larger size than what is actually contained by the backend.
If the e.g. the grid component fetch query gets less items than requested (data source runs out of items), then it does another size query to adjust the size, but if even this doesn't match the results of the fetch query, it will fail because the contract is not respected.
I've just seen this myself couple weeks back and it is not good behavior as the error message is very bad, but I'm not 100 % it is the same case though.
Christoph Frick
@christoph-frick
@pleku i'd like to +1 the statement about the sub optimal error message for the wrong counts; ran into it too a few month ago
Pekka Hyvönen
@pleku
I'll make a ticket about it soon
vaithu
@vaithu
@pleku , thanks for looking. Let me debug and see what is happening
Jonatan Jönsson
@jontejj
Graalvm can run node applications and even install npm packages (I haven't tested it myself yet though), given that Vaadin 14 uses Node / npm, it would be interesting to explore using only graalvm instead of installing Node?
Pekka Hyvönen
@pleku
Hello. Anyone referring to listing components (like grid, combobox) using the interface type of HasItems or HasDataProvider to set the items to it ? Please comment if you do, thanks.
masba
@masba77454784_twitter
Hi, can anyone explain which github repos are the correct one for posting issues for Vaadin 14? the one with "flow" or without "flow"? (e.g for Timepicker)
Pekka Hyvönen
@pleku
@masba77454784_twitter for the Java TimePicker component, please use http://github.com/vaadin/vaadin-time-picker-flow
masba
@masba77454784_twitter
By the way: why is there this difference? May i ask which are the recommended one? Are they still developed actively?
Pekka Hyvönen
@pleku
The one with -flow is for the Java integration, to be used with Vaadin Java apps.
The one without it is a web component that can be used with any web app (that support web components one way or another)
The flow integration is based on the web component and thus it is using that one. Both are being developed "side-by-side". Some features for the Java component will be made first as a web component feature that the Java component then just integrates with.
vaithu
@vaithu
image.png
I'm seeing a blank space like this in a Grid component. Any idea why there is such space?
Christoph Frick
@christoph-frick
@vaithu: shot in the dark: are the entries missing there equal to others in the list?
as in "equals and hashcode"
Rolando Isidoro
@rolandoisidoro
@vaithu , is the black space in the grid related to missing entries or is it something else that you can't explain and is resulting in the component being misrendered?
vaithu
@vaithu
@rolandoisidoro @christoph-frick it works well if you scroll slowly. The faster you scroll, more the space is. This grid component is reading 80K records but in a lazyway
Rolando Isidoro
@rolandoisidoro
@vaithu , how does it show on the first render? No blank space on top? If you inspect that area of the component, using the browser's dev tools, what is the corresponding source code?
Christoph Frick
@christoph-frick
is is related to the 80k? what happes if you just return a const count of say 1000
vaithu
@vaithu
@christoph-frick , for 1000 it works well without any issues
@rolandoisidoro here is the screenprint showing the dom code and there is nothing for the blank space in the source code
image.png
I scrolled bit faster now and the space is bigger than before
image.png
Christoph Frick
@christoph-frick
could be rounding errors due to the large numbers. maybe create a reproducible example and then a ticket?
Rolando Isidoro
@rolandoisidoro
@vaithu , what area of the source code gets highlighted when you hover the blank space with the element selection ON?
image.png
vaithu
@vaithu
image.png
when I select the blank space, it selects entire table body and as you said, if I choose pick element, there is nothing to pick from the blank space but the dom shows all rows as you can see in the bottom screen
so I believe there is something in the browser that is not showing up ?
vaithu
@vaithu
Vaadin should have a pagedGrid ( official component) so that developer is not embarrassed when client scrolls like above and sees blank space
Rolando Isidoro
@rolandoisidoro
@vaithu , it wouldn't require too much effort, the principles are very similar, the current lazy loading grid already handles requests for retrieving a given amount of records from a given index via the data provider. It would be a matter of adding the proper pagination navigational elements.
Rolando Isidoro
@rolandoisidoro

I'm trying to use Lumo Badges in server-side views (Java), but the styles aren't being applied to a <span theme="badge primary pill">10</span> element.

The @CssImport annotation mentioned in the top of that documentation article is missing the value attribute. I found @vaithu 's blog post in the discussion section and followed it's example, by adding the include = "lumo-badge"attribute to an existing @CssImport annotation. I have confirmed that the styles are being loaded into the DOM, but still can't get them to be applied to the span element.

Is anyone successfully using Lumo badges on Java views that could help me out?