1
<div class="post">
   <div class="post-user-image">
         image
   </div>

   <div class="post-content">
        <h4>
        link to user profile, firstname and last name of the post owner
        </h4>  
        <p>......messege itself......</p>
        <div class="post-footer">
            post --> date and post --> likes...
        </div>
  </div>
</div> 

ユーザーウォールへの投稿を表す上記のhtmlコードがあり、ユーザーがGWTを使用している投稿の数だけこれを繰り返したいと思います。問題へのアプローチ方法がわからない GWT を既存の html コードに統合することに慣れていない。

4

1 に答える 1

2

You can get familiar with GWT from the resources at the GWT Dev guide.

For your particular problem, I suggest you look at UiBinder.

You can use your HTML snip as the template for a UiBinder GWT widget. Your widget would have parameters for the image/link/content/whatever you want to display.

Let's call your widget Post. Every time you want to add a new instance to the display you might do something like this:

// Crete and populate our Post
Post newPost = new Post();
newPost.setUsername("XXX");
newPost.setLink("xxx");
newPost.setDate("xxx");

// Display the post.
postContainer.add(newPost);

Note that 'postContainer' could be anything - one of the GWT Panels, a custom container you are using to display the widgets into, etc.

于 2012-12-04T02:00:44.387 に答える