-
1. Re: Modal Popup and Keyboard Control
bek816 Jul 10, 2012 12:05 PM (in response to bek816)Still looking for some help on this one. Does anyone in the community have any ideas? Thanks.
-
2. Re: Modal Popup and Keyboard Control
roet42 Jul 10, 2012 4:11 PM (in response to bek816)1 of 1 people found this helpfulI had the same problem. If you look the close button on the example page is just an image with on onclick that closes the panel using its javascript api. All I did was use the openjs shortcut library to add an listener for the esc keypress to close the form.
For example in javscript on the page :
shortcut.add('esc',function() {closeImg.click();});
Where closeImg is the id of the graphic image control with the close icon.
The library I am using is at : http://www.openjs.com/scripts/events/keyboard_shortcuts/
You can use one of many shortcut libraries, or one of the jquery plugins that accomplish the same effect.
You can also use rich:hotkey or simply use the accesskey attribute depending on what html elements you configure to trigger closing the panel.
-
3. Re: Modal Popup and Keyboard Control
sivaprasad9394 Jul 11, 2012 1:07 AM (in response to bek816)1 of 1 people found this helpfulTry look on the below code and change ur close button in the right top corner OR add close button manually to close the pop up.
<rich:modalPanel id="imgPopUp" autosized="true" zindex="2000" width="650"> <f:facet name="header">
<h:panelGroup>
<h:outputText value="Image Panel"></h:outputText>
</h:panelGroup>
</f:facet>
<f:facet name="controls">
<h:panelGroup>
<h:graphicImage value="/img/close.png" id="hidelinkimage" />
<rich:componentControl for="imgPopUp" attachTo="hidelinkimage"
operation="hide" event="onclick" />
</h:panelGroup>
</f:facet> <h:panelGrid columns="2" border="0" width="650">
.............Ur details........
</h:panelGrid> </rich:modalPanel>
Thanks,
Siva