[richfaces-issues] [JBoss JIRA] Updated: (RF-11028) Dynamic extendDataTable not support ajax support
Jay Balunas (JIRA)
jira-events at lists.jboss.org
Fri Jun 10 12:11:59 EDT 2011
[ https://issues.jboss.org/browse/RF-11028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jay Balunas updated RF-11028:
-----------------------------
Fix Version/s: 3.Future
> Dynamic extendDataTable not support ajax support
> ------------------------------------------------
>
> Key: RF-11028
> URL: https://issues.jboss.org/browse/RF-11028
> Project: RichFaces
> Issue Type: Task
> Security Level: Public(Everyone can see)
> Components: component-a4j-core, component-tables
> Affects Versions: 3.3.3.Final
> Environment: Operating system Windows XP, Browser IE-7 and FirFox4
> The JDK or JRE you are using, e.g. Sun Microsystems JDK 1.5.0_09
> Reporter: umanath muthuvel
> Labels: richfaces
> Fix For: 3.Future
>
>
> Dynamic extendDataTable creation not supporting ajax support
> Creating Dynamic binding for rich:extendedDataTable with 2 columns and 5 row of dateList.
> And after running my xhtml page the hole data (5 row of data with 2 columns are displayed)
> But after I am clicking any row the a4j:support not firing corresponding method. ( But whenever clicking the row the jsf life cycle are printing in consoule)
> So I am trying Statically with same data and same a4j:support event and action... this time it firing the corresponding method.
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:h="http://java.sun.com/jsf/html"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:ui="http://java.sun.com/jsf/facelets"
> xmlns:rich="http://richfaces.org/rich"
> xmlns:a4j="http://richfaces.org/a4j"
> xmlns:hex="http://hexaware.com/custom">
> <head>
> <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
> <a4j:loadStyle src="resource:///com/hexaware/ui/style/hexcomponents.css"/>
> <a4j:loadScript src="resource:///com/hexaware/ui/js/hexcomponents.js" />
> </head>
> <body>
>
> <h:form>
> <h:panelGrid width="100%" binding="#{upmBranchMaintenanceBean.resultRowPanel}"/>
> <h:panelGrid binding="#{upmBranchMaintenanceBean.dummyPanel}"/>
> </h:form>
> </body>
> </html>
> -------------------------------------------------------------------------------------------
> And attached Static xhtml Page
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:h="http://java.sun.com/jsf/html"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:ui="http://java.sun.com/jsf/facelets"
> xmlns:rich="http://richfaces.org/rich"
> xmlns:a4j="http://richfaces.org/a4j"
> xmlns:hex="http://hexaware.com/custom">
> <head>
> <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
> <a4j:loadStyle src="resource:///com/hexaware/ui/style/hexcomponents.css"/>
> <a4j:loadScript src="resource:///com/hexaware/ui/js/hexcomponents.js" />
> </head>
> <body>
> <h:form>
> <rich:extendedDataTable id="resultExtTable_id"
> var="category"
> sortMode="single"
> value="#{upmBranchMaintenanceBean.resultBranchListVO}" >
> <rich:column id="branchCode">
> <f:facet name="header">
> <h:outputText value="Code"/>
> </f:facet>
> <h:outputText value="#{category.branchCode}"/>
> </rich:column>
>
> <rich:column id="branchName">
> <f:facet name="header">
> <h:outputText value="Code"/>
> </f:facet>
> <h:outputText value="#{category.branchName}"/>
> </rich:column>
>
> <a4j:support event="onselectionchange" id="static_ajax_id"
> action="#{upmBranchMaintenanceBean.takeSelection}" />
>
> </rich:extendedDataTable>
> </h:form>
> </body>
> </html>
> ----------------------------------------------------------------------------------------
> And for your reference i attached Dynamic table creation Source code here
> private static HtmlExtendedDataTable createTable(String beanName, TableAttributes tableAttributes) {
> System.out.println("-------- createTable -----------");
> HtmlExtendedDataTable extendedDataTable = new HtmlExtendedDataTable();
> extendedDataTable.setId(tableAttributes.getId());
> String binding = "${" + beanName + "." + tableAttributes.getValue() + "}";
> System.out.println("Tabel Value = "+binding);
> ValueExpression valExp = getExpressionFactory()
> .createValueExpression(getELContext(), binding, List.class);
> extendedDataTable.setWidth("100");
> extendedDataTable.setValueExpression("value", valExp);
> extendedDataTable.setVar(tableAttributes.getVar());
> extendedDataTable.setSelectionMode(UPMUIConstant.MAINTENANCE_TABLE_SEL_MODE);
> extendedDataTable.setSortMode(UPMUIConstant.MAINTENANCE_TABLE_SORT_MODE);
>
> for(ColumnAttributes columnAttributes : tableAttributes.getColumnAttributesList()) {
> System.out.println(" column "+columnAttributes.getHeader());
> if(HtmlOutputText.COMPONENT_TYPE.equalsIgnoreCase(columnAttributes.getComponentType())) {
> HtmlOutputText headerComponent = new HtmlOutputText();
> headerComponent.setValue(columnAttributes.getHeader());
>
> HtmlColumn htmlColumn = new HtmlColumn();
> htmlColumn.setHeader(headerComponent);
>
> // Column ID is Must while creating dynamically, To avoid null pointer Exception.
> // Based on id value to set the Column Index internally.
> htmlColumn.setId(columnAttributes.getValue());
>
> binding = "#{" + tableAttributes.getVar()+ "." + columnAttributes.getValue() + "}";
>
> System.out.println("Column Value = "+binding);
> valExp = getExpressionFactory()
> .createValueExpression(getELContext(), binding, String.class);
>
> HtmlOutputText outputText = new HtmlOutputText();
> outputText.setValueExpression("value", valExp);
> htmlColumn.getChildren().add(outputText);
>
> extendedDataTable.getChildren().add(htmlColumn);
> System.out.println(" column added ");
>
>
> }
> else if(HtmlAjaxSupport.COMPONENT_TYPE.equalsIgnoreCase(columnAttributes.getComponentType())) {
> System.out.println(" Inside : "+ HtmlAjaxSupport.COMPONENT_TYPE );
> HtmlAjaxSupport ajaxSupport = new HtmlAjaxSupport();
>
> ajaxSupport.setId("static_ajax_id");
>
> binding = "#{" + beanName + "." +columnAttributes.getAction() + "}";
> System.out.println(" Method binding: "+binding);
>
> MethodExpression methodBind = getExpressionFactory().createMethodExpression(getELContext(), binding, null, new Class[] {});
> ajaxSupport.setActionExpression(methodBind);
>
> // MethodBinding action = FacesContext.getCurrentInstance().getApplication()
> // .createMethodBinding(binding, new Class[0]);
> // ajaxSupport.setAction(action);
> //
> System.out.println("Ajax Action :" +ajaxSupport.getAction().getExpressionString());
> System.out.println("Ajax Action1 :" +ajaxSupport.getActionExpression().getExpressionString());
> ajaxSupport.setEvent(columnAttributes.getEvent());
> System.out.println("Ajax event :" +ajaxSupport.getEvent());
> extendedDataTable.getChildren().add(ajaxSupport);
> }
> }
> System.out.println(" return extendedDataTable ");
> return extendedDataTable;
> }
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the richfaces-issues
mailing list