Re: Any Gwt-Mosaic user here? I've got a problem:my DropdownPanel is transparent ...

2009-12-01 Thread Andrius Juozapaitis
Hey,

Try their irc channel, it's listed on the project page - I was able to
get help from the guys there. It looks like a very decent alternative
to gxt and smartgwt, and while it doesn't provide that many widgets,
it solves a few layout and structuring issues very nicely.

regards,
--andrius aka phuqit



On Dec 1, 5:08 pm, lijnge lollypop1...@gmail.com wrote:
 for a spell mistake
 this is any on here can give me.. instead of can't .
 sorry of making this spelling mistake ...maybe this is because problem
 hurt too much

--

You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.




PagingScrollTable/CachedTableModel page count issue

2009-11-04 Thread Andrius Juozapaitis

Hey,

I was playing around with incubator's PagingScrollTable for a while,
and I've come across an issue there. I have a DataSourceTableModel
that extends MutableTableModel, and looks like this:

public class DataSourceTableModel extends MutableTableModel {
...
@Override
public void requestRows(final TableModelHelper.Request request,
final Callback callback) {
UserService.App.getInstance().getUsers(new
AsyncCallbackViewResultUser() {
@Override
public void onFailure(Throwable throwable) {
Window.alert(failed retrieving the users +
throwable);
}

@Override
public void onSuccess(final ViewResultUser
userViewResult) {
Window.alert(received rows:  +
userViewResult.getTotalRows());

// Application.cachedTableModel.setRowCount
(userViewResult.getTotalRows());

callback.onRowsReady(request, new
TableModelHelper.Response() {
@Override
public Iterator getRowValues() {
final IteratorValueRowUser rows =
userViewResult.getRows().iterator();
return new Iterator(){

@Override
public boolean hasNext() {
return rows.hasNext();
}

@Override
public Object next() {
return rows.next().getValue();
}

@Override
public void remove() {

}
};
}
});
}
});
}
}

It is then wrapped around in a CachedTableModel:

CachedTableModelUser cachedTableModel = new CachedTableModelUser
(tableModel);

Now, cachedTableModel actually holds a reference to the
DataSourceTableModel. When retrieving the data using
DataSourceTableModel.requestRows(,,,)  method, I get back a number of
total rows in the result set, and would like to update the paging
control accordingly. The problem is, if I invoke setRowCount
(userViewResult.getTotalRows())) in this method,it only updates the
underlying DataSourceTableModel, not the cachedTableModel, which is
actually used by the PagingScrollTable.

A RowCountChangeEvent event is fired when invoking setRowCount() on a
DataSourceTableModel, but I can't register a listener on
CachedTableModel for it, because CachedTableModel.setRowCount() looks
like

  public void setRowCount(int rowCount) {
tableModel.setRowCount(rowCount);
super.setRowCount(rowCount);
  }

so it would in turn invoke DataSourceTableModel's setRowCount, and go
into an infinite loop, as it fires another event.

Am I missing something here? Are there any other ways to achieve this
functionality without holding a back reference to a CachedTableModel
inside a DataSourceTableModel?

regards,
Andrius Juozapaitis
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: PagingScrollTable/CachedTableModel page count issue

2009-11-04 Thread Andrius Juozapaitis

The DataSourceTableModel is responsible for the actual server side
query (one query returns both the requested results, and total row
count - this saves a server roundtrip), but by default it doesn't have
a reference to the CachedTableModel. I would prefer to inject this
dependency by adding a RowCountChangeEvent handler into
CachedTableModel, but this creates a circular dependency
(CachedTableModel invokes the setRowCount() on the contained
DataSourceTableModel, which fires that event again) and hence it
doesn't work.

not quite sure if that's what you wanted to address in your example
though, pardon me if I got it wrong.

regards,
--andrius

On Nov 4, 2:52 pm, Felipe felipe.andres.p...@gmail.com wrote:
 you would use:

 paginadorUnidades.addPageChangeHandler(new PageChangeHandler() {

                         public void onPageChange(PageChangeEvent event) {

                                         myAsync.getSelectCount ( new
 Aync...
                                                    ...
                                                        onSucces
 (Integer result) { cachedTable.setRowCount ()result }; /*  */
                                                    

                                         );

                         }});
 may be your AsyncCallbackViewResultUser() {... is work even.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Serialization problem using CustomFieldSerializer(s) and specifying specific .java files in gwt module xml

2009-10-03 Thread Andrius Juozapaitis

Hey,

I've been trying to emulate parts of 3rd party library and stumbled
upon a problem. The library has certain classes with java.lang.Object
references that I wanted to get rid of, and I want the classes to
implement java.io.Serializable. The package structure is like that:

-java/dao/
-EntityWithObjectReference.java
-EntityWithObjectReference_CustomFieldSerializer.java
-ExtendedEntity.java

-resources/
serialization.gwt.xml
-substituted.dao/
EntityWithObjectReference.java

Everything is built using maven, so files end up where they should
be.

Original base entity class I want to emulate:
package dao;
public class EntityWithObjectReference {
public Object objReference;
private String text;
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}

Emulated base entity class (implements serializable, Object ref
removed):

package dao;
import java.io.Serializable;
public class EntityWithObjectReference implements Serializable {
private String text;
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}

The class I actually use in both client and server side:

package dao;
import java.io.Serializable;
public class ExtendedEntity extends EntityWithObjectReference
implements Serializable {
private String name;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}
}

There's also a EntityWithObjectReference_CustomFieldSerializer.java,
which simply ignores the Object reference for now:

package dao;
import com.google.gwt.user.client.rpc.*;
public class EntityWithObjectReference_CustomFieldSerializer {
public static void serialize(SerializationStreamWriter writer,
EntityWithObjectReference entity) throws SerializationException {
writer.writeString(entity.getText());
}
public static void deserialize(SerializationStreamReader reader,
EntityWithObjectReference entity) throws SerializationException {
entity.setText( reader.readString());
}
}

Now, if I just leave the source element empty (it should include all
the java files in the package), everything works fine, serialization
works as expected, and custom serializer is being called.

serialization.gwt.xml:
module
inherits name=com.google.gwt.core.Core/
source path=dao
!--include name=ExtendedEntity.java/--
!--include name=EntityWithObjectReference.java/--
/source
super-source path=substituted/
/module

***When I try to uncomment the two lines*** that explicitly include
the specific java files (I need that because the original library I
want to emulate has a number of additional files in the source
packages that gwt doesn't ever need to know about), there's a problem
- GWT keeps complaining that 'This application is out of date, please
click the refresh button on your browser'. The server response is the
same in both cases:

//OK[3,2,1,[dao.ExtendedEntity/1266011518,xxx,evil entity],0,5]

But GWT generated javascript expects a different checksum in this
case, and an exception is raised when deserializing the data. Any
ideas why this is happening? Bug, feature, a bit of both? I'd be more
than happy to supply the code to verify this behavior, if anyone can
help me sort this out.

regards,
Andrius J.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Emulated java class serialization issues

2009-09-21 Thread Andrius Juozapaitis

Hey,

I stumbled upon a problem when trying to use CouchDB with GWT (the
JCouchDB framework has unserializable fields in the lists they return,
that are not really relevant in GWT clientside). So I created a simple
test case (maven project) that tries to emulate the non-serializable
class using super-source in gwt module. Everything compiles without
warnings, but I am getting an error when returning the emulated class
from the server side ('This application is out of date, please click
the refresh button on your browser.'). The classes in question are:

[code]
package dao;
public class EntityWithObjectReference {
public Object objReference;
private String text;
public EntityWithObjectReference() {
}

public String getText() {
return text;
}

public void setText(String text) {
this.text = text;
}
}
[/code]

emulated class is defined as follows:

[code]
package dao;
import java.io.Serializable;
public class EntityWithObjectReference implements Serializable {
private String text;
public EntityWithObjectReference() {}

public String getText() {
return text;
}

public void setText(String text) {
this.text = text;
}
}
[/code]

note the lack of Object reference. The module descriptor I use is:

[code]
!DOCTYPE module SYSTEM
http://google-web-toolkit.googlecode.com/svn/releases/1.7/
distro-source/core/src/gwt-module.dtd
module
inherits name=com.google.gwt.core.Core/
source path=dao

/source
super-source path=substituted/
/module
[/code]

I have a crawling suspicion, the server tries to serialize the
original class, and the client gets additional object reference int
the stream, that it doesn't know how to handle. What is the correct
way to solve this problem, apart from rewriting the library in
question to get rid of object references?

thanks in advance,
Andrius



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Emulated java class serialization issues

2009-09-21 Thread Andrius Juozapaitis

 Use wrapper-classes containing only the values you need in your
 GWT-application. The server creates these objects out of the
 server-side instances and set the values when received from the
 client. It's more or less the same as you already did but with
 the difference that you don't rely on the intelligence of
 the compiler but take that into your own hands.

I am reluctant to maintaining another layer of essentially duplicate
classes, as well as creating all the data copying logic (I guess this
could be accomplished by an aspect, as I am using Spring in the
backend). I've considered using a custom Serializer/Deserializer, but
was hoping there's a way to avoid it. Oh well, back to drawing board.

Unless somebody comes up with a better idea, of course - I am open for
suggestions :)

regards,
Andrius
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Accessing CouchDB from GWT using JCouchDB library

2009-08-24 Thread Andrius Juozapaitis

 Hey,

I've been toying around with the idea of using CouchDB [1] as a back-
end store for my GWT applications, as it seems like a very good match
- you get a flexible document structure, and easy mapping of CouchDB
documents to Java domain objects using simple annotations [2]. I also
use Spring framework in my application layer.
The problem I have is that a number of JCouchDB [3] library's helper
classes, i.e., the ones that are used to return collections of
documents with paging properties aren't serializable from GWT point of
view, as they contain Object references. If I understand correctly, I
can substitute the implementation of these classes by using a module
descriptors, but I'm kinda lost here, because my new implementation
doesn't seem to be picked up by the GWT compiler. I guess I could just
rewrite the library, as the license permits it, but it's kinda work in
progress, so I'd hate to have to maintain a separate branch by myself.
I have the following module descriptor:


jcouchdb.gwt.xml
!DOCTYPE module SYSTEM
   http://google-web-toolkit.googlecode.com/svn/releases/1.7/
distro-source/core/src/gwt-module.dtd
module
  inherits name=com.google.gwt.core.Core/
   super-source path=super includes=**/*.java
casesensitive=false/

   source path=jcouchdb
   include name=document/AbstractViewResult.java/
... skipped ...
   include name=document/ViewResult.java/
   include name=document/Document.java/

   include name=util/Base64Util.java/
   include name=util/Util.java/

   /source
   source path=svenson
   include name=JSONProperty.java/
   include name=JSONTypeHint.java/
   include name=AbstractDynamicProperties.java/
   include name=DynamicProperties.java/
   /source

/module

and my application module is as follows:

module

   !-- Inherit the core Web Toolkit stuff.--
   inherits name='com.google.gwt.user.User'/

   inherits name='org.jcouchdb'/
 ... skipped ...
/module

/module


Any ideas what I am doing wrong? Any sample code to refer to? I did
read the module development guide [4], but so far, no luck. I could
also upload my project somewhere, it uses maven and is pretty much
self contained, let me know if it's a good idea.

Thanks in advance,
Andrius

[1] http://couchdb.apache.org/
[2] http://code.google.com/p/jcouchdb/wiki/Tutorial
[3] http://code.google.com/p/jcouchdb/
[4] 
http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html#DevGuideModules

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---