Example usage for com.google.gwt.gdata.client.finance TransactionEntry updateEntry

List of usage examples for com.google.gwt.gdata.client.finance TransactionEntry updateEntry

Introduction

In this page you can find the example usage for com.google.gwt.gdata.client.finance TransactionEntry updateEntry.

Prototype

public final native void updateEntry(Callback<E> callback) ;

Source Link

Document

Updates the entry in the feed by sending the representation of this entry.

Usage

From source file:com.google.gwt.gdata.sample.hellogdata.client.FinanceUpdateTransactionDemo.java

License:Apache License

/**
 * Update a transaction by making use of the updateEntry
 * method of the Entry class.//from   w ww  .java2 s .c  o m
 * Set the transaction notes to an arbitrary string. Here
 * we prefix the notes with 'GWT-Finance-Client' so that
 * we can identify which transactions were updated by this demo.
 * On success and failure, display a status message.
 * 
 * @param transactionEntry The transaction entry which to update
 */
private void updateTransaction(TransactionEntry transactionEntry) {
    showStatus("Updating transaction...", false);
    transactionEntry.getTransactionData().setNotes("GWT-Finance-Client - updated transaction");
    transactionEntry.getTransactionData().setShares(271.82);
    transactionEntry.updateEntry(new TransactionEntryCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus("An error occurred while updating a transaction: " + caught.getMessage(), true);
        }

        public void onSuccess(TransactionEntry result) {
            showStatus("Updated a transaction.", false);
        }
    });
}