Re: Masked Input

2008-11-30 Thread yunhui song
If you use gwt-ext, you can use Ext.mask or Ext.unmask. I have a open source
project which use that.
  http://code.google.com/p/ppl-kit

you can get the working code there.

Sammi

On Sun, Nov 30, 2008 at 2:29 AM, Riyaz Mansoor [EMAIL PROTECTED]wrote:



 I'm interested in this as well.

 On Nov 29, 12:15 am, jsantaelena [EMAIL PROTECTED] wrote:
  Hi
 
  Someone knows libe withmaskedwidgets?
 
  Thanks.
 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Who can read chinese?

2008-11-27 Thread yunhui song
Hi I can help you. what do you need?

On Thu, Nov 27, 2008 at 8:16 PM, [EMAIL PROTECTED] 
[EMAIL PROTECTED] wrote:


 I need help ,  i hava some API of YI language  , but all words is
 china words ,  who can help me?ASAP , thanks.
 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Cookies in hosted mode won't go away

2008-11-17 Thread yunhui song
Cookies.removeCookie(userId) doesn't work  here too. I use expire time to
remove it, it works.

 int COOKIE_TIMEOUT = 0;

Date removeExpire = new Date((new Date()).getTime() + COOKIE_TIMEOUT);
//  //remove the cookie, works.

  Cookies.setCookie(cookieName,null, removeExpire);


Good luck,
Sammi

On Mon, Nov 17, 2008 at 9:50 AM, Eros [EMAIL PROTECTED] wrote:


 Hi,

 I can't get rid of cookies in hosted mode. I wrote a userId cookie
 using:

 Cookies.setCookie(userId, userId);

 and now I can't remove it.

 I tried the following:

 - Cookies.removeCookie(userId);
 - restarting the hosted mode
 - Eclipse - Project - Clean...
 - restarting Eclipse
 - removing www
 - removing everything under tomcat/work/gwt/localhost/_/

 If I do a Compile/Browse everything works as expected, cookies get
 removed with Cookies.remove or clearing the cache in Firefox.

 I use Ubuntu 8.10 and GWT 1.5.3

 Any help is appreciated.

 Cheers,
 Eros

 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: migrating to GWT-EXT

2008-11-13 Thread yunhui song
Ext.mask and Ext.unmask(),  Ext is a GWT-EXT core class. You could find a
working class in my project http://code.google.com/p/ppl-kit

On Thu, Nov 13, 2008 at 10:49 PM, Litty Preeth [EMAIL PROTECTED]wrote:

 Sorry... I didnt quite understand ur post. You mean you used EXT JS mask
 and unmask functions?

 - Litty


 On Fri, Nov 14, 2008 at 12:07 PM, yunhui song [EMAIL PROTECTED]wrote:

 Hi Litty,   I just finished a project to implment LightBox affect. I use
 ext.mask() and ext.unmask(). In my apinion, It's quite good.

http://code.google.com/p/ppl-kit.
I use gwt-ext and removed the extra files. It's only 40k and 4 support
 resource files.

   Hope that helps.
 Sammi


 On Thu, Nov 13, 2008 at 9:59 PM, Litty Preeth [EMAIL PROTECTED]wrote:

 Hi All,

 Thank you soo much for all your response

 Actually I wanted to use the GWT-EXT mainly for Tree and Modal Popups. I
 wanted the tree popup menu and the gray out of the screen when modal popups
 are shown (LightBox effect).

 Is it worthy enough to use GWT-EXT for these?

 Regards,
 Litty Preeth


 On Fri, Nov 14, 2008 at 6:01 AM, Roger Marin [EMAIL PROTECTED] wrote:

 After having finished with a fairly large project using GWT-EXT i would
 personally advise staying away from it, specially if you are a newbie with
 GWT. Why?
 * GWT-EXT's programming model != GWT's programming model. GWT-EXT is
 basically a JSNI wrapper for the ext-js API
 * Very slow performance compared to using pure GWT
 * The gwt-ext forums are filled with unanswered questions and very
 little answers from the project members.
 * If you are planning on using RPC, either be ready to spend 200$ on the
 plus version or move to GWTX.
 * With GWT-EXT your are stuck with ext 2.02 since the license change
 fiasco.

 These are some of the reasons why, i could go on with the bashing but
 this is not the right place. From now on if i really need eye-candy i'll
 probably use flex or pure javascript or ext, most of the widgets that make
 GWT-EXT/GXT interesting are already available as part of the
 incubator(paging, grids, etc).

 cheers.

 2008/11/13 posta07 [EMAIL PROTECTED]


 Take a look at Ext-GWT (GXT) from extjs.com.

 It's the same extjs widgets written in pure GWT.

 On Nov 13, 9:33 am, Litty Preeth [EMAIL PROTECTED] wrote:
  Hi,
 
  I am using simple GWT in my current project. I wanted to use some
 GWT-
  EXT widgets also. Can anybody tell me if there is anything to take
  care of when integrating GWT-EXT also to a current GWT project? Are
  there any clashes which might occur?
 
  Thnx n Regards,
  Litty Preeth












 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: migrating to GWT-EXT

2008-11-13 Thread yunhui song
Hi Litty,   I just finished a project to implment LightBox affect. I use
ext.mask() and ext.unmask(). In my apinion, It's quite good.

   http://code.google.com/p/ppl-kit.
   I use gwt-ext and removed the extra files. It's only 40k and 4 support
resource files.

  Hope that helps.
Sammi

On Thu, Nov 13, 2008 at 9:59 PM, Litty Preeth [EMAIL PROTECTED] wrote:

 Hi All,

 Thank you soo much for all your response

 Actually I wanted to use the GWT-EXT mainly for Tree and Modal Popups. I
 wanted the tree popup menu and the gray out of the screen when modal popups
 are shown (LightBox effect).

 Is it worthy enough to use GWT-EXT for these?

 Regards,
 Litty Preeth


 On Fri, Nov 14, 2008 at 6:01 AM, Roger Marin [EMAIL PROTECTED] wrote:

 After having finished with a fairly large project using GWT-EXT i would
 personally advise staying away from it, specially if you are a newbie with
 GWT. Why?
 * GWT-EXT's programming model != GWT's programming model. GWT-EXT is
 basically a JSNI wrapper for the ext-js API
 * Very slow performance compared to using pure GWT
 * The gwt-ext forums are filled with unanswered questions and very little
 answers from the project members.
 * If you are planning on using RPC, either be ready to spend 200$ on the
 plus version or move to GWTX.
 * With GWT-EXT your are stuck with ext 2.02 since the license change
 fiasco.

 These are some of the reasons why, i could go on with the bashing but this
 is not the right place. From now on if i really need eye-candy i'll probably
 use flex or pure javascript or ext, most of the widgets that make
 GWT-EXT/GXT interesting are already available as part of the
 incubator(paging, grids, etc).

 cheers.

 2008/11/13 posta07 [EMAIL PROTECTED]


 Take a look at Ext-GWT (GXT) from extjs.com.

 It's the same extjs widgets written in pure GWT.

 On Nov 13, 9:33 am, Litty Preeth [EMAIL PROTECTED] wrote:
  Hi,
 
  I am using simple GWT in my current project. I wanted to use some GWT-
  EXT widgets also. Can anybody tell me if there is anything to take
  care of when integrating GWT-EXT also to a current GWT project? Are
  there any clashes which might occur?
 
  Thnx n Regards,
  Litty Preeth






 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



MySpace makeRequest req.send(response) doesn't only works on FireFox

2008-11-12 Thread yunhui song
Dear Groups,

   I'm developing a widget for Myspace by GWT. I use JSNI to embed the
opensocial API relative code.

1. add a listener for my panel;

 addListener(new PanelListenerAdapter() {
 public void onActivate(Panel panel) {
 logWindow.log(recordPanel activated.
 callMakeRequest(+_baseUrl+_storeId+));
 callMakeRequest(thisPanel,_baseUrl,_storeId);
 }
 });
 }

2.my jsni code

 private native void callMakeRequest(Panel thisPanel,String
 baseUrl,String storeId) /*-{
$wnd[recordResponse] = function(obj) {
  [EMAIL PROTECTED]
 ::handleResponse(Lcom/magpieradio/client/ui/RecordResponse;)(obj);
};
var os_param = new Array();
os_param[gadgets.io.RequestParameters.METHOD] =
 gadgets.io.MethodType.GET;
os_param[gadgets.io.RequestParameters.CONTENT_TYPE] =
 gadgets.io.ContentType.DOM;
//var url = baseUrl+data.php?al=0myspaceid=+storeId;
var url = 'http://www.magpie.fm/~yunhui_song/bandResource.xml';
gadgets.io.makeRequest(url, recordResponse, os_param);
  }-*/;

 and java-js bridget code

public void handleResponse(RecordResponse br) {
 logWindow.log(call handleResponse);
 String xmlMsg = br.getRecordListing();
 logWindow.log(xmlMsg=+xmlMsg);
 logWindow.log(call refreshByXmlMsg+xmlMsg);
 refreshByXmlMsg(xmlMsg);
 }



 class RecordResponse extends JavaScriptObject {
 // Overlay types always have protected, zero-arg ctors
 protected RecordResponse() {
 }

 public final native String getRecordListing() /*-{
 return this.text;
 }-*/;
 }


I use a debug window to display the output on myspace, alert() doesn't work
on myspace. I told me everything is ok in FireFox3, but When I tested in
other browsers(IE, Chrome,Opera and Safari), this method doesn't work.

gadgets.io.makeRequest(url, recordResponse, os_param);


In chrome and Safari I got the error message:

  Refused to set unsafe header Content-length
  Refused to set unsafe header Connection


After reading documentation from myspace reference and opensocial API
reference in more detail, I don't found any clue about the problem.

Has anybody faced the similiar case? any suggestion is welcome. Thanks in
advance.

Sammi

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Class.forName(String) Instance

2008-11-10 Thread yunhui song
Hi,
   Please check out Guice+Gin. That's the solution for Java Reflection by
GWT.
Sammi

On Mon, Nov 10, 2008 at 11:01 AM, jmpeace [EMAIL PROTECTED] wrote:


 I was wondering if someone could help me out with this problem.

 I need to get and object from an especific class (that extends a class
 named DDOField).

 I'm doing this to get a new instance according to the type requested:

 HashMapString, DDOField availableFields = new HashMapString,
 DDOField();

 availableFields.put(simpletext,  new SimpleTextField());
 availableFields.put(password,  new PasswordField());
 availableFields.put(validated, new ValidatedField());
 availableFields.put(richtext, new RichTextField());
 availableFields.put(textarea, new TextAreaField());
 availableFields.put(simpledate, new SimpleDateField());
 availableFields.put(short, new ShortField());
 availableFields.put(int, new IntField());
 availableFields.put(long, new LongField());
 availableFields.put(enum, new EnumField());
 availableFields.put(boolean, new BooleanField());

 type = simpletext;
 DDOField field = availableFields.get(type);

 That way I get the variable 'field' to point to a new instance of the
 type 'simpletext' (new SimpleTextField()).  The problem is that I'm
 creating 11 new instances just to use one of them.

 I've tried to use Class.forName but it is not supported in GWT, also
 tried GWT.Create() but it didn't work as I expected or maybe I'm doing
 something wrong.

 Any help with this matter will be greatly appreciated.

 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Sleep() or wait() inside valueChanged Listener

2008-11-06 Thread yunhui song
Timer timer = new Timer(){

  public void run(){

  //execute your task here

  }

};

timer.schedule(1);//sleep 1 second

or use DeferredCommand and IncrementCommand. check it on gwt document.

Sammi

http://code.google.com/p/openorg

On Thu, Nov 6, 2008 at 6:29 AM, Anurag Tripathi [EMAIL PROTECTED] wrote:


 Hi,

 Can we call Sleep( ) or wait( ) method for some busy waiting inside
 valueChangedListener without any threads?
 Please let me know if  anybody has idea on this.

 Thanks
 _Anurag

 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: GWT-ext or ext-GWT?

2008-11-05 Thread yunhui song
I've used gwt-ext for about one month and used that for a quite complex real
world project. I've also tried to use ext-gwt.(It seems that ext-gwt support
ext2.2 but gwt-ext suport 2.0.2 and lower version).

From my current understanding, gwt-ext is very stable and has much more
features that ext-gwt.

Sammi


On Wed, Nov 5, 2008 at 12:08 AM, zebulon303 [EMAIL PROTECTED] wrote:



 I am trying to use ext-gwt for a few days, and I get crazy because of
 the really poor documentation available, you only have the code to
 understand what you are doing, and not enough general guidelines. I
 don't know how it is for GWT ext, but I will definitely have a look.

 I am really new with GWT in general, maybe that's why I need more
 documentation. I was trying to figure out how to add a delete button
 to the EditorGrid, or just access the current selected item of the
 grid. I find it really difficult to get to this simple information.
 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Reading XML file from localhost

2008-11-04 Thread yunhui song
Hi mives29,
   I just solve the problem. It's quite direct and easy.

1. upload your xml file to any webserver, e.g. http://a.b.c/test.xml

2. use RequestBuilder to get it. your url.

3. String xmlStr = response.getText();

4. use XMlParser to parse the xmlStr. that's it. Sample snippet code  here:

String url = test.xml;
 RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET,url);
 try {
requestBuilder.sendRequest(null, new RequestCallback() {
public void onError(Request request, Throwable exception) {
}
public void onResponseReceived(Request request, Response response){
 String xmlStr=response.getText();
 //Parse it then.
}
   }
   );
 } catch (RequestException ex) {
 GWT.log(ex.getMessage(), ex);
 }


Hope that helps
Sammi




On Tue, Nov 4, 2008 at 7:24 PM, mives29 [EMAIL PROTECTED] wrote:


 Hi. I'm a newbie in GWT, and I've been tasked to create a utility
 class to parse xml files that the contents would be used in layouting
 the widgets in its container panel (along with other UI
 configurations).

 I've accomplished this by using a service, which uses Java's DOM style
 of parsing. This service returns an array list of serializable objects
 that I created (a POJO that stores the configurations). Then I use the
 POJOs inside that array list to set various stuff in the UI (xpos,
 ypos, etc) for different widgets.


 Then I've found out that GWT has the xml api, that I can use to parse
 my XML. However, XMLParser .parse() only accepts the string
 representation of the actual XML file. I thought that I could do the
 same thing I did with my service implementation (using
 documentbuilder.parse(path-to-xmlfile).

 Now I'm thinking of creating a service that would return a string
 representation of the XML file, then send it to my GWT class and let
 that class handle the parsing. Is this possible? or is this even
 acceptable?

 Ive been seeing stuff on the net using HttpRequest(or RequestBuilder?)
 to get XML from a script, but I dont know how to do that(the example
 was on php.)

 Any idea how can I implement this properly? Thanks

 mives29

 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Sub domain code need update its main domain page content

2008-10-27 Thread yunhui song
Hi Sumit,

 First of all, thank you very much for your response. I'll try your
solution immediately. After that, I'd like share the successful result to
the group(I hope it would be succeed.)

Thanks again,
Sammi


On Mon, Oct 27, 2008 at 11:50 AM, Sumit Chandel [EMAIL PROTECTED]wrote:

 Hi Sammi,
 I think what you need for the cross-site setup is the cross-site bootstrap
 script generated by the GWT compiler.

 You can configure the GWT compiler to generate a cross-site bootstrap
 script by adding the add-linker name=xs / tag in your module XML file.
 The generated module.nocache.js bootstrap script will now be capable of
 cross-site loading.

 By the way, I noticed you mentioned that you're using gwt.js as your
 application bootstrap script, which seems to suggest that you're using an
 older version of GWT (1.4 or prior). If this is the case, I would strongly
 advise upgrading to GWT 1.5.3. If for some reason you have to stick to an
 older version of GWT, you may or may not be able to load your application in
 a cross-site fashion depending on which version of GWT you're using.

 In GWT 1.4, the cross-site bootstrap script is generated by default and can
 be found in the output directory with the name module-xs.nocache.js. In GWT
 1.3, cross-site bootstrapping is not available.

 Hope that helps,
 -Sumit Chandel


 On Fri, Oct 24, 2008 at 4:06 PM, Sammi [EMAIL PROTECTED] wrote:


 Hi,

We use amazon web store application.

 The domain name is store.mydomain.com, the ip is 1.2.3.4;  I can not
 upload any files to this domain.

 Another domain we created is www.mydomain.com, the ip is different.
 2.2.3.4. This is my own server, I can upload files to it.

 And then, I need create an application by modify an specific web
 page(named mystore.html) on store.mydomain.com. I can only change it
 by an submit its content by TextArea Input in an form.

 I choose using GWT to extend the pages function. That means:

 1.  I need add script src=http://www.mydomain.com/files/
 *.nocache.js in mystore.html.
 2.  upload all gwt comiled files to  www.mydomain.com/files/

 Because the gwt js file is not belong to the same domain of
 mystore.html, a access denied error invoked in my firebug error
 console.

 When I dig into the gwt compiled code, I found gwt it is the following
 code which invokes the access denied error:

 $wnd=parent, var [EMAIL PROTECTED]

 parent refers to its parent html page.

 I understand that it is because the Same Domain Constraints.

 I am wondering If I could break through the access denied restrict by
 upload my gwt js files to another domain,like:

   gwtjs.store.mydomain.com

 The ip is same as my own server, www.mydomain.com, that is 2.2.3.4,
 it's different with store.mydomain.com.

 So it is the subdomain of store.mydomain.com, right? but the ip is
 different, it is not the same server.

 Can I use this way to access mystore.html content?

 Any suggestion is welcome. Thanks in advance.

 Sammi











 



-- 
Sammi
http://code.google.com/p/openorg

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: PureMVC

2008-10-26 Thread yunhui song
Hi Thomas,

 I've seen some widgets be injected other widgets but not a single

event listener (or I missed something).


It's true that for my project I only injected some widgets on a main panel.
 That's the project specific choice. Because it's more easy to do that.

I'am not very clear your use case now. Let me have a guess for the use case:

1. We have two widgets w1 and w2, both of them would fire Event clickEvent.

2. We need one Event Listener named CommonEventListener, we expect it can be
used to process clickEvent fired from both w1 and w2.

3. We hope the container, that is Gin to inject when system initialize. So
refractor the code like.
W1 w1 = new W1();
w1.addClickEventListener(new CommonEventListener(p1,p2){});

W2 w2 = new W2();
w2.addClickEventListener(new CommonEventListener(p1,p2){});
by:

  CommonEventListener aCommonEventListener =
injector.getCommonEventListener();
  W1 w1 = injector.getW1();
  w1.addClickEventListener(aCommonEventListener);
  W2 w2 = injector.getW2();
  w2.addClickEventListener(aCommonEventListener);

Because polymorphism is not usable in GWT, we can not use W1 or W2's common
interface or base class as CommonEventListener. My suggestion is:

private W1 w1;
private W2 w2;
@inject
public CommonEventListener(W1 w1,W2 w2){
   //w1 and w2 should be created by ginmodule as singleton instance.
   this.w1 = w1;
   this.w2 = w2;
}

public void onClick(Event e){
   if(e.getSource() == w1){
  //w1.update();
   }else if(e.getSource() == w2){
  //w2.update();
   }
}

I don't think it's an perfect solution(you must change the parameter, as you
said, use ListT is same like ). But it should be able to manage the
listener and ui creation by container and unit test could be implemented
easily.

Hope that is not confusing.

Sammi










On Sun, Oct 26, 2008 at 6:50 PM, Thomas Broyer [EMAIL PROTECTED] wrote:



 On 27 oct, 00:09, yunhui song [EMAIL PROTECTED] wrote:
  Hi,
 
Actually, Gin is used to implements Ioc Container. It can bind
 everything
  not only event Listener.
 
Guice or Spring can do that naturally, but because GWT can not support
  Java reflection, such as forClass(className).getInstance. So Gin use
  generic and annotation to do that.

 Sorry, I should have been clearer: I know what Guice (and Gin) and
 Spring are. Just that they cannot AFAIK inject listeners (i.e. call
 some addXListener method, eventually several times on a single
 instance). Of course you can use method injection with a
 setXListeners(ListXListener) method (should be supported by Gin as
 of today) but I wouldn't call it injecting event listeners; or
 inject event sources or event targets but that's not flexible at all
 (why having event listeners in this case, just keep references to
 the injected widgets and call the appropriate methods on them)

I have a open source project to do that.  GinModule and GindInjector
 are
  key players for that.
please check out here, that's a real world project.
 http://openorg.googlecode.com/svn/trunk/magpie

 I've seen some widgets be injected other widgets but not a single
 event listener (or I missed something).
 



-- 
Sammi
http://code.google.com/p/openorg

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Fwd: PureMVC

2008-10-26 Thread yunhui song
-- Forwarded message --
From: yunhui song [EMAIL PROTECTED]
Date: Sun, Oct 26, 2008 at 8:26 PM
Subject: Re: PureMVC
To: Google-Web-Toolkit@googlegroups.com


Hi Thomas,

 I've seen some widgets be injected other widgets but not a single

event listener (or I missed something).


It's true that for my project I only injected some widgets on a main panel.
 That's the project specific choice. Because it's more easy to do that.

I'am not very clear your use case now. Let me have a guess for the use case:

1. We have two widgets w1 and w2, both of them would fire Event clickEvent.

2. We need one Event Listener named CommonEventListener, we expect it can be
used to process clickEvent fired from both w1 and w2.

3. We hope the container, that is Gin to inject when system initialize. So
refractor the code like.
W1 w1 = new W1();
w1.addClickEventListener(new CommonEventListener(p1,p2){});

W2 w2 = new W2();
w2.addClickEventListener(new CommonEventListener(p1,p2){});
by:

  CommonEventListener aCommonEventListener =
injector.getCommonEventListener();
  W1 w1 = injector.getW1();
  w1.addClickEventListener(aCommonEventListener);
  W2 w2 = injector.getW2();
  w2.addClickEventListener(aCommonEventListener);

Because polymorphism is not usable in GWT, we can not use W1 or W2's common
interface or base class as CommonEventListener. My suggestion is:

private W1 w1;
private W2 w2;
@inject
public CommonEventListener(W1 w1,W2 w2){
   //w1 and w2 should be created by ginmodule as singleton instance.
   this.w1 = w1;
   this.w2 = w2;
}

public void onClick(Event e){
   if(e.getSource() == w1){
  //w1.update();
   }else if(e.getSource() == w2){
  //w2.update();
   }
}

I don't think it's an perfect solution(you must change the parameter, as you
said, use ListT is same like ). But it should be able to manage the
listener and ui creation by container and unit test could be implemented
easily.

Hope that is not confusing.

Sammi










On Sun, Oct 26, 2008 at 6:50 PM, Thomas Broyer [EMAIL PROTECTED] wrote:



 On 27 oct, 00:09, yunhui song [EMAIL PROTECTED] wrote:
  Hi,
 
Actually, Gin is used to implements Ioc Container. It can bind
 everything
  not only event Listener.
 
Guice or Spring can do that naturally, but because GWT can not support
  Java reflection, such as forClass(className).getInstance. So Gin use
  generic and annotation to do that.

 Sorry, I should have been clearer: I know what Guice (and Gin) and
 Spring are. Just that they cannot AFAIK inject listeners (i.e. call
 some addXListener method, eventually several times on a single
 instance). Of course you can use method injection with a
 setXListeners(ListXListener) method (should be supported by Gin as
 of today) but I wouldn't call it injecting event listeners; or
 inject event sources or event targets but that's not flexible at all
 (why having event listeners in this case, just keep references to
 the injected widgets and call the appropriate methods on them)

I have a open source project to do that.  GinModule and GindInjector
 are
  key players for that.
please check out here, that's a real world project.
 http://openorg.googlecode.com/svn/trunk/magpie

 I've seen some widgets be injected other widgets but not a single
 event listener (or I missed something).
 



-- 
Sammi
http://code.google.com/p/openorg



-- 
Sammi
http://code.google.com/p/openorg

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: PureMVC

2008-10-26 Thread yunhui song
Hi Thomas,

 I've seen some widgets be injected other widgets but not a single

event listener (or I missed something).


It's true that for my project I only injected some widgets on a main panel.
 That's the project specific choice. Because it's more easy to do that.

I'am not very clear your use case now. Let me have a guess for the use case:

1. We have two widgets w1 and w2, both of them would fire Event clickEvent.

2. We need one Event Listener named CommonEventListener, we expect it can be
used to process clickEvent fired from both w1 and w2.

3. We hope the container, that is Gin to inject when system initialize. So
refractor the code like.
W1 w1 = new W1();
w1.addClickEventListener(new CommonEventListener(p1,p2){});

W2 w2 = new W2();
w2.addClickEventListener(new CommonEventListener(p1,p2){});
by:

  CommonEventListener aCommonEventListener =
injector.getCommonEventListener();
  W1 w1 = injector.getW1();
  w1.addClickEventListener(aCommonEventListener);
  W2 w2 = injector.getW2();
  w2.addClickEventListener(aCommonEventListener);

Because polymorphism is not usable in GWT, we can not use W1 or W2's common
interface or base class as CommonEventListener. My suggestion is:

private W1 w1;
private W2 w2;
@inject
public CommonEventListener(W1 w1,W2 w2){
   //w1 and w2 should be created by ginmodule as singleton instance.
   this.w1 = w1;
   this.w2 = w2;
}

public void onClick(Event e){
   if(e.getSource() == w1){
  //w1.update();
   }else if(e.getSource() == w2){
  //w2.update();
   }
}

I don't think it's an perfect solution(you must change the parameter, as you
said, use ListT is same like ). But it should be able to manage the
listener and ui creation by container and unit test could be implemented
easily.

Hope that is not confusing.

Sammi

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: PureMVC

2008-10-23 Thread yunhui song
Hi

   I have used Guice and Gin to implements MVC framework(like backend spring
framework). By this way view(ui), event Listener and data
access(xmlHttpReqeust wrapped by REST-GWT) can be seperated by three layers.

   Gin module used to initialize and couple all the instance used in the GWT
module. It's a typicall Ioc container. I found it is rocking by this way in
my project.

Sammi

On Thu, Oct 23, 2008 at 8:06 AM, Flemming Boller
[EMAIL PROTECTED]wrote:

 Hi
 We have done it like the mediator has a reference to the view (which
 implements a gwt- neutral interface).

 The View has a hard reference the mediator.

 We want the mediator to be unaware of GWT because that means we are able
 to perform many junit tests of the gui
 without using the GETTestCasewhich is a no-go Testcase :-)


 Please let me hear how you progress and the experiences you have with
 puremvc

 /FLeming


 On Thu, Oct 23, 2008 at 2:11 PM, marcelo melo [EMAIL PROTECTED]wrote:


 Totally agree with you... Simplicity is key most of the times (at
 least it should :) ).

 I have one question that is really annoying me. Having used it
 (puremv) with Flex, it is easy to fire an event at the View and
 associate it with a method at the Mediator. But, how to deal with it
 on GWT? I am adding the Mediator as the event listener of the View (by
 making it implement the relevant View listeners - ClickListener,
 etc.), but I'm not quite sure if it's the best way to do it...

 Any ideas?

 Thanks!

 On Thu, Oct 23, 2008 at 9:53 AM, Flemming Boller
 [EMAIL PROTECTED] wrote:
  Yes I am.  I think is it rather nice little MVC implementation, which
 has
  made it more easy for us to make
  components talk to each other in a loosely coupled way.
 
  Minus is however, that it easy also to create a spider web of
 notifications
  that is hard to overview.
 
  But common sense and keep it simple should be used here :-)
 
 
  /Flemming
 
 
 
 
  On Thu, Oct 23, 2008 at 1:48 PM, marcelo melo [EMAIL PROTECTED]
  wrote:
 
  Hi, is anyone using PureMVC for Java / GWT?
 
  Thanks
 
 
 
 
  
 




 



-- 
Best Regards,
Sammi

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---