-
1. Re: When ModalPanel opens in iFrame, scroll bar moves up
ilya_shaikovsky Apr 9, 2010 3:16 AM (in response to apanag)show the code of the control which opens the panel.
-
2. Re: When ModalPanel opens in iFrame, scroll bar moves up
apanag Apr 9, 2010 5:09 AM (in response to ilya_shaikovsky)<h:outputLink id="myOutputLink" > <h:outputText value="Show Modal Panel" /> <rich:componentControl for="myModalPanel" attachTo="myOutputLink" operation="show" event="onclick" disableDefault="true" /> </h:outputLink>
thanks
-
3. Re: When ModalPanel opens in iFrame, scroll bar moves up
ilya_shaikovsky Apr 9, 2010 9:33 AM (in response to apanag)this works for me just as you showing.
<h:outputLink value="#" id="link"> Show Modal Panel <rich:componentControl for="panel" attachTo="link" operation="show" event="onclick"/> </h:outputLink>
but this
<h:outputLink value="#" id="link"> Show Modal Panel <rich:componentControl for="panel" attachTo="link" operation="show" event="onclick" disableDefault="true"/> </h:outputLink>
works fine.
-
4. Re: When ModalPanel opens in iFrame, scroll bar moves up
apanag Apr 12, 2010 4:48 AM (in response to ilya_shaikovsky)It's clear that the
disableDefault
makes the difference. But I already use it.Have you tried it within an iframe?
It is then the this.lastOnfocus(); command in show method of modalPanel.js that moves the scrollbar to the top.
-
5. Re: When ModalPanel opens in iFrame, scroll bar moves up
nbelaevski Apr 12, 2010 6:34 AM (in response to apanag)Andreas,
If you disable lastOnFocus/firstOnFocus, then you will be able to set focus to and modify controls masked by tabPanel via focus-switching (e.g. TAB) key.
-
6. Re: When ModalPanel opens in iFrame, scroll bar moves up
apanag Apr 12, 2010 8:19 AM (in response to nbelaevski)great. thanks, I 've studied the case you mention.
In the video I 've uploaded in this thread, the this.lastOnfocus() makes the scrollbar move up.
This happens because the LastHref button is higher on the page (even though it is hidden). The focus() command forces the scrollbar go up in order to display the button.
I think this is undesired behaviour, not only in my case. Do you agree?
I suggest moving the LastHref button in the ContentTable.
What do you think? Are there any conflicts by this move that I am not aware of?
If not, I would be happy to change and test the code I mention and then commit it.
In order to quickly test, I have already added an additional button in the modalpanel's content and replaced the lastOnfocus command in modalPanel.js with $("my_focus_button").focus();
It worked fine.
-
7. Re: When ModalPanel opens in iFrame, scroll bar moves up
nbelaevski Apr 13, 2010 7:14 AM (in response to apanag)Yes, it should be working fine as the last element of contentTable or contentDiv. Here is the JIRA issue I've created for the problem: https://jira.jboss.org/jira/browse/RF-8590
-
8. Re: When ModalPanel opens in iFrame, scroll bar moves up
mechtatel Feb 23, 2011 5:28 PM (in response to nbelaevski)Hi,
I have the same problem, so I modified the source moving:
<div class="rich-mpnl-mask-div rich-mpnl-mask-div-transparent" id="#{clientId}CursorDiv" style="z-index: -200;">
<button class="rich-mpnl-button" id="#{clientId}LastHref"></button>
</div>
as last element of contentDiv. And works well. But after trying it in Internet Explorer 8 I received JS error apointing to modalPanel.js
this is the JS error:
Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus
How can this be solved?