Tuesday, May 1, 2012

EventBus mechanism

Hi everyone, now that i am working with GWT i am facing a problem with
the event handling mechanism the first problem was (
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/17b679b499311756/8f06531e30bf0996#8f06531e30bf0996
), but when i read this article MVP II (
https://developers.google.com/web-toolkit/articles/mvp-architecture-2
) - actually i read it several times - i still don't understand when u
to use EventBus mechanism and when not ? and if i have to use when u
use EventBus Handler and HandlerManage ?.
Here is what confuses me:

public class ContactsPresenter implements Presenter,
ContactsView.Presenter<ContactDetails> {
......
public void onAddButtonClicked() {
eventBus.fireEvent(new AddContactEvent());
}

public void onDeleteButtonClicked() {
deleteSelectedContacts();
}

public void onItemClicked(ContactDetails contactDetails) {
eventBus.fireEvent(new EditContactEvent(contactDetails.getId()));
}

....
}

Why one method fires and event and the other just do some logic witch
is defined the class ?

Thank you all for your replies.

the source code of the example is here :
http://google-web-toolkit.googlecode.com/files/Tutorial-Contacts2.zip

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

Re: Problems compiling internationalisation files with GWT 2.0



On Friday, December 11, 2009 4:45:44 PM UTC+5:30, grandfatha wrote:
Changing the name of my interface and the properties files resolved at
least my issue. No clue what was wrong with the old one... It simply
disliked it.

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

Re: GWT applications session management

From what i understand he means something like this

public class CustomerServiceImpl extends RemoteServiceServlet
implements CustomerService {



public void authorize(String username, String password) {
// check the username and password
// if everything is OK ...

getThreadLocalRequest().getSession().setAttribute("username",username);

}

.....

}

or something like that !

On Apr 30, 4:14 pm, Harpreet Singh <harpreetsingh...@gmail.com> wrote:
> I am clear on most of it.
> Can you explain, "placing session objects on the Service implementation" a
> little more?
>
>
>
>
>
>
>
> On Mon, Apr 30, 2012 at 2:01 PM, Adio <fireball...@gmail.com> wrote:
> > Thanks for the reply.
>
> > On Apr 27, 7:10 pm, Joseph Lust <lifeofl...@gmail.com> wrote:
> > > See  https://www.google.com/search?q=google+web+toolit+overview
>
> > > Joe
>
> > --
> > 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: Abridged summary of google-web-toolkit@googlegroups.com - 44 Messages in 20 Topics


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

Re: Installing gwt on RAD 7.5

Yes, I've experienced these problem (and the rest of my team too) (with the 8 version too). 

Are you sure that you don't have Available Software Sites (I've attached an img. We are speaking about the same "Available Software Sites", aren't we?) It's very strange. 

Did you try to uninstall and install again? Did you introduce your licences?

2012/4/30 Pinar Ozlen <p.ozlen@gmail.com>
Hi,

Many Thanks for your reply, 
but i dont have  Available Software Sites  option under the  windows>Preferences>Install/Update

did you exprienced this problem?


2012/4/30 Adolfo Panizo Touzon <adolfo.panizo@gmail.com>
Yes, it's possible. I had problems too.

I've solved by going to "windows>Preferences>Install/Update>Available Software Sites" and clicking in Eclipse Helios 3.6 and Helios Milestone Repository.

The exactly path that you have to use is: http://dl.google.com/eclipse/plugin/3.6

PD. The rest of my team had to add more software sites, so..., play and try. 

Regards,

Adolfo.


2012/4/30 kmspnr <p.ozlen@gmail.com>

Hi All,
I am new joined to this group,
I need to install GWT plugin on rad 7.5 but getting error for mylyn
plugin requirement message.
So, as explained here i am adding this link to find and install--
>software remote site
"http://download.eclipse.org/releases/helios"

but it cannot import the site pakages,
I want to ask if installing gwt on rad 7.5 is possible?
if possible what is the path that i need to follow?

Thanks in advance.

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




--
El precio es lo que pagas. El valor es lo que recibes.
Warren Buffet

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



--
El precio es lo que pagas. El valor es lo que recibes.
Warren Buffet

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

Re: how to make a clickable image cell?

Let's say I created this for my AbstractCell:
sb.appendHtmlConstant("<div class = 'contactCell'>");
sb.appendHtmlConstant("<table>");      
sb.appendHtmlConstant("<tr>");
sb.appendHtmlConstant("<td id = contactId'>");    
sb.appendHtmlConstant("John Doe");    
sb.appendHtmlConstant("</td>");
sb.appendHtmlConstant("<td id = contactImage rowspan='3'>");    
sb.appendHtmlConstant("<img src = some_imge_url width=60 height=60>");
sb.appendHtmlConstant("</td>");
sb.appendHtmlConstant("</tr>");
sb.appendHtmlConstant("</table>");
sb.appendHtmlConstant("</div>");

Then, if I want the image to respond, I can check it by doing this:
EventTarget eventTarget = event.getEventTarget();
if(eventTarget.toString().contains("<td id=\"contactImage\">") && !eventTarget.toString().contains("<div class")){        
           Window.alert("image clicked!");
}else if(eventTarget.toString().contains("<td id=\"contactId\">") && !eventTarget.toString().contains("<div class")){         
           Window.alert("id clicked!");
}

Just try printing out eventTarget, then you'll see what kind of response you get when you click on the cell


On Mon, Apr 30, 2012 at 10:59 AM, Kei Kei <tong123123@gmail.com> wrote:
my method is similar to you, but I found one problem using these kind of method, the respond to click event is hard coded in
public void onBrowserEvent(Context context, Element parent, String value, NativeEvent event, ValueUpdater<String> valueUpdater)
for example,
if I create an instance of HeaderCell() headerCell1, and then I create another instance headerCell2, click on these two instances will have the same response hard code in the class HeaderCell().
// do something if it's indeed the image that was clicked
what should I do if I want click on each instance of HeaderCell() will have its custom logic?



On Wed, Apr 25, 2012 at 4:10 PM, Interbooker App <interbookerapp@gmail.com> wrote:

I'm not really sure if this is the best implementation, but it works for me. -- First, add this to your constructor:

  public HeaderCell() {

   
super("click", "keydown");
}

-- Then, override the onBrowserEvent:

  @Override
   
public void onBrowserEvent(Context context, Element parent, String value, NativeEvent event, ValueUpdater<String> valueUpdater) {
     
// Let AbstractCell handle the keydown event.

     
super.onBrowserEvent(context, parent, value, event, valueUpdater);
 
     
// Handle the click event.
     
if ("click".equals(event.getType())) {
       
EventTarget eventTarget = event.getEventTarget();
       
// in here we check whether the cell that was being clicked is an image, not the entire cell
       
if(eventTarget.toString().contains("img src") && !eventTarget.toString().contains("<div class")){
           
// do something if it's indeed the image that was clicked
       
}
     
}
   
}

Cheers, Lin


On Fri, Apr 20, 2012 at 10:38 AM, tong123123 <tong123123@gmail.com> wrote:
I found the answer finally, I wrongly import the
com.google.gwt.user.client.Element;
instead of
com.google.gwt.dom.client.Element;

On Friday, April 20, 2012 4:14:44 PM UTC+8, tong123123 wrote:
I got some insight but still not clear, it show that

public void onBrowserEvent(Context context, Element parent, String value,
        NativeEvent event, ValueUpdater<String> valueUpdater)

in ClickableImageCell2 is not override

public void onBrowserEvent(Context context, Element parent, C value,
      NativeEvent event, ValueUpdater<C> valueUpdater)
in AbstractCell,
but why in the api,
http://google-web-toolkit.googlecode.com/svn/javadoc/2.4/com/google/gwt/cell/client/AbstractCell.html#onBrowserEvent%28com.google.gwt.cell.client.Cell.Context,%20com.google.gwt.dom.client.Element,%20C,%20com.google.gwt.dom.client.NativeEvent,%20com.google.gwt.cell.client.ValueUpdater%29

Class ContactCell,

@Override      public void onBrowserEvent(Context context, Element parent, Contact value,          NativeEvent event, ValueUpdater<Contact> valueUpdater) 

is override of AbstractCell?

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

Re: How to build text trimming cell for GWT DataGrid

@Jens,

Just to expand on Jen's answer. For this solution to work, you need to
apply it to a div inside a cell:

.myDataGrid td div {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

> Apply CSS to your cell:
>
> white-space: nowrap;
> overflow:hidden;
> text-overflow: ellipsis;
>
> -- 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.