How to use GWT 2.1 Data Presentation Widgets

Google I/O 2010 – GWT’s UI overhaul javadocs package com.google.gwt.cell.client in 2.1 Eclipse update site for milestone 2 While the code is in bikeshed, add this line to your gwt.xml file: <inherits name=”com.google.gwt.requestfactory.RequestFactory”/> The following examples follow: CellList of TextCells with PageSizePager CellList of TextCells with a SimplePager CellList of TextCells with a SimplePager and … Read more

Razor Nested WebGrid

Excuse the verbose data setup but this works… @{ var data = Enumerable.Range(0, 10).Select(i => new { Index = i, SubItems = new object[] { new { A = “A” + i, B = “B” + (i * i) } } }).ToArray(); WebGrid topGrid = new WebGrid(data); } @topGrid.GetHtml(columns: topGrid.Columns( topGrid.Column(“Index”), topGrid.Column(“SubItems”, format: (item) => … Read more

Pagination in Spring Data JPA (limit and offset)

Below code should do it. I am using in my own project and tested for most cases. usage: Pageable pageable = new OffsetBasedPageRequest(offset, limit); return this.dataServices.findAllInclusive(pageable); and the source code: import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.springframework.data.domain.AbstractPageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; import java.io.Serializable; /** * Created by Ergin **/ public class OffsetBasedPageRequest implements Pageable, … Read more

Understanding Virtual Address, Virtual Memory and Paging

Before I answer your questions (I hope I do), here are a few introductory remarks: Remarks The problem here is that “virtual memory” has two senses. “Virtual memory” as a technical term used by low-level programmers has (almost) nothing to do with “virtual memory” as explained to consumers. In the technical sense, “virtual memory” is … Read more

Paging SQL Server 2005 Results

You can use the Row_Number() function. Its used as follows: SELECT Row_Number() OVER(ORDER BY UserName) As RowID, UserFirstName, UserLastName FROM Users From which it will yield a result set with a RowID field which you can use to page between. SELECT * FROM ( SELECT Row_Number() OVER(ORDER BY UserName) As RowID, UserFirstName, UserLastName FROM Users … Read more