0

When a jquery-mobile popup(Dialog) is opened, when clicking a command link inside the dialog, ajax request will update the dialog with the same popup markup with different header and content.

$(PrimeFaces.escapeClientId(id)).replaceWith(content);

id is popupDialog, and content is

<div id="popupDialog" 
     data-role="popup" 
     data-overlay-theme="b" 
     data-theme="b" 
     data-dismissible="false">
....
</div>

But got error.

Uncaught NotFoundError: Failed to execute 'replaceChild' on 'Node': The node to be replaced is not a child of this node. 

It is a normal ajax update DOM element. What might be the cause? Thanks for any insight.

wittakarn
  • 3,124
  • 1
  • 18
  • 31
eastwater
  • 4,624
  • 9
  • 49
  • 118
  • Perhaps go a bit simpler. In your popup use spans to wrap the text you want to change, and then do $("#somespan").text("new text") ? – Raymond Camden Oct 02 '14 at 10:34
  • there is no inner wrapper around popup header and content. Need to update two elements in this way. Does Primefaces ajax support replacing children with children? – eastwater Oct 02 '14 at 14:43

0 Answers0