Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1938

Grid/Listbox doesn't bind activePage attribute as default binding

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 6.5.3
    • Fix Version/s: 6.5.4
    • Component/s: Databind 2
    • Security Level: Jimmy
    • Labels:
      None

      Description

      <zk>
      	<zscript><![CDATA[
      		class TestVM {
      			private int pageIndex = 0;
      			public int getPageIndex() {
      				return pageIndex;
      			}
      
      			public void setPageIndex(int pageIndex) {
      				this.pageIndex = pageIndex;
      			}
      		}
      		
      		Object[] data = new Object[12];
      	]]></zscript>
      	<window apply="org.zkoss.bind.BindComposer"
      		viewModel="@id('vm') @init('TestVM')">
      		<intbox value="@bind(vm.pageIndex)"/>
      		<grid mold="paging" pageSize="3" 
      			activePage="@bind(vm.pageIndex)">
      			<columns>
      				<column label="col"/>
      			</columns>
      			<rows>
      				<row forEach="${data }">Item</row>
      			</rows>
      		</grid>
      		<listbox mold="paging" pageSize="3" 
      			activePage="@bind(vm.pageIndex)">
      			<listhead>
      				<listheader label="col"/>
      			</listhead>
      				<listitem forEach="${data }" label="Item"/>
      		</listbox>
      		
      	</window>
      </zk>
      

        Activity

        Hide
        jimmyshiau jimmyshiau added a comment - - edited

        workaround: add the following lang-addon.xml settings

        <component>
        	<extends>grid</extends>
        	<component-name>grid</component-name>
        	<annotation>
        		<annotation-name>ZKBIND</annotation-name>
        		<property-name>activePage</property-name>
        		<attribute>
        			<attribute-name>ACCESS</attribute-name>
        			<attribute-value>both</attribute-value>
        		</attribute>
        		<attribute>
        			<attribute-name>SAVE_EVENT</attribute-name>
        			<attribute-value>onPaging</attribute-value>
        		</attribute>
        	</annotation>
        </component>
        <component>
        	<extends>listbox</extends>
        	<component-name>listbox</component-name>
        	<annotation>
        		<annotation-name>ZKBIND</annotation-name>
        			<property-name>activePage</property-name>
        			<attribute>
        				<attribute-name>ACCESS</attribute-name>
        				<attribute-value>both</attribute-value>
        			</attribute>
        			<attribute>
        				<attribute-name>SAVE_EVENT</attribute-name>
        				<attribute-value>onPaging</attribute-value>
        			</attribute>
        		</annotation>
            </component>
        
        Show
        jimmyshiau jimmyshiau added a comment - - edited workaround: add the following lang-addon.xml settings <component> <extends> grid </extends> <component-name> grid </component-name> <annotation> <annotation-name> ZKBIND </annotation-name> <property-name> activePage </property-name> <attribute> <attribute-name> ACCESS </attribute-name> <attribute-value> both </attribute-value> </attribute> <attribute> <attribute-name> SAVE_EVENT </attribute-name> <attribute-value> onPaging </attribute-value> </attribute> </annotation> </component> <component> <extends> listbox </extends> <component-name> listbox </component-name> <annotation> <annotation-name> ZKBIND </annotation-name> <property-name> activePage </property-name> <attribute> <attribute-name> ACCESS </attribute-name> <attribute-value> both </attribute-value> </attribute> <attribute> <attribute-name> SAVE_EVENT </attribute-name> <attribute-value> onPaging </attribute-value> </attribute> </annotation> </component>
        Hide
        dennis dennis added a comment -

        fixed since 2013/9/23

        Show
        dennis dennis added a comment - fixed since 2013/9/23

          People

          • Assignee:
            Unassigned
            Reporter:
            jimmyshiau jimmyshiau
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: