Vaadin 23 lazy loading Details component - vaadin

I love Vaadin Details component. But it looks like it is always pre-rendered. Is it possible to turn the Details component into the lazy-loading mode?
I'd like to render the Details content when user expands the panel. Is it possible to achieve with the Details component? If no, what may be used instead in order to implement such behavior?

Details doesn't support lazy loading of components, but you can use addOpenedChangeListener to get around this. Use a placeholder component like div as content and once the listener is triggered with open=true replace the div with the real component. Keep in mind that the user can open/close the details multiple times. You have to keep track if the user has already opened it / your content was rendered once, so that's not re-created.

Related

What jQuery Mobile event is best for

I am developing a jQuery Mobile application that will run into a Cordova wrapper.
I am struggling to understand the use of each pagecontainerX event and when to use which.
I will post three specific use cases:
1) hook click events:
Say I want to assign a handler to a certain click event on a button.
2) change textual content of the page:
Say I have a page and I want to update some content that might have changed since last time I have shown the page.
3) change graphical content of the page:
Like if I want to draw on some canvas, or in cases where I need to know how things are rendered and their size.
Preliminary answers:
these is what I have found myself, but I would really much appreciate comments:
1) I am using the pagecreate event, as it's only called once. It is also possible to specify what specific page you want to hook the handler to by doing: $(document).on("pagecreate", "#pageid", handler);
2) I am using pagecontainerbeforetransition or pagecontainerbeforehide. Pagecontainerbeforehide has the advantage that is only fired once, while the other is fired twice (dunno why). Other options, like pagecontainershow, will change the content after transition, which is a bit weird to look at.
3) In this case I am employing pagecontainershow, so that things have already been graphically rendered and I can compute heights and widths etc., the drawback is that the user will see the transition, and only after he will see the content of the page being modified.

Vaadin component visible event

Is there an event, or some other way, to know when a vaadin component becomes visible in the browser? This is not for hidden components. I mean when the component is off canvas, like in a different tab that is not selected. Or may be way down the page.
It may be late but i started to create a Vaadin add-on that wraps the jQuery Waypoints library so that You can listen to Vaadin components becoming visible by scrolling.
You can find an experimental release here:
https://vaadin.com/directory#!addon/waypoints-add-on
I haven't done it but maybe you can use jQuery Waypoints.

Delphi TListBox iOS making new itemstyle/behavior

I need to show custom data. For example I need to show a contact list with name, description, photo. And ideally I would also like to show custom data there, e.g. a button to launch telephone call. The default styles do not quite do what I want, but fairly close.
Thus, as far as I can tell, TListBox could be a decent control for this if I could create custom styles? Is that possible? (Anotther problem of course is setting the values of the custom data controls.)
You should take a good look at the FMX CustomListBox example AFAIK even the example alone already seems to have exactly what you need, already set in place.
It took me about 10 minutes to produce this result straight out of the CustomListBox example with your description:
One thing that the included FMX example demonstrates perfectly is how easy it is to add any FMX control to the ListBox via the TStyleBook Layouts such as buttons, images etc... basically any visual control upon which you then implement the HitTest, again, all very detailed in the FMX Delphi example.

TWebbrowser causes AV - what to look for

I have a TWebbroser on a form wher I want to hide the scrollbars
On WebBrowser1DownloadComplete I put WebBrowser1.OleObject.document.body.scroll:='no';
But this results in an AV.
If I click continue I can see that the scrollbars are actually removed, so the code must be the right one to use.
What I am trying to do is to show a page from Google Maps with a lot of markers that I add. This page needs to be printed on an A4 page but it is to big to print directly from the TWebbrowser (or at least I can't get it to work). So I save it as an JPG image and loads that on another form, prints it using DevExpress printingsystem on A4 page with the headers and footers I want.
All is working like I want it to except the removal of the scrollbars.
For accessing Google Maps I use the gmLibrary from http://www.cadetill.com/gmlib/ - very nice lib and it has a pricetag I like.
Just put your code in the DocumentComplete event to remove the AV.
The IE HTML/CSS tricks to remove the scrollbars will not work reliable if the control is embedded. To realy remove the scrollbar you have to inherit the TWebBrowser with the IDocHostUIHandler interface. In GetHostInfo you have to set at least the DOCHOSTUIFLAG_SCROLL_NO flag.
You may consider to use one of the existing descendants like 'Embedded Web Browser Component Pack' (http://www.bsalsa.com/).

JQuery mobile, is there a way to prevent the SELECT box from becoming a dialog page?

SO I have a select box that I fill dynamically. I discovered that once the SELECT gets longer than the page, it automatically becomes a dialog listview.... which is TERRIBLE!
When this happens, the page refreshes when the dialog is closed and my whole page starts over....
Has anyone experienced that and do you know how to shut it off?
Thanks!
Todd
You could use the native look and feel?
http://jquerymobile.com/demos/1.0.1/docs/forms/forms-all-native.html
Native form elements & buttons Although the framework automatically enhances form elements and buttons into touch input
optimized controls to streamline development, it's easy to tell jQuery
Mobile to leave these elements alone so the standard, native control
can be used instead.
Adding the data-role="none" attribute to any form or button element
tells the framework to not apply any enhanced styles or scripting. The
examples below all have this attribute in place to demonstrate the
effect. You may need to write custom styles to lay out your form
controls because we try to leave all the default styling intact.

Resources