ListSelect does not single select mode in vaadin 8, what is the replacement? - vaadin8

We have a vaadin 6 application that has a ListSelect which changes between single select and multiselect mode. Now we are converting to vaadin 8, the setMultiSelect method is not there any more. Seems that ListSelect is always multiselect mode in vaadin 8. Is that true? Any method to make ListSelect single selection?

The component you are looking for in Vaadin 8 is probably NativeSelect.

Related

Vaadin UI done or documentReady event

Is there any way to detect all Vaadin components, html, elements are loaded and rendered in UI. For devMode in browser console
... com.vaadin.client.communication.MessageHandler
INFO: Referenced paintables: ...
as info.
After this i want to push something to UI.
Vaadin version: 8.0.5, spring boot 1.5.2
There are two ways in Vaadin to update your UI asynchronously: polling and push. Basically, you initialize your application with the basic data and start the background threads that calculate additional data. Once calculation is done, you can update components accordingly and Vaadin will pull from client periodically (if you use polling) or push to client (if you use server push). Don't forget to wrap your calls with UI.access method when accessing components from the background thread.
Dirty workaround:
If you have a focusable component on your page you can abuse .addFocusListener() and .focus(). The focus event only fires after the focus was placed on the component and that's after the page is rendered.
Then off course set a flag that your event handler does not re-execute if the focus returns to the same component.

Features of Dependency Properties in windows 8 Store App

Hello every one i am not sure about the Features of Dependency Properties in windows 8 Store App. For this i read this article but i can't clear. Can any one help me to clear me what is not the features Dependency Properties in windows 8 Store App in this list Thanks.
Dependency properties provide facilities to compute a given property's value based on several inputs.
Dependency properties can notify about changes in their values.
A callback handler can be assigned, so that whenever the property is changed, the callback handler will be invoked.
Dependency properties can have a default value through metadata.
None of the above.
Article
https://learn.microsoft.com/en-us/windows/uwp/xaml-platform/dependency-properties-overview
All the features from 1 to 4 apply to Windows 8 Store app.
Besides, I think you'd better read this article written by #Jeremey Likness: Dependency Properties in XAML for Windows 8 Apps .

Dynamic layout for mobile visitors on ASP.NET MVC 3?

I want to dynamically change the layout, based on whether the user is accessing the site from a mobile device or not. I have a few questions on the subject.
I would like to change the layout once it's determined, but before the view is rendered. That is, is there some hook I can use where I can change layout.cshtml to layout.mobile.cshtml "recursively" for any nested layouts that there might be.
Is overriding RazorViewEngine's CreateView method enough? It takes a masterPath parameter, so maybe I could implement a custom RazorViewEngine and override this method, right?
The second question would be regarding mobile browser detection. I don't really care that much about specific devices. I just want to differentiate desktop from mobile. Is something like WURFL a necessity in this case?
Is checking something like Request.Browser.ScreenPixelsWidth and ScreenPixelsHeigth ridiculous? (since most I'd be changing would be using or not jQuery.mobile and it's data-attributes.
This functionality is built-into ASP.NET MVC 4 so you get it out-of-the-box.
Scott Hansleman blogged about how you could achieve the same in ASP.NET MVC 3 and be ready for the upgrade because the NuGet he suggested is spec-compatible with ASP.NET MVC 4.
If you can, use ASP MVC 4 as Darin Dimitrov pointed out. It supports this out of the box.
If you are stuck on MVC 3, here's how we do it in our product:
1) Install WURFL
2) Implement an HttpCapabilitiesProvider which calls WURFL and resolves device capabilities; stuff resolved caps into the result. Be sure to add a property called isMobileBrowser (wurfl exposes this)
3) Tell .NET to use your capabilities provider instead of default HttpCapabilitiesBase.BrowserCapabilitiesProvider = new YourBrowserCapabilitiesProvider(_wurflManager);
4) Create a CustomViewEngine (inherit RazorViewEngine). Override FindPartialView & FindView. These should look at controllerContext.RequestContext.HttpContext.Request.Browser.Capabilities["isMobileBrowser"] and map to appropriate name, eg myView.cshtml.mobile. You need to resolve both viewName and masterName.
4.1) Still in CustomViewEngine's FindPartialView & FindView, search search ~/Views/{0}/{1} and ~/Views/Shared/{0}/{1} where {0} is the controller (controllerContext.RouteData.GetRequiredString("controller")) and {1} is your mapped view name
4.2) Return return new ViewEngineResult(CreateView(controllerContext, viewPath, masterPath), this);

Run a command programmatically with Primefaces

I want to know if it is possible to run a command programmatically using Primefaces, and in some cases, display a growl. Specifically, I want to alert the user if there is something new in a table in a DB.
I think there are a Primefaces component to execute a command each 5 minutes, for example, but i can't find it.
Best regards.
You can use the p:poll of primefaces
(the interval is being set in seconds)
here an example:
Ajax Poll

When to initialize the layout & theme specific details in Zend Framework?

I am new to ZF, so my question might look newbish and I apologize in advance if its already answered.
The sequence in which ZF execute a complete process is
1. routeStartup
2. process route
3. routeShutdown
4. dispatchLoopStartup
5. preDispatch
6. dispatch process starts
7. controller's init method
8. controller's helper's preDispatch
9. action's preDispatch
10. action
11. action's postDispatch
12. controller's helper's postDispatch
13. postDispatch
14. dispatchLoopShutdown
now there are multiple places where we can initiate + config layout & theme details. We can do it on stage 5, 7, 8 and 9. What stage is the best for this purpose.
The application will be using AJAX so if I load the layout details on stage 5, there are lots of chances that later I will be removing the layout and sending only XML response.
It's usually best to configure your layout using the application resource plugin during bootstrap.
To disable layout whilst responding to XHR, use the AjaxContext action helper.
Edit: At what point do you know which theme you will use? If it's early enough and the required parameters are available, you could implement this using a bootstrap _init* method or custom layout app resource plugin.
Otherwise, I'd implement and register a controller action helper, setting the theme in its preDispatch override. Using the second method also gives you access to the request, therefore allowing you to make a decision based on the request method whether you bother with the layout or not. In fact, this might be a good candidate for a custom override of the AjaxContext helper itself.
You can initiate and config layout before step 1 during Bootstrap - that's the best place :)

Resources