Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • Classic "pre-Ajax" paging controls

    Hi,

    As discussed in your public forum, it would be nice if SmartClient provided the classic paging navigation controls that lets a user view a large resultset in smaller chunks. While this isn't technically necessary because Ajax allows for scrollbar-based paging, in some usecases it is still a superior user experience, IMHO.

  • #2
    Hi Senordhuff
    Check out this post in the Addendums forum.

    As part of our next (post 5.7) SmartClient release, we plan to include a Page-based navigation component or GridPager. In the meantime, this forum post includes code demonstrating how to create a similar solution based on a ListGrid and a VLayout.

    Let us know what you think.
    Thanks

    Isomorphic Software

    Comment


    • #3
      How i can display the data in GRID with paging

      Hi,
      i have added all the sample of the source code.
      can you please tell me how i can display the data in the GRID with the paging.
      and also tell me how i can run "gridPager.jsp" in SmartClient?
      Here is the sample for the onModuleLoad :
      Code:
      		VLayout mainlayout = new VLayout();
      		mainlayout.setWidth("600");
      		mainlayout.setHeight("150");
      		final ListGrid grid = new ListGrid();
      		grid.setAutoFetchData(true);
      		grid.setShowAllRecords(false);
      		grid.setDataPageSize(60);
      		grid.setDataSource(FormDSToSelectList.getInstance());
      		grid.setSortField(0);
      		mainlayout.addMember(grid);
      		mainlayout.draw();
      Here is the sample for the DataSource class:
      Code:
      private static FormDSToSelectList instance = null;
      	public static FormDSToSelectList getInstance() {
      		if (instance == null) {
      			instance = new FormDSToSelectList("DeviceGroupDS");
      		}
      		return instance;
      	}
      	public FormDSToSelectList(String id) {
      		setID(id);
      		setRecordXPath("/XDocument/XDeviceGroup");
      		DataSourceField groupNameField = new DataSourceField("groupName",
      				FieldType.TEXT, "Group Name");		
      		groupNameField.setRequired(true);
      		DataSourceField groupDescField = new DataSourceField("groupDescription",
      				FieldType.TEXT, "Group Description");
      		groupDescField.setRequired(true);
      		DataSourceField groupDateField = new DataSourceField("createdDate",
      				FieldType.TEXT, "Group Created Date");
      		groupDateField.setRequired(true);
      		DataSourceField groupMgrField = new DataSourceField("groupManager",
      				FieldType.TEXT, "Group Manager");
      		groupMgrField.setRequired(true);
      		
      		setFields(groupNameField, groupDescField, groupDateField, groupMgrField);
      		OperationBinding oppFetch = new OperationBinding();
      		oppFetch.setDataFormat(DSDataFormat.XML);
      		oppFetch.setOperationType(DSOperationType.FETCH);
      		oppFetch.setDataProtocol(DSProtocol.GETPARAMS);
      		oppFetch.setRecordXPath("/XDocument/XDeviceGroup");
      		setOperationBindings(oppFetch);
      	}
      	@Override
      	public Object transformRequest(DSRequest dsRequest) {
      		try {
      			if (dsRequest.getOperationType().equals(DSOperationType.FETCH)) {		
      				dsRequest.setActionURL("GetDeviceGroup.xml");				
      			}
      		} catch (Exception e) {
      			Window.alert(e.getMessage());
      		}
      		return super.transformRequest(dsRequest);
      	}
      	@Override
      	protected void transformResponse(DSResponse response, DSRequest request,
      			Object data) {
      		super.transformResponse(response, request, data);
      	}
      Here is the sample XML file
      Code:
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <XDocument>
          <XStatus>Success</XStatus>
          <XAction>GET</XAction>
          <XService>DeviceGroup</XService>
          <XPageNo>3</XPageNo>
          <XDeviceGroup>
              <groupName>GRP1</groupName>
              <groupDescription>Represents the QA device group</groupDescription>
              <createdDate>2009-07-10 11:49:34</createdDate>
              <groupManager>UserA@domain.com</groupManager>
          </XDeviceGroup>
      	.
      	.
      	.
      	.
      	.
          <XDeviceGroup>
              <groupName>GRP3</groupName>
              <groupDescription>Development team support grop</groupDescription>
              <createdDate>2009-08-13 11:49:48</createdDate>
              <groupManager>UserC@domain.com</groupManager>
          </XDeviceGroup>
      <XDocument>

      Comment

      Working...
      X