Results 1 to 6 of 6

Thread: Please ModelData Example Class

  1. #1
    Sencha User
    Join Date
    Oct 2009
    Posts
    40
    Vote Rating
    0
      0  

    Default Please ModelData Example Class

    Hi,

    How to use ModelData please Here is an example of class http://www.sencha.com/helpcenter/ind...als/dozer.html with Dozer but I want without Dozer

    Baczek00

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    131
      0  

    Default

    What kind of example are you looking for exactly? What do you want to do?

  3. #3
    Sencha User
    Join Date
    Oct 2009
    Posts
    40
    Vote Rating
    0
      0  

    Default

    I want to read text from the TextField and I noticed that this is
    formBinding needed, and works on ModelData FormBinding.

    Sorry for the double entry in the Forum

  4. #4
    Sencha User
    Join Date
    Oct 2009
    Posts
    40
    Vote Rating
    0
      0  

    Default

    Hi, Sven

    I have here is such a class program

    PHP Code:
    package pl.baczeksoft.client;

    import pl.baczeksoft.client.core.MyPanelEditTable;
    import pl.baczeksoft.client.core.MyRowEditPanel;
    import pl.baczeksoft.client.core.SpinnerField;
    import pl.baczeksoft.client.form.BaseForm.CustomWindows;
    import pl.baczeksoft.client.resources.Test;

    import com.extjs.gxt.ui.client.Style;
    import com.extjs.gxt.ui.client.binding.FieldBinding;
    import com.extjs.gxt.ui.client.binding.FormBinding;
    import com.extjs.gxt.ui.client.data.ModelData;
    import com.extjs.gxt.ui.client.widget.button.Button;
    import com.extjs.gxt.ui.client.widget.form.FormPanel;
    import com.extjs.gxt.ui.client.widget.form.TextField;
    import com.extjs.gxt.ui.client.widget.layout.FitLayout;
    import com.extjs.gxt.ui.client.widget.layout.FlowData;
    import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
    import com.google.gwt.core.client.GWT;
    import com.google.gwt.i18n.client.NumberFormat;
    import com.google.gwt.user.client.rpc.AsyncCallback;

    public class 
    DatabaseSettings {

        private 
    void CreateGUI(ModelData MD){
            
            
    Button btnTest = new Button("Test po??czenia");
            
    Button btnZapisz = new Button("Zapisz");
            
    Button btnAnuluj = new Button("Anuluj");
            
            
    TextField<StringDatabaseEdit = new TextField<String>(); 
                
    DatabaseEdit.setFieldLabel("Baza");
                
    DatabaseEdit.setName("database");
            
            
    TextField<StringUserEdit = new TextField<String>(); 
                
    UserEdit.setFieldLabel("Login");
                
    //UserEdit.setName("company");
            
            
    TextField<StringPasswordEdit = new TextField<String>(); 
                
    PasswordEdit.setFieldLabel("Has?o");
            
            final 
    SpinnerField spinnerInteger = new SpinnerField();
                
    spinnerInteger.setFieldLabel("Port");
                
    spinnerInteger.setStepValue(Integer.valueOf(1));
                
    spinnerInteger.setPropertyEditorType(Integer.class);
                
    spinnerInteger.setFormat(NumberFormat.getFormat("##0"));
                
    spinnerInteger.setAutoValidate(true);
                
    spinnerInteger.setAllowDecimals(false);
                
    spinnerInteger.setAllowBlank(false);
                
    spinnerInteger.setMaxValue(65535);
                
    spinnerInteger.setMinValue(0);
                
    spinnerInteger.setValue(3050);

                
            
    FormPanel PanelWnd = new FormPanel();
                
    PanelWnd.setHeaderVisible(false);
                
    PanelWnd.setLayout(new FlowLayout());
                
    PanelWnd.setBorders(false);
                
    PanelWnd.add(new MyRowEditPanel(DatabaseEdit));
                
    PanelWnd.add(new MyPanelEditTable(UserEditPasswordEditspinnerInteger), new FlowData(40,0,0,0));
                
                
            
    FormBinding binding = new FormBinding(PanelWnd);  
                
    binding.addFieldBinding(new FieldBinding(DatabaseEdit"database"));  
                
    //binding.addFieldBinding(new FieldBinding(UserEdit, "company"));   
            
            
    binding.autoBind();
            
    binding.bind(MD);
                
               
            final 
    CustomWindows DatabaseForm = new CustomWindows();
                
    DatabaseForm.setLayout(new FitLayout());
                
    DatabaseForm.setHeading(DatabaseForm.AppName+" - ustawienia po??czenia");
                
    DatabaseForm.setSize(650200);
                
    DatabaseForm.add(PanelWnd);
                
    DatabaseForm.setButtonAlign(Style.HorizontalAlignment.CENTER);
                
    DatabaseForm.addButton(btnTest);
                
    DatabaseForm.addButton(btnZapisz);
                
    DatabaseForm.addButton(btnAnuluj);
                
    DatabaseForm.show();    
        }
        
        public 
    DatabaseSettings(){
            final 
    GreetingServiceAsync greetingService GWT.create(GreetingService.class);
            final 
    AsyncCallback<Testcallback = new AsyncCallback<Test>(){
            
            @
    Override
            
    public void onFailure(Throwable caught) {
                
    // TODO Auto-generated method stub
            
    }

            @
    Override
            
    public void onSuccess(Test result) {
                
    // TODO Auto-generated method stub
                
    CreateGUI(result);
            }
        };
        
    greetingService.getDatabase(callback); -- Error
        

    POJO Class:

    PHP Code:
    package pl.baczeksoft.client.resources;

    import java.io.Serializable;

    import com.extjs.gxt.ui.client.data.BaseModelData;

    public class 
    Test extends BaseModelData implements Serializable {

        
    /**
         * 
         */
        
    private static final long serialVersionUID 1L;

        public 
    Test() {
            
    // TODO Auto-generated constructor stub
        
    }

         public 
    void setDatabase(String database) {
                
    set("database"database);
         }
         
         public 
    String getDatabase() {
                return (String) 
    get("database");
         }

    Implements Class

    PHP Code:
    package pl.baczeksoft.server;

    import pl.baczeksoft.client.GreetingService;
    import pl.baczeksoft.client.resources.Test;

    import com.google.gwt.user.server.rpc.RemoteServiceServlet;

    /**
     * The server side implementation of the RPC service.
     */
    @SuppressWarnings("serial")
    public class 
    GreetingServiceImpl extends RemoteServiceServlet implements
            
    GreetingService {

        @
    Override
        
    public Test getDatabase()  {
            
    // TODO Auto-generated method stub
            
    Test DBF = new Test();
                
    DBF.setDatabase("g");
            
    //    DBF.setPort(3050);
            //    DBF.setUser("SYSDBA");
            //    DBF.setPassword("masterkey");
        
    return DBF;
            
        } 

    Error:

    PHP Code:
    2010-08-27 22:30:50 com.google.appengine.tools.development.ApiProxyLocalImpl log
    SEVERE
    : [1282941050223000javax.servlet.ServletContext logException while dispatching incoming RPC call
    java
    .lang.NoClassDefFoundErrorcom/extjs/gxt/ui/client/data/BaseModelData
        at java
    .lang.ClassLoader.defineClass1(Native Method)
        
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
        
    at java.lang.ClassLoader.defineClass(Unknown Source)
        
    at java.security.SecureClassLoader.defineClass(Unknown Source)
        
    at java.net.URLClassLoader.defineClass(Unknown Source)
        
    at java.net.URLClassLoader.access$000(Unknown Source)
        
    at java.net.URLClassLoader$1.run(Unknown Source)
        
    at java.security.AccessController.doPrivileged(Native Method)
        
    at java.net.URLClassLoader.findClass(Unknown Source)
        
    at java.lang.ClassLoader.loadClass(Unknown Source)
        
    at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:151)
        
    at java.lang.ClassLoader.loadClass(Unknown Source)
        
    at java.lang.Class.forName0(Native Method)
        
    at java.lang.Class.forName(Unknown Source)
        
    at com.google.gwt.user.server.rpc.SerializationPolicyLoader.loadFromStream(SerializationPolicyLoader.java:196)
        
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.loadSerializationPolicy(RemoteServiceServlet.java:89)
        
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.doGetSerializationPolicy(RemoteServiceServlet.java:251)
        
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.getSerializationPolicy(RemoteServiceServlet.java:139)
        
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.prepareToRead(ServerSerializationStreamReader.java:445)
        
    at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:236)
        
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:186)
        
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:224)
        
    at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
        
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
        
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
        
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
        
    at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58)
        
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        
    at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
        
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        
    at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
        
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
        
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
        
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
        
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
        
    at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
        
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        
    at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:349)
        
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        
    at org.mortbay.jetty.Server.handle(Server.java:326)
        
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
        
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
        
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
        
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
        
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
        
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
        
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
    Caused byjava.lang.ClassNotFoundExceptioncom.extjs.gxt.ui.client.data.BaseModelData
        at java
    .net.URLClassLoader$1.run(Unknown Source)
        
    at java.security.AccessController.doPrivileged(Native Method)
        
    at java.net.URLClassLoader.findClass(Unknown Source)
        
    at java.lang.ClassLoader.loadClass(Unknown Source)
        
    at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:151)
        
    at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 
    50 more

    2010
    -08-27 22:43:49 com.google.appengine.tools.development.ApiProxyLocalImpl log
    SEVERE
    : [1282941829381000javax.servlet.ServletContext logException while dispatching incoming RPC call
    java
    .lang.NoClassDefFoundErrorcom/extjs/gxt/ui/client/data/BaseModelData
        at java
    .lang.ClassLoader.defineClass1(Native Method)
        
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
        
    at java.lang.ClassLoader.defineClass(Unknown Source)
        
    at java.security.SecureClassLoader.defineClass(Unknown Source)
        
    at java.net.URLClassLoader.defineClass(Unknown Source)
        
    at java.net.URLClassLoader.access$000(Unknown Source)
        
    at java.net.URLClassLoader$1.run(Unknown Source)
        
    at java.security.AccessController.doPrivileged(Native Method)
        
    at java.net.URLClassLoader.findClass(Unknown Source)
        
    at java.lang.ClassLoader.loadClass(Unknown Source)
        
    at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:151)
        
    at java.lang.ClassLoader.loadClass(Unknown Source)
        
    at java.lang.Class.forName0(Native Method)
        
    at java.lang.Class.forName(Unknown Source)
        
    at com.google.gwt.user.server.rpc.SerializationPolicyLoader.loadFromStream(SerializationPolicyLoader.java:196)
        
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.loadSerializationPolicy(RemoteServiceServlet.java:89)
        
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.doGetSerializationPolicy(RemoteServiceServlet.java:251)
        
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.getSerializationPolicy(RemoteServiceServlet.java:139)
        
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.prepareToRead(ServerSerializationStreamReader.java:445)
        
    at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:236)
        
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:186)
        
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:224)
        
    at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
        
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
        
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
        
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
        
    at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58)
        
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        
    at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
        
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        
    at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
        
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
        
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
        
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
        
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
        
    at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
        
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        
    at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:349)
        
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        
    at org.mortbay.jetty.Server.handle(Server.java:326)
        
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
        
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
        
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
        
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
        
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
        
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
        
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
    Caused byjava.lang.ClassNotFoundExceptioncom.extjs.gxt.ui.client.data.BaseModelData
        at java
    .net.URLClassLoader$1.run(Unknown Source)
        
    at java.security.AccessController.doPrivileged(Native Method)
        
    at java.net.URLClassLoader.findClass(Unknown Source)
        
    at java.lang.ClassLoader.loadClass(Unknown Source)
        
    at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:151)
        
    at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 
    50 more 
    What am I doing wrong?

  5. #5
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    131
      0  

    Default

    You dont have the gxt.jar on your server classpath as it looks like

  6. #6
    Sencha User
    Join Date
    Oct 2009
    Posts
    40
    Vote Rating
    0
      0  

    Default

    gxt.ja is, without a method getDatabase () works. So it's not. Somewhere I am doing mistake in writing getDatabase () just do not know where

Similar Threads

  1. ModelData bug?
    By danutzdobrescu in forum Ext GWT: Discussion
    Replies: 0
    Last Post: 28 May 2009, 1:03 AM
  2. BeanModelTag vs. ModelData
    By ambro23 in forum Community Discussion
    Replies: 1
    Last Post: 10 Mar 2009, 2:06 AM
  3. ModelData and displayProperty
    By zaccret in forum Community Discussion
    Replies: 11
    Last Post: 4 Nov 2008, 1:38 AM
  4. Updating and ModelData ??
    By gslender in forum Community Discussion
    Replies: 7
    Last Post: 18 Sep 2008, 1:22 AM
  5. ModelData.removeAll()
    By Ronn in forum Community Discussion
    Replies: 0
    Last Post: 26 Jun 2008, 4:55 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •