closeOnEscape in Dialog FrameWork PF - primefaces

In a <p:dialog> there is an attribute called closeOnEscape="true" which allow to close the dialog by pressing the esc key.
I didn't find any similar thing in Dialog FrameWork attributes, according to primefaces documentation.
Is there a way to achieve this using DF ?
Thanks for help.

Look at the Primefaces hotkey component: http://www.primefaces.org/showcase/ui/misc/hotkey.xhtml
This component is a very convenient and helpful way to auto generate javascript which listens for "onkeyup" events.
<p:hotkey bind="esc" handler="PF('myDialogName').hide();" />

Related

Action onclick of bar of nvd3-multi-bar-horizontal Polymer component

I'm using nvd3-multi-bar-horizontal Polymer tag element for Graph plotting.
I could not find any option or attribute to add action like onclick on a bar.
Can anyone suggest any option? I know that it can be done using native nvd3 library. but as its a Polymer project, I have to use this Polymer component.
I've updated nvd3-elements to bind all NVD3 events. Please use v0.21.0. You could create listeners for all NVD3 events. Please check NVD3 documentation for events list of each chart.

CompositeComponent Primefaces Dialog appendTo ="#(body)" not working

I'm using PF 5.1.5 and made some composite components with dialogs which all should be modal and appended to body (so the dialog is really modal). This works when I use dialogs in plain pages, but not if I use them in composite components. I think because the #(body) tag references to the composite component itself? Anyone got a solution?

Remove widgets from p:dashboard via dragging out

I'd like to add support to removing the widgets from p:dashboard via dragging the panel out of dashboard, such as in WordPress admin panel.
I've found out the examples of dragging the widgets between 2 dashboards, but in my case I need to have callback when the element is dragged out of dashboard, no matter where. The widget would be than removed. However, I couldn't find any example for such behaviour.
What components/tools to use to implement such functionality? I'm using PrimeFaces 3.4.
Use draggable component with dashboard keyword;
<p:draggable for="widget" dashboard=":dbForm:dashboard"/>
And check this solutions on forum page of primefaces: Dashboard Drag and Drop
Hope it'll help you.
Good Luck!

Is it possible to bind a command directly to an app bar button?

I'm creating an MVVM style application for windows phone. With a regular button, you can bind anything that inherits from ICommand to the Command property on a xaml button, like so:
The command property does not seem to exist for buttons in the phones app bar ("shell:ApplicationBarIconButton"). Has anyone figured out how to bind their click event to a Command yet?
It's not possible from the SDK directly, but the AppBarUtils library ( http://nuget.org/packages/AppBarUtils or http://appbarutils.codeplex.com/ ) works nicely.
The codeplex site has example code for different scenarios such as reusing or switching the app bar in a page.
I didn't understand how to use the chosen solution so I went for another one. You just add the library via nuget. It's BindableApplicationBar
Then you just add the following instead of your normal application bar.
<bindableApplicationBar:Bindable.ApplicationBar>
<bindableApplicationBar:BindableApplicationBar >
<bindableApplicationBar:BindableApplicationBarButton
Text="Refresh"
IconUri="/Images/refresh.png"
Command="{Binding RefreshCommand}" />
</bindableApplicationBar:BindableApplicationBar>
It's just a shame that intellisense doesn't reconize the tags. Otherwise, it works like a charm.

setFocus in Flex

I'm Using following code in flex4 mxml That works fine.
<mx:Button label="Set focus to Username"
click="focusManager.setFocus(username);" />
How to use the same in Action script I mean creation complete event of an application without using button.
That is I have login panel in application While page loads the
username field should focused having cursor in it.
Can any one help me?
The issue is that within your application the TextInput has focus, but within the HTML page your Flex application does not. So basically the only extra step you need is to give the Flex app focus. There's only one way to achieve this: through JavaScript. And you should do it after the application was loaded.
The guys at Farrata wrote a very good example on how to do this, so I'm just going to point you there: http://flexblog.faratasystems.com/2011/12/15/setting-focus-in-flex-components