Re: UiBinder view inheritance troubles

2012-04-05 Thread Márcio Menezes
Hey, guys, thanks for the answers...

Thomas, I think what u said is the cause of my problem. I have two ui.xml
files, one for the super and another for the sub class. And I'm trying to
bind both and put them together in a container afterwards.. ://
I see the limitation, you cannot use a single class hierarchy as the
target for two UiBinders. But I didn't want to have to move the fields of
the super class to the sub or the other way around.
What I'm trying to get is a view extending from another view. Why do I want
to do this? Because I have a set of views with the same visual pattern, ie:
CRUD views that need to have save and cancel button, and I didn't want to
repeat my self in all the sub views by re-adding the save and cancel
button. Nothing new... Pure O.O. concepts.

Really? Isn't there a way of doing this?

Hugs

On Wed, Apr 4, 2012 at 1:19 PM, Philippe Lhoste phi...@gmx.net wrote:

 On 04/04/2012 09:32, Márcio Menezes wrote:

 I'm migrating all my views from the old style to @UiBinder based and I'm
 facing some troubles
 I used to have base views (Composite) in charge of adding common
 components, ie:
 EditModelBaseView is in charge of adding the save and cancel button, so
 that all the sub
 views will render those components by inheritance.
 I can't get it to work... I would need a sort of xml inheritance, besides
 the the class
 inheritance, but this doesn't seem to be possible because the compiler
 complains stating
 the inherited attributes aren't declared in the subview ui.xml. How would
 this approach be
 matched with UiBinder based views?


 As Thomas said, it is hard to see what is your exact problem, but for what
 it is worth, you can declare UiBinder components and re-use them, like:

 ui:UiBinder
  xmlns:ui='urn:ui:com.google.**gwt.uibinder'
  xmlns:g=urn:import:com.**google.gwt.user.client.ui
  xmlns:our=urn:import:com.our.**company.web.client
  

 then use it as:

 our:MenuBar/
 or
 our:subpackage.**OtherComponent/

 The components must be quite autonomous, perhaps exposing an API for using
 from other components.

 --
 Philippe Lhoste
 --  (near) Paris -- France
 --  http://Phi.Lho.free.fr
 --  --  --  --  --  --  --  --  --  --  --  --  --  --


 --
 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.comgoogle-web-toolkit@googlegroups.com
 .
 To unsubscribe from this group, send email to google-web-toolkit+**
 unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at http://groups.google.com/**
 group/google-web-toolkit?hl=enhttp://groups.google.com/group/google-web-toolkit?hl=en
 **.



-- 
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: UiBinder view inheritance troubles

2012-04-05 Thread Márcio Menezes
Hmm... not bad...

Thanks a lot! :)

On Thu, Apr 5, 2012 at 12:12 PM, Thomas Broyer t.bro...@gmail.com wrote:



 On Thursday, April 5, 2012 11:58:14 AM UTC+2, Márcio Menezes wrote:

 Hey, guys, thanks for the answers...

 Thomas, I think what u said is the cause of my problem. I have two ui.xml
 files, one for the super and another for the sub class. And I'm trying to
 bind both and put them together in a container afterwards.. ://
 I see the limitation, you cannot use a single class hierarchy as the
 target for two UiBinders. But I didn't want to have to move the fields of
 the super class to the sub or the other way around.
 What I'm trying to get is a view extending from another view. Why do I
 want to do this? Because I have a set of views with the same visual
 pattern, ie: CRUD views that need to have save and cancel button, and I
 didn't want to repeat my self in all the sub views by re-adding the save
 and cancel button. Nothing new... Pure O.O. concepts.

 Really? Isn't there a way of doing this?


 Use composition rather than inheritance; or use the inner class trick I
 described earlier (that's entirely private to the super-class, so it
 shouldn't affect your subclasses).

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-web-toolkit/-/QSD7bV1AYHcJ.

 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.


-- 
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.



UiBinder view inheritance troubles

2012-04-04 Thread Márcio Menezes
Hi all.
I'm migrating all my views from the old style to @UiBinder based and I'm
facing some troubles
I used to have base views (Composite) in charge of adding common
components, ie: EditModelBaseView is in charge of adding the save and
cancel button, so that all the sub views will render those components by
inheritance.
I can't get it to work... I would need a sort of xml inheritance, besides
the the class inheritance, but this doesn't seem to be possible because the
compiler complains stating the inherited attributes aren't declared in the
subview ui.xml. How would this approach be matched with UiBinder based
views?

Marcio

-- 
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.



Reading annotation values in runtime

2010-12-16 Thread Márcio Menezes
Hi,
I have to implement an authorization mechanism where I should be able to
define which fields in a view the user has access to: Read / Edit.
The idea that I had was to put annotations on top of those fields saying the
permission the user must have in order to interact with that field. To get
this, I would need to use some reflection when I am instantiating the view
to make it iterate through
all its annotated fields, check if the session user has that grant and apply
visible/enabled on that field.

Is it possible?? What would be the best solution to do this? Is there some
framework doing this already?

Ps: I took a look at some of them, like ACRIS, but it's pretty huge for what
I need. Besides, all the secured fields need to implement some interfaces
and all the fields need to be instantiated with GWT.create() - of course,
but would be much better if I could use this just on the view instantiation.

Regards, Marcio

-- 
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.



RequestBuilder POST + setHeader() = OPTIONS

2010-10-21 Thread Márcio Menezes
Hi!.
Why does everytime I try to send a POST through RequestBuilder class and if
I add some header into it, the method goes as an OPTIONS, instead of post?

Has anyone experienced this? How can I work around it?

Regards,
Marcio

-- 
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.



Re: RequestBuilder POST + setHeader() = OPTIONS

2010-10-21 Thread Márcio Menezes
Ok... but it happens with ANY header. Even if I add Content-Type,
application/x-www-form-urlencoded, as you suggested, it sends an OPTIONS
method, instead of POST.


On Thu, Oct 21, 2010 at 4:46 PM, Brett Thomas brettptho...@gmail.comwrote:

 POST values should be encoded in the request data string, not the headers.
 Not sure why there isn't an addPostValue method too. Here's some code I used
 recently:

 class CustomPOSTBuilder extends RequestBuilder {

 private String request = ;

 public CustomPOSTBuilder(String url, RequestCallback callback) {
 super(RequestBuilder.POST, url);
 this.setHeader(Content-Type,
 application/x-www-form-urlencoded);
 this.setCallback(callback);
 }

 public void addPost(String key, String value) {
 request += key + = + value + ;
 }

 public void go() {
 this.setRequestData(request);
 try {
 this.send();
 }
 catch (RequestException r){
 System.out.print(r.getMessage());
 }
 }

 }

 then send a request by:
 CustomPOSTBuilder builder...
 builder.addPost(key1, value1);
 builder.addPost(key2, value2);
 builder.send();


 2010/10/21 Márcio Menezes marcio@gmail.com

 Hi!.
 Why does everytime I try to send a POST through RequestBuilder class and
 if I add some header into it, the method goes as an OPTIONS, instead of
 post?

 Has anyone experienced this? How can I work around it?

 Regards,
 Marcio

 --
 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.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


  --
 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.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


-- 
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.



Re: RequestBuilder POST + setHeader() = OPTIONS

2010-10-21 Thread Márcio Menezes
BTW... Browser Firefox 3.6

2010/10/21 Márcio Menezes marcio@gmail.com

 Ok... but it happens with ANY header. Even if I add Content-Type,
 application/x-www-form-urlencoded, as you suggested, it sends an OPTIONS
 method, instead of POST.



 On Thu, Oct 21, 2010 at 4:46 PM, Brett Thomas brettptho...@gmail.comwrote:

 POST values should be encoded in the request data string, not the headers.
 Not sure why there isn't an addPostValue method too. Here's some code I used
 recently:

 class CustomPOSTBuilder extends RequestBuilder {

 private String request = ;

 public CustomPOSTBuilder(String url, RequestCallback callback) {
 super(RequestBuilder.POST, url);
 this.setHeader(Content-Type,
 application/x-www-form-urlencoded);
 this.setCallback(callback);
 }

 public void addPost(String key, String value) {
 request += key + = + value + ;
 }

 public void go() {
 this.setRequestData(request);
 try {
 this.send();
 }
 catch (RequestException r){
 System.out.print(r.getMessage());
 }
 }

 }

 then send a request by:
 CustomPOSTBuilder builder...
 builder.addPost(key1, value1);
 builder.addPost(key2, value2);
 builder.send();


 2010/10/21 Márcio Menezes marcio@gmail.com

  Hi!.
 Why does everytime I try to send a POST through RequestBuilder class and
 if I add some header into it, the method goes as an OPTIONS, instead of
 post?

 Has anyone experienced this? How can I work around it?

 Regards,
 Marcio

 --
 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.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


  --
 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.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.




-- 
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.



JsonpRequestBuilder Timeout - GWT 2.0

2010-06-30 Thread Márcio Menezes
Hello!
I'm trying to retrieve Json using JsonpRequestBuilder.
When I use some external url, like this one
http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDemoquery=Madonnaoutput=json,
everything works fine.
But, when I try to fetch json from some server inside my network, I get
timeout error (Timeout while calling http://192.168.2.12/gwt.js).

When I check the request on firebug, I can see that the response came back
and its body is exactly what I was suppose to receive. Somehow, it is not
being handled by the callback function.

If I try the same URL through browser, it works fine.

Does anyone know what it can be?

Marcio

-- 
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.