[
https://issues.apache.org/jira/browse/MYFACES-2640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12864160#action_12864160
]
Werner Punz commented on MYFACES-2640:
--------------------------------------
As I said before the issue you run into is a problem with jquery, in case of a
dialog it rips out your component moves it to the top of the dom tree to have
the positioning working via css: position:absolute on all browsers (position
fixed which would be the real way to do this does not work on ie6)
and then decorates it. Alll you can do is to fix all this manually.
I gave you just a proof of concept, what you can do is to set a listener
onevent which removes the decoration.
jsf.ajax.request(.... onevent:processDialogHandling)
data.status has the status
and
eventData.responseCode has the responseCode
in Your case you could use the complete method for instance for the cleanup of
the elements jquery puts in.
var processDialogHandling = function processEvent(data) {
if (data.status == "complete" && data.responseCode>= 200 && data.responseCode
< 300) {
$('#myDialog').dialog('destroy');$('#myDialog').remove();
}
}
as for your autoOpen stuff, this is also a matter of providing the needed
infrastructure, you have to
save the open status before the update and then either open your dialog or
leave it unopened.
All this is heavy framework specific which means what you do here will only
work in jquery (dojo for instance
does all this quite differently although the dialog mechanism works similar)
For instance you can use data.status == "success" for the open handling here in
the processEvent method.
As for the second issue, I will look into it.
> (JSF.js) Ajax Render component problem, replace with whole fragment not one
> element.
> ------------------------------------------------------------------------------------
>
> Key: MYFACES-2640
> URL: https://issues.apache.org/jira/browse/MYFACES-2640
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Affects Versions: 2.0.0-beta-3
> Environment: tomcat 6.0.20 java (mac os x )
> Reporter: Mark Li
> Fix For: 2.0.1-SNAPSHOT
>
> Original Estimate: 4h
> Remaining Estimate: 4h
>
> after ajax submit, jsf.js will re-render some element depending on
> jsf.ajax.request({render:" some elements "});
> but this js code will cause some problem.
> jsf.js:
> myfaces._impl._util._Utils.replaceHtmlItem = function (request, context,
> itemIdToReplace, newTag, form) {
> ......
> var fragment = range.createContextualFragment(newTag);
> evalNode = item.parentNode.replaceChild(fragment, item)
> .....
> }
> sometime fragment will has more than one childNodes, or the childNode not has
> clientId, but the childNode of childNode has clientId.
> this will cause html unstable.
> Please fix it.
> this is my suggestion:
> myfaces._impl._util._Utils.replaceHtmlItem = function (request, context,
> itemIdToReplace, newTag, form) {
> .............
> Orginal:
> var fragment = range.createContextualFragment(newTag);
> evalNode = item.parentNode.replaceChild(fragment, item)
> fix:
> var fragment = range.createContextualFragment(newTag);
> var replaceItem =
> myfaces._impl._util._Utils.findHtmlItemFromFragment(fragment,
> itemIdToReplace);
> if(replaceItem == null)replaceItem = fragment;
> evalNode = item.parentNode.replaceChild(replaceItem, item)
> ..................
> }
> myfaces._impl._util._Utils.findHtmlItemFromFragment = function(fragment,
> itemId){
> if(fragment.childNodes == null)
> return null;
> for(var i = 0; i < fragment.childNodes.length ; i++ ){
> var c = fragment.childNodes[i];
> if(c.id == itemId)
> return c;
> }
> for(var i = 0; i < fragment.childNodes.length ; i++ ){
> var c = fragment.childNodes[i];
> var item =
> myfaces._impl._util._Utils.findHtmlItemFromFragment(c, itemId);
> if(item != null)
> return item;
> }
> return null;
> };
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.