Java Code Examples for com.smartgwt.client.widgets.grid.ListGrid#getRecords()

The following examples show how to use com.smartgwt.client.widgets.grid.ListGrid#getRecords() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CalendarEventDialog.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void addParticipant(final ListGrid list, String id, String username, String name) {
	// Check if the selected user is already present in the list
	ListGridRecord[] records = list.getRecords();
	for (ListGridRecord test : records) {
		if (test.getAttribute("id").equals(id))
			return;
	}

	// Update the table
	ListGridRecord record = new ListGridRecord();

	record.setAttribute("id", id);
	record.setAttribute("name", name);
	record.setAttribute("username", username);
	list.addData(record);
	
	if (id.startsWith("g-")) {
		GUIGroup group = new GUIGroup();
		group.setId(Long.parseLong(id.substring(2)));
		group.setName(username);
		group.setDescription(name);
		CalendarEventDialog.this.calendarEvent.addParticipant(group);
	} else {
		GUIUser user = new GUIUser();
		user.setId(Long.parseLong(id));
		user.setUsername(username);
		user.setFirstName(name);
		CalendarEventDialog.this.calendarEvent.addParticipant(user);
	}
}
 
Example 2
Source File: DigitalObjectFormValidateAction.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Clears all row errors.
 * @param lg list to clear
 */
public static void clearRowErrors(ListGrid lg) {
    for (int i = lg.getRecords().length - 1; i >= 0; i--) {
        lg.clearRowErrors(i);
    }
}