Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.richasp.samplestarter.mobile.client.views.forms;

import org.litesoft.codec.*;
import org.litesoft.core.typeutils.*;
import org.litesoft.core.util.externalization.*;
import org.litesoft.mgwt.client.pavsupport.*;

import com.richasp.samplestarter.mobile.client.common.support.*;
import com.richasp.samplestarter.mobile.client.views.forms.memo.*;

public class FormsActivity extends AbstractBackableActivity<FormsView> implements FormsPresenter
{
    public static final String LOCAL_STORAGE_KEY = "ContactData";

    private final ClientFactory mClientfactory;

    public FormsActivity( ClientFactory pClientfactory, FormsView pView )
    {
        super( pView, pClientfactory );
        mClientfactory = pClientfactory;
    }

    @Override
    protected void start()
    {
        String fromStorage = mClientfactory.getLocalStorage().get( LOCAL_STORAGE_KEY );
        FormsData zFormsData = FormsData.DEFAULT_INSTANCE.fromMemento( VersioningCodec.INSTANCE.decode( fromStorage ) );
        mView.setFormValues( zFormsData );
    }

    @Override
    public void saveData( FormsData pFormsData )
    {
        E13nData zErrorData = pFormsData.validate();
        if ( zErrorData != null )
        {
            mView.showError( INPUT_REQUIRED, zErrorData );
            return;
        }
        String toStorage = VersioningCodec.INSTANCE.encode( pFormsData.toMemento() );
        mClientfactory.getLocalStorage().put( LOCAL_STORAGE_KEY, Strings.noEmpty( toStorage ) );
        goBack();
    }
}

Commits for litesoft/trunk/mobileGWT/SampleStarter/src/com/richasp/samplestarter/mobile/client/views/forms/FormsActivity.java

Diff revisions: vs.
Revision Author Commited Message
851 Diff Diff GeorgeS picture GeorgeS Mon 08 Oct, 2012 00:05:32 +0000

Breaking the code as Temporal changes are implemented...

801 Diff Diff GeorgeS picture GeorgeS Wed 15 Aug, 2012 03:59:02 +0000
780 Diff Diff GeorgeS picture GeorgeS Mon 16 Jul, 2012 04:49:12 +0000
779 Diff Diff GeorgeS picture GeorgeS Mon 16 Jul, 2012 04:34:33 +0000
762 GeorgeS picture GeorgeS Wed 11 Jul, 2012 13:43:27 +0000