You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2014/09/04 18:07:38 UTC
svn commit: r1622508 [1/3] - in /myfaces/tobago/trunk:
tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/
tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/
tobago-example/ tobago-example/tobago-example-de...
Author: lofwyr
Date: Thu Sep 4 16:07:37 2014
New Revision: 1622508
URL: http://svn.apache.org/r1622508
Log:
TOBAGO-939: RenderedPartially support for sheet and tabGroup
Added:
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tab.js
- copied, changed from r1622174, myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
Modified:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasRenderedPartially.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/DataAttributes.java
myfaces/tobago/trunk/tobago-example/pom.xml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/02-sheet/sheet.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/04-tab/01-ajax/tab-ajax.xhtml
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/pom.xml
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasRenderedPartially.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasRenderedPartially.java?rev=1622508&r1=1622507&r2=1622508&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasRenderedPartially.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/declaration/HasRenderedPartially.java Thu Sep 4 16:07:37 2014
@@ -47,9 +47,12 @@ public interface HasRenderedPartially {
* If a literal is specified: to use more than one identifier the identifiers must be space delimited.
* </p>
* <p>
- * Using this in a UISheet component this list indicates components to update when calling
+ * Using this in a UISheet or UITabGroup component this list indicates components to update when calling
* internal AJAX requests like sort or paging commands.
- * Don't forget to add the sheets id in that case, if needed.
+ * Don't forget to add the sheet-id or tagGroup-id in that case, if needed.
+ * </p>
+ * <p>
+ * You can also use @this for the component itself.
* </p>
*/
@TagAttribute
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/DataAttributes.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/DataAttributes.java?rev=1622508&r1=1622507&r2=1622508&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/DataAttributes.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/DataAttributes.java Thu Sep 4 16:07:37 2014
@@ -138,7 +138,7 @@ public final class DataAttributes {
@Deprecated
public static final String MONTHNAMES = MONTH_NAMES;
- public static final String PARTIALLY = "data-tobago-partially";
+ public static final String PARTIAL_IDS = "data-tobago-partial-ids";
public static final String PARTIAL_ACTION = "data-tobago-partial-action";
Modified: myfaces/tobago/trunk/tobago-example/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/pom.xml?rev=1622508&r1=1622507&r2=1622508&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/pom.xml (original)
+++ myfaces/tobago/trunk/tobago-example/pom.xml Thu Sep 4 16:07:37 2014
@@ -47,13 +47,11 @@
</webApp>
-->
<!-- use this to change the port-->
-<!--
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>7080</port>
</connector>
</connectors>
--->
</configuration>
</plugin>
<plugin>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml?rev=1622508&r1=1622507&r2=1622508&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml Thu Sep 4 16:07:37 2014
@@ -26,8 +26,8 @@
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
- <!--<param-value>Development</param-value>-->
- <param-value>Production</param-value>
+ <param-value>Development</param-value>
+ <!--<param-value>Production</param-value>-->
</context-param>
<context-param>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/02-sheet/sheet.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/02-sheet/sheet.xhtml?rev=1622508&r1=1622507&r2=1622508&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/02-sheet/sheet.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/02-sheet/sheet.xhtml Thu Sep 4 16:07:37 2014
@@ -140,7 +140,7 @@
stateChangeListener="#{demo.stateChangeListener}"
sortActionListener="#{overviewController.sheetSorter}"
selectable="#{overviewController.sheetConfig.selectable}"
- renderedPartially=":page:header:headerInfo sheet">
+ renderedPartially="@this :page:header:headerInfo">
<!--
<f:facet name="reload">
<tc:reload frequency="2000" />
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/04-tab/01-ajax/tab-ajax.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/04-tab/01-ajax/tab-ajax.xhtml?rev=1622508&r1=1622507&r2=1622508&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/04-tab/01-ajax/tab-ajax.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/04-tab/01-ajax/tab-ajax.xhtml Thu Sep 4 16:07:37 2014
@@ -29,7 +29,8 @@
<tc:gridLayout rows="*;auto"/>
</f:facet>
- <tc:tabGroup id="tabMarsOuterForm2" switchType="reloadTab" selectedIndex="#{demo.tabState2}" immediate="true">
+ <tc:tabGroup id="tabMarsOuterForm2" switchType="reloadTab" selectedIndex="#{demo.tabState2}" immediate="true"
+ renderedPartially="@this :page:header:headerInfo">
<tc:tabChangeListener type="org.apache.myfaces.tobago.example.demo.actionlistener.SimpleTabChangeListener"
binding="#{demo.tabChangeListener}"/>
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/pom.xml?rev=1622508&r1=1622507&r2=1622508&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/pom.xml (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/pom.xml Thu Sep 4 16:07:37 2014
@@ -60,7 +60,7 @@
<configuration>
<target>
<concat destfile="${project.build.directory}/javascript-min/standard/script/tobago.min.js" force="no">
- <filelist dir="${basedir}/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script" files="tobago.js,tobago-calendar.js,tobago-console.js,tobago-converter.js,tobago-in.js,tobago-menu.js,tobago-overlay.js,tobago-popup.js,tobago-sheet.js,tobago-suggest.js,tobago-tree.js,tobago-utils.js" />
+ <filelist dir="${basedir}/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script" files="tobago.js,tobago-calendar.js,tobago-console.js,tobago-converter.js,tobago-in.js,tobago-menu.js,tobago-overlay.js,tobago-popup.js,tobago-sheet.js,tobago-suggest.js,tobago-tab.js,tobago-tree.js,tobago-utils.js" />
</concat>
<concat destfile="${project.build.directory}/javascript-min/msie_6_0/script/tobago.min.js" force="no">
<filelist dir="${basedir}/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/msie_6_0/script" files="tobago.js" />
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java?rev=1622508&r1=1622507&r2=1622508&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java Thu Sep 4 16:07:37 2014
@@ -162,7 +162,7 @@ public class SheetRenderer extends Layou
}
final String[] clientIds = ComponentUtils.evaluateClientIds(facesContext, sheet, sheet.getRenderedPartially());
if (clientIds.length > 0) {
- writer.writeAttribute(DataAttributes.PARTIALLY, JsonUtils.encode(clientIds), true);
+ writer.writeAttribute(DataAttributes.PARTIAL_IDS, JsonUtils.encode(clientIds), true);
}
writer.writeAttribute(DataAttributes.SELECTION_MODE, sheet.getSelectable(), false);
writer.writeAttribute(DataAttributes.FIRST, Integer.toString(sheet.getFirst()), false);
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java?rev=1622508&r1=1622507&r2=1622508&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java Thu Sep 4 16:07:37 2014
@@ -39,9 +39,11 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Position;
import org.apache.myfaces.tobago.renderkit.css.Style;
+import org.apache.myfaces.tobago.renderkit.html.DataAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
import org.apache.myfaces.tobago.renderkit.html.HtmlInputTypes;
+import org.apache.myfaces.tobago.renderkit.html.JsonUtils;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
@@ -108,6 +110,11 @@ public class TabGroupRenderer extends La
HtmlRendererUtils.writeDataAttributes(facesContext, writer, tabGroup);
writer.writeStyleAttribute(new Style(facesContext, tabGroup));
writer.writeAttribute(HtmlAttributes.SWITCHTYPE, switchType, false);
+ final String[] clientIds
+ = ComponentUtils.evaluateClientIds(facesContext, tabGroup, tabGroup.getRenderedPartially());
+ if (clientIds.length > 0) {
+ writer.writeAttribute(DataAttributes.PARTIAL_IDS, JsonUtils.encode(clientIds), true);
+ }
writer.startElement(HtmlElements.INPUT, null);
writer.writeAttribute(HtmlAttributes.TYPE, HtmlInputTypes.HIDDEN, false);
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml?rev=1622508&r1=1622507&r2=1622508&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml Thu Sep 4 16:07:37 2014
@@ -408,6 +408,7 @@
<script name="script/tobago-popup.js"/>
<script name="script/tobago-sheet.js"/>
<script name="script/tobago-suggest.js"/>
+ <script name="script/tobago-tab.js"/>
<script name="script/tobago-tree.js"/>
<script name="script/tobago-utils.js"/>
<script name="script/tobago-logging.js"/>
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js?rev=1622508&r1=1622507&r2=1622508&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js Thu Sep 4 16:07:37 2014
@@ -71,7 +71,7 @@ Tobago.Sheet.init = function(elements) {
click != undefined ? click.partially : undefined,
dblclick != undefined ? dblclick.action : undefined,
dblclick != undefined ? dblclick.partially: undefined,
- sheet.data("tobago-partially")); // type array
+ sheet.data("tobago-partial-ids")); // type array
});
Tobago.Sheet.setup2(sheets);