Change indicator in AjaxLazyLoadPanel - wicket

How can I change the indicator that is shown when loading a AjaxLazyLoadPanel?
I tried to override the getLoadingComponent and implementing IAjaxIndicatorAware in the Panel I return from the AjaxLazyLoadPanel

Overriding getLoadingComponent(String) is the correct way!
See the default impl at https://github.com/apache/wicket/blob/e4ea6d7b488f04948fd50b69e06da2d231e3b5ba/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxLazyLoadPanel.java#L134
Just return another Component that renders what you want to render.
Or show us your code so we can tell you what is not OK.

Related

GoogleMaps on Ionic5 messing up Swipe Modal

I’m having issues with the GoogleMaps and the new ‘swipe to close’ modal.
My issue is that the class _gmaps_cdv_ that gets attached to the body by GoogleMaps is changing the background color to white. The effect looks weird and bad.
I’ve tried pretty much everything…
Removing the class once the modal gets loaded. That will make the map disappear and take whatever color I’ve set to the background.
Removing the class once the modal gets loaded and attaching it again once the modal gets destroyed. Same result as previous
Destroying the map on the ionViewWillLeave() and recreating using the ionViewWIllLoad(). Same result as previous.
Any tips? Is this a bug?
Thanks
I got around this. The solution is pretty simple. The background color can be setup on the Environment class of the GoogleMaps.
Make sure the Environment is imported on your component and do as follows:
// If you're following the documentation, there should be more things imported here, because I'm focusing on the Environment, I will only use this one.
import { Environment } from '#ionic-native/google-maps/ngx';
ngOninit() {
Environment.setBackgroundColor('black'); // Or whatever color you want.
}
That's it!
Here is the documentation link for reference:
https://github.com/ionic-team/ionic-native-google-maps/blob/master/documents/environment/README.md

Disabling Vaadin Errorindicator

I'm using validators on several TextFields, which causes to show a popup next to them. As far as I found out, this is realted to the Vaadin errorindicator.
I now want to disable this popup-message, because it creates unhandy behaviour when it comes to using the application on tablets, e.g. an iPad. I already created a separate label showing the error-message and set the errorindicator to hide using CSS as follows:
.v-errorindicator { display: none; }
The pop up keeps showing anyway. Does anyone know how to disable the popup irrevocable?
Thanks, Hendrik
You should cover the validators with try-catch blocks, in the catch block you can remove the errorstyle with yourTextfield.removeStyleName("v-textfield-error"), also the pop-up won't show.

Callback on widget attached and all images are loaded

I want execute some logic after the moment when widget is attached and all images inside this widget are loaded. This widget show a block of html prepared in CMS (so the number of images is dynamic).
What have I tried:
override Widget.onAttach() or Widget.onLoad(). Unfortunately both of them are executed before the moment when all images are loaded.
I found gwt-image-loader library which can add a callback per image. I wan't use it due to dynamic nature of the content.
In JavaScript there is this option which works great:
$('selector').waitForImages(function() {
// do some logic
});
Maybe I missed some GWT way to do the same thing?
You can try GWT's Image.addLoadHandler()
onLoad and onAttach methods are there to inform you that the <img> tag is attached to your document and that is it. This helps in setting image attributes such as height, width, position and so on. What you are asking is, after the image is attached to document you want an handler after the image is rendered. This is not possible with the current version of GWT as per my experience. Further rendering of image depends on the network you are in, the server you are connected and so on. So instead of wanting for a render callback, try to do the work in onLoad or onAttach methods or add a loadHandler for the same

Google Maps APi for iOS: UIActivityView on custom info window

I'm trying to put a spinner inside a custom info window that appears when the user presses a marker. I have a custom view for the window that has lots of subviews that show up fine. But when I try to add a UIActivityView or an animated PNG sequence, that doesn't show. Has anyone else experienced this?
The documentation on the mapView:markerInfoWindow: method says:
If you change this view after this method is called, those changes
will not necessarily be reflected in the rendered version.
It seems likely that the Google map is not showing the actual UIView you return, but a screenshot of it taken when the info window is returned by the delegate.
As mentioned in this answer, this is made explicit in the Android documentation - it seems likely that the Android and iOS SDKs work similarly.
If you've changed the view I'm not sure if there is a way to force the SDK to take a new screenshot of it. Possibly you could try setting the map's selected marker to nil and then back to your marker, to see if it then calls mapView:markerInfoWindow: again - although it might also re-centre the marker on the map when you do that. It also likely wouldn't be very efficient.
You can call mapView:markerInfoWindow: then inside the method you can create a UIView which you can add different controls on that UIView including the spinner. You can also specify on which location you would like to put the defined control.

Setting values to a form which is not rendered yet

I have a form within a tab. It is second tab so it doesn't render until you open it.
I have tried to submit data to the form with Ext.getCmp('DetailsForm').getForm().setValues(selections[0]); but it says that it is not a function. Probably because it is not rendered yet. What I have to do?
Set the deferredRender config property of your Ext.tab.Panel to deferredRender: false
That will force the rendering of all tabs instead of just active ones. Now the form will be there. As mentioned before I recommend you also to use myTabPanelRef.down('from').getForm().setValues(selections[0]); to access the form.
subscribe to the second tabs show event OR painted event
then look for the form preferably by using .down() method as this wont look with in the entire DOM.
set the values
Use render event of form panel.
Your code will be something like this -
Ext.getCmp('DetailsForm').on('render', function(){
this.getForm().load(selections[0]);
});