Re: Wicket-jquery-ui autocomplete running slow

2019-03-08 Thread Maxim Solodovnik
Additional question: What is the timing of `getFilterList` method?

On Sat, 9 Mar 2019 at 08:17, Sebastien  wrote:
>
> Hi, in your browser devtool / network, that the timing says while calling
> getchoice ?
>
> On Sat, Mar 9, 2019, 06:59 Entropy  wrote:
>
> > My project is using the wicket-jquery-ui AutoCompleteTextField.  We're
> > returning a list that was prefetched and all we do in the getChoices is
> > create a sublist.  the entire getChoices runs in milliseconds...usually
> > 20-30, which I know because I put a rudimentary timer in it.  Yet, the
> > autocomplete feels very sluggish as we're testing it.  So I put a timer in
> > a
> > filter that wraps our wicket calls and timed that.  The filter timer shows
> > the entire event is running 2-4 seconds.
> >
> > 2-4 seconds per keystroke when the fattest part of the call, the data
> > retrieval, is only taking 20-30ms seems like something is wrong.  The
> > list's
> > max size is being limited to 100 rows, but even when I pared it down to 10
> > rows the improvement was only marginal.
> >
> > I pasted the code below, but that mostly just shows the getChoices() which,
> > as I said above, is just filtering over a list in memory.  Any ideas?
> >
> > AutoCompleteTextField fld = new
> > AutoCompleteTextField(fldId)
> > {
> > protected List getChoices(String input) {
> > long start = System.currentTimeMillis();
> > if (minInputLen > 0) {
> > if (input == null ||
> > input.trim().length() < minInputLen) {
> > return
> > Collections.EMPTY_LIST;  // empty list
> > }
> > }
> >
> > List curMatchingList =
> > getFilterList(valList, input,
> > maxFilterListSize); // filters the in memory list valList by the input
> >
> > if (curMatchingList == null) {
> > curMatchingList = new
> > ArrayList();
> > }
> >
> > if (curMatchingList.size() == 0) {
> > if (noResultsVal != null) {
> >
> > curMatchingList.add(noResultsVal);  // no-results option
> > }
> > }
> > System.out.println("GETCHOICES: " +
> > (System.currentTimeMillis() -
> > start));
> > return curMatchingList; // data list
> > }
> > };
> >
> > --
> > Sent from:
> > http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >



-- 
WBR
Maxim aka solomax

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket-jquery-ui autocomplete running slow

2019-03-08 Thread Sebastien
Hi, in your browser devtool / network, that the timing says while calling
getchoice ?

On Sat, Mar 9, 2019, 06:59 Entropy  wrote:

> My project is using the wicket-jquery-ui AutoCompleteTextField.  We're
> returning a list that was prefetched and all we do in the getChoices is
> create a sublist.  the entire getChoices runs in milliseconds...usually
> 20-30, which I know because I put a rudimentary timer in it.  Yet, the
> autocomplete feels very sluggish as we're testing it.  So I put a timer in
> a
> filter that wraps our wicket calls and timed that.  The filter timer shows
> the entire event is running 2-4 seconds.
>
> 2-4 seconds per keystroke when the fattest part of the call, the data
> retrieval, is only taking 20-30ms seems like something is wrong.  The
> list's
> max size is being limited to 100 rows, but even when I pared it down to 10
> rows the improvement was only marginal.
>
> I pasted the code below, but that mostly just shows the getChoices() which,
> as I said above, is just filtering over a list in memory.  Any ideas?
>
> AutoCompleteTextField fld = new
> AutoCompleteTextField(fldId)
> {
> protected List getChoices(String input) {
> long start = System.currentTimeMillis();
> if (minInputLen > 0) {
> if (input == null ||
> input.trim().length() < minInputLen) {
> return
> Collections.EMPTY_LIST;  // empty list
> }
> }
>
> List curMatchingList =
> getFilterList(valList, input,
> maxFilterListSize); // filters the in memory list valList by the input
>
> if (curMatchingList == null) {
> curMatchingList = new
> ArrayList();
> }
>
> if (curMatchingList.size() == 0) {
> if (noResultsVal != null) {
>
> curMatchingList.add(noResultsVal);  // no-results option
> }
> }
> System.out.println("GETCHOICES: " +
> (System.currentTimeMillis() -
> start));
> return curMatchingList; // data list
> }
> };
>
> --
> Sent from:
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Wicket-jquery-ui autocomplete running slow

2019-03-08 Thread Entropy
My project is using the wicket-jquery-ui AutoCompleteTextField.  We're
returning a list that was prefetched and all we do in the getChoices is
create a sublist.  the entire getChoices runs in milliseconds...usually
20-30, which I know because I put a rudimentary timer in it.  Yet, the
autocomplete feels very sluggish as we're testing it.  So I put a timer in a
filter that wraps our wicket calls and timed that.  The filter timer shows
the entire event is running 2-4 seconds.

2-4 seconds per keystroke when the fattest part of the call, the data
retrieval, is only taking 20-30ms seems like something is wrong.  The list's
max size is being limited to 100 rows, but even when I pared it down to 10
rows the improvement was only marginal.

I pasted the code below, but that mostly just shows the getChoices() which,
as I said above, is just filtering over a list in memory.  Any ideas?

AutoCompleteTextField fld = new
AutoCompleteTextField(fldId)
{
protected List getChoices(String input) {
long start = System.currentTimeMillis();
if (minInputLen > 0) {
if (input == null || 
input.trim().length() < minInputLen) {
return Collections.EMPTY_LIST;  
// empty list
}
}

List curMatchingList = 
getFilterList(valList, input,
maxFilterListSize); // filters the in memory list valList by the input

if (curMatchingList == null) {
curMatchingList = new 
ArrayList();
}

if (curMatchingList.size() == 0) {
if (noResultsVal != null) {

curMatchingList.add(noResultsVal);  // no-results option
}
}
System.out.println("GETCHOICES: " + 
(System.currentTimeMillis() -
start));
return curMatchingList; // data list
}
};

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket and material theme

2019-03-08 Thread Zbynek Vavros
Excelent!

Thanks

On Thu, Mar 7, 2019, 6:59 AM Martin Grigorov  wrote:

> Hi,
>
> On Thu, Mar 7, 2019 at 12:14 AM Zbynek Vavros 
> wrote:
>
> > Hi Martin,
> >
> > sorry if the message understood was to put this project in a bad light,
> not
> > at all!
> >
> > I played with it a while and seems to be doing exactly what advertised.
> > Maybe a question (since I see you are one of the authors) - how does one
> > add a theme?
> > By checking the ThemeProvider I see only "bootstrap" theme is available
> by
> > default.
> > How to add new theme into provider?
> >
>
> "bootstrap" theme is the default one and it is in wicket-bootstrap-core
> module.
> All other themes are in wicket-bootstrap-themes module:
>
> https://github.com/l0rdn1kk0n/wicket-bootstrap/tree/wicket-7.x/bootstrap-themes
> To set it up you need to do something like:
>
> final IBootstrapSettings settings = new BootstrapSettings();
>
> Bootstrap.builder().withBootstrapSettings(settings).install(yourApplication);
> ThemeProvider themeProvider = new SingleThemeProvider(new
> MaterialDesignTheme());
> settings.setThemeProvider(themeProvider);
>
> See how the demo application does it here:
>
> https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/10a60be4e68038e4b1d275bc598835d12f5a715d/bootstrap-samples/src/main/java/de/agilecoders/wicket/samples/WicketApplication.java#L209-L218
>
>
> >
> > Thanks,
> > Zbynek
> >
> > On Wed, Mar 6, 2019 at 9:51 AM Martin Grigorov 
> > wrote:
> >
> > > Hi,
> > >
> > > On Wed, Mar 6, 2019 at 1:36 AM Zbynek Vavros 
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > for a new project we would like to use (hopefully) well known
> material
> > > > design.
> > > > After some discussion we discarded using any popular JS frameworks.
> > > > Since most of us work with Wicket for quite some time and we all like
> > it
> > > > we would like to stick with it.
> > > >
> > > > Now would be the recommended way to use material design with Wicket?
> > > >
> > > > There is an integration project
> > > > https://github.com/l0rdn1kk0n/wicket-bootstrap
> > > > that doesn't seem to be very actual (failed builds, TBD in docs...).
> > > >
> > >
> > > - failed builds are due to bad CI servers. The project uses TravisCI
> > > because it is free and the builds there are very unstable. If you build
> > the
> > > project locally with "mvn clean package" it will build just fine.
> > > - TBD in docs: well, it is an open source project... People contribute
> as
> > > much as they need for their apps. It is better than nothing.
> > >
> > >
> > > > It also doesn't seem to implement even basic components (
> > > >
> > > >
> > >
> >
> https://material-components.github.io/material-components-web-catalog/#/component/text-field
> > > > ).
> > > > Or maybe I missed something?
> > > >
> > >
> > > Wicket-Bootstrap project, as its name suggests, provides integration
> with
> > > Bootstrap . The Material design is just one
> > of
> > > the themes for Bootstrap, provided by
> > > https://github.com/FezVrasta/bootstrap-material-design/
> > >
> > >
> >
> https://fezvrasta.github.io/bootstrap-material-design/docs/4.0/examples/checkout/
> > > shows a form with this theme. I am not sure whether it completely
> > > implements the "specification"
> > >
> > >
> > > >
> > > > Another option would be to do all styling manually, well...
> > > >
> > > > Did anyone used material with Wicket?
> > > >
> > > > Thanks,
> > > > Zbynek
> > > >
> > >
> >
>