Skip to content

Commit

Permalink
add a trigger to rerender PrimeFaces DeferredWidgets like gmap #205
Browse files Browse the repository at this point in the history
  • Loading branch information
geopossachs authored and stephanrauh committed Aug 1, 2019
1 parent 9729f9d commit c363d6c
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;

Expand Down Expand Up @@ -187,8 +189,10 @@ public void encodeBegin(FacesContext context, UIComponent component) throws IOEx
}

writer.endElement("div");
Map<String, String> eventHandlers = new HashMap<String, String>();
eventHandlers.put("shown","PrimeFaces.invokeDeferredRenders('" + clientId + "_content')");
new AJAXRenderer().generateBootsFacesAJAXAndJavaScriptForJQuery(context, component, writer,
"#" + clientId + " > li > a[data-toggle=\"tab\"]", null);
"#" + clientId + " > li > a[data-toggle=\"tab\"]", eventHandlers);
Tooltip.activateTooltips(context, tabView);
}

Expand Down Expand Up @@ -356,8 +360,9 @@ private List<UIComponent> getTabs(TabView tabView) {
*/
private static void encodeTabContentPanes(final FacesContext context, final ResponseWriter writer,
final TabView tabView, final int currentlyActiveIndex, final List<UIComponent> tabs) throws IOException {
writer.startElement("div", tabView);
String classes = "tab-content";
writer.startElement("div", tabView);
writer.writeAttribute("id", tabView.getClientId() + "_content", "id");
String classes = "tab-content ui-hidden-container";
if (tabView.getContentClass() != null) {
classes += " ";
classes += tabView.getContentClass();
Expand Down

0 comments on commit c363d6c

Please sign in to comment.