-
1. Re: Programmatically set onclick() at HtmlMenuItem
elf Sep 8, 2009 9:56 AM (in response to asiandub)mi1.setOncomplete("javascript:Richfaces.showModalPanel('myPanel').show()");
works for me -
2. Re: Programmatically set onclick() at HtmlMenuItem
elf Sep 8, 2009 10:00 AM (in response to asiandub)sorry, just
mi1.setOncomplete("javascript:Richfaces.showModalPanel('myPanel', {left:'auto', top:'auto'})");
-
3. Re: Programmatically set onclick() at HtmlMenuItem
asiandub Sep 8, 2009 10:35 AM (in response to asiandub)thanks a million, mate :-)
btw: calling functions from richface's javascript API seems like a huge try and error to me. i didn't manage to find any documentation...
is there a place where i can learn about calls like this?#{rich:component('myPanel')}... javascript:Richfaces.showModalPanel('myPanel')...
cheers,
jan -
4. Re: Programmatically set onclick() at HtmlMenuItem
nbelaevski Sep 8, 2009 8:46 PM (in response to asiandub)Jan,
It's really very easy. The first step is to check documentation for JS API that the particular component provides (example for rich:modalPanel):
The second step is just calling the necessary function using rich:component function, format is the following:#{rich:component('componentId_or_clientId')}.methodName(methodArg1, methodArg2, ...)
Treat the whole #{rich:component()} part as a shortcut to the expression that evaluates to the instance of JavaScript object representing this component on the client.
BTW, rich:componentControl provides just another way for usage of components' JS API.
This:Richfaces.showModalPanel('myPanel')
is the function that was developed initially to provide control for modal panel; then, with the migration to JSF 1.2 and JSP 2.1, rich:* functions were added and we got just another way of controlling this. -
5. Re: Programmatically set onclick() at HtmlMenuItem
asiandub Sep 9, 2009 2:30 AM (in response to asiandub)Hello Nick,
thanks for your kind and fast respond :-)
I was aware of the Javascript-API on the component itself, but I did not manage to find any documentation / API description like the one you used:#{rich:component('componentId_or_clientId')}.methodName(methodArg1, methodArg2, ...)
It seems like you copied the above code sample somewhere from - and i'm wondering, if this is some sort of public documentation... Maybe there are other commands, like rich:xyz()? I have no clue..
Also - and the initial reason behind my question:Richfaces.showModalPanel()
I'm sure there must be some way to get information about Richfaces.xyz... I just don't know where to look for it.
If someone could just point me in the right direction?
Many thanks,
Jan -
6. Re: Programmatically set onclick() at HtmlMenuItem
nbelaevski Sep 9, 2009 5:36 AM (in response to asiandub)Jan,
The example on the screenshot is taken from dev guide. http://docs.jboss.org/richfaces/latest_3_3_X/en/tlddoc/ - check function summary section.
This:Richfaces.showModalPanel()
should be present in documentation for rich:modalPanel component.