-
1. Re: rich:hotKey with rich:datascroller
nbelaevski Nov 5, 2008 10:58 PM (in response to supernovasoftware.com)Hi,
There's no JS API, so I've created an issue to implement it: https://jira.jboss.org/jira/browse/RF-4870
The following can serve as a workaround:Event.fire(#{rich:element('scrollerId')}, 'rich:datascroller:onscroll', {'page': '7'});
You can use: 'first', 'fastrewind','previous','next','fastforward','last' or numeric value as page. -
2. Re: rich:hotKey with rich:datascroller
martind1111 Nov 6, 2008 12:24 PM (in response to supernovasoftware.com)I have tried the recommended workaround:
Event.fire(#{rich:element('scrollerId')}, 'rich:datascroller:onscroll', {'page': '7'});
I can see the scroller page is changed internally (in this case to page 7). However, the page is not refreshed and still display the original page. I have to reload the current page for the change to be visible. There is no reRender attribute for the rich:hotKey. I have tried to add a a4j:jsFunction and invoke it from the rich:hotKey, but even though I specify the data scroller id in the reRender property, the page isn't refreshed. Also, I can't put a #{...} expression in the action property of a4j:jsFunction. The application (running inside Tomcat) throws the following exception:
#{..} is not allowed in template text -
3. Re: rich:hotKey with rich:datascroller
supernovasoftware.com Nov 6, 2008 12:36 PM (in response to supernovasoftware.com)My code below works perfectly for me.
Note: if you want to use multiple keys i.e. ctrl+alt+left, this must be in alphabetical order as alt+ctrl+left
See http://code.google.com/p/js-hotkeys/wiki/about<rich:datascroller id="pipeSearchDatascroller" binding="#{datascrollerUI.datascroller}" for="pipeSearchDataTable" reRender="pipeSearchDataTotals" status="commonstatus0"/> <rich:hotKey key="ctrl+left" handler="Event.fire(#{rich:element('pipeSearchDatascroller')}, 'rich:datascroller:onscroll', {'page': 'previous'});;return false;"/> <rich:hotKey key="alt+ctrl+left" handler="Event.fire(#{rich:element('pipeSearchDatascroller')}, 'rich:datascroller:onscroll', {'page': 'first'});;return false;"/> <rich:hotKey key="ctrl+right" handler="Event.fire(#{rich:element('pipeSearchDatascroller')}, 'rich:datascroller:onscroll', {'page': 'next'});;return false;"/> <rich:hotKey key="alt+ctrl+right" handler="Event.fire(#{rich:element('pipeSearchDatascroller')}, 'rich:datascroller:onscroll', {'page': 'last'});;return false;"/>
-
4. Re: rich:hotKey with rich:datascroller
supernovasoftware.com Nov 6, 2008 12:42 PM (in response to supernovasoftware.com)Maybe this should be built in with some defaults.
<rich:datascroller hotKeyNav="true"/>
Would do the equivalent of the 4 a4j:hotKey I assigned.
You could override the default by<rich:datascroller hotKeyNav="true" firstKey="ctrl+down" lastKey="ctrl+up"/>
I am going to do this with a facelets template for now, but this would be nice out of the box.