Java Code Examples for com.smartgwt.client.widgets.grid.ListGridRecord#getAttributeAsLong()

The following examples show how to use com.smartgwt.client.widgets.grid.ListGridRecord#getAttributeAsLong() . 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: AttributeSetsPanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void showContextMenu() {
	Menu contextMenu = new Menu();

	final ListGridRecord record = list.getSelectedRecord();
	final long id = record.getAttributeAsLong("id");

	MenuItem delete = new MenuItem();
	delete.setTitle(I18N.message("ddelete"));
	delete.addClickHandler(new com.smartgwt.client.widgets.menu.events.ClickHandler() {
		public void onClick(MenuItemClickEvent event) {
			LD.ask(I18N.message("question"), I18N.message("confirmdelete"), new BooleanCallback() {
				@Override
				public void execute(Boolean value) {
					if (value) {
						AttributeSetService.Instance.get().delete(id, new AsyncCallback<Void>() {
							@Override
							public void onFailure(Throwable caught) {
								Log.serverError(caught);
							}

							@Override
							public void onSuccess(Void result) {
								list.removeSelectedData();
								list.deselectAllRecords();
								showSetDetails(null);
							}
						});
					}
				}
			});
		}
	});

	contextMenu.setItems(delete);
	contextMenu.showContextMenu();
}
 
Example 2
Source File: EmailAccountFiltersPanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
boolean validate() {
	if (list == null)
		return true;

	ListGridRecord[] records = list.getRecords();
	List<GUIEmailRule> rules = new ArrayList<GUIEmailRule>();
	for (ListGridRecord record : records) {
		if (record.getAttribute("expression") == null)
			continue;
		GUIEmailRule rule = new GUIEmailRule();
		GUIFolder target = new GUIFolder();

		if (record.getAttributeAsLong("targetId") != null)
			target.setId(record.getAttributeAsLong("targetId"));
		else
			target.setId(0L);

		target.setName(record.getAttribute("targetName"));
		rule.setTarget(target);
		rule.setField(Integer.parseInt(record.getAttribute("field")));
		rule.setPolicy(Integer.parseInt(record.getAttribute("condition")));
		rule.setExpression(record.getAttribute("expression"));
		rules.add(rule);
	}

	account.setRules(rules.toArray(new GUIEmailRule[0]));
	return true;
}
 
Example 3
Source File: CatalogBrowser.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public Long getRdczId() {
    ListGridRecord r = lgResult.getSelectedRecord();
    Long val = (r == null) ? null : r.getAttributeAsLong(BibliographyQueryDataSource.FIELD_RDCZ_ID);
    return val;
}