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 Thomas Broyer


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.



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.



Re: UiBinder view inheritance troubles

2012-04-04 Thread Thomas Broyer


On Wednesday, April 4, 2012 9:32:06 AM UTC+2, Márcio Menezes wrote:

 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?


Could you give more information? How and where is the base view adding 
widgets? How and where child views add their own widgets?

One thing is: you cannot use a single class hierarchy as the target for two 
UiBinders; that is, you cannot have a UiBinder?,BaseView and a 
UiBinder?,ChildView with ChildView extends BaseView. You can, for 
example, move your @UiFields from one of the classes to another class (e.g. 
declare an inner class in BaseView and move the @UiFields to that class, 
then use a UiBinder?,BaseView.UiFieldHolder; that way, the 
UiBinder?,ChildView won't conflict with the BaseView)

But it's really hard to give advice as we don't know what you're trying to 
do, how you're trying to do it, and what's the problem (error message) 
exactly.

-- 
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/-/7svZNGfjvLIJ.
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-04 Thread Philippe Lhoste

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