You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by GitBox <gi...@apache.org> on 2018/02/28 10:26:30 UTC

[GitHub] lofwyr14 commented on a change in pull request #2: Tobago 1589

lofwyr14 commented on a change in pull request #2: Tobago 1589
URL: https://github.com/apache/myfaces-tobago/pull/2#discussion_r171195972
 
 

 ##########
 File path: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
 ##########
 @@ -132,13 +139,86 @@ public void decode(final FacesContext facesContext, final UIComponent component)
     }
     RenderUtils.decodedStateOfTreeData(facesContext, sheet);
 
+    decodeSheetAction(facesContext, sheet);
+    decodeColumnAction(facesContext, columns);
 /* this will be done by the javax.faces.component.UIData.processDecodes() because these are facets.
     for (UIComponent facet : sheet.getFacets().values()) {
       facet.decode(facesContext);
     }
 */
   }
 
+  private void decodeColumnAction(final FacesContext facesContext, List<AbstractUIColumnBase> columns) {
+    for (final AbstractUIColumnBase column : columns) {
+      final boolean sortable = ComponentUtils.getBooleanAttribute(column, Attributes.sortable);
+      if (sortable) {
+        final String sourceId = facesContext.getExternalContext().getRequestParameterMap().get("javax.faces.source");
+        final String columnId = column.getClientId(facesContext);
+        final String sorterId = columnId + "_" + UISheet.SORTER_ID;
+
+        if (sorterId.equals(sourceId)) {
+          final UIData data = (UIData) column.getParent();
+          data.queueEvent(new SortActionEvent(data, column));
+        }
+      }
+    }
+  }
+
+
+  private void decodeSheetAction(final FacesContext facesContext, UISheet component) {
+    final String sourceId = facesContext.getExternalContext().getRequestParameterMap().get("javax.faces.source");
+
+    final String clientId = component.getClientId(facesContext);
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("sourceId = '{}'", sourceId);
+      LOG.debug("clientId = '{}'", clientId);
+    }
+
+    final String sheetClientIdWithAction = clientId + UINamingContainer.getSeparatorChar(facesContext) + SUFFIX_PAGE_ACTION;
 
 Review comment:
   line width > 120 (please run checkstyle)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services