On 20/11/2007, Nino Saturnino Martinez Vazquez Wael
<[EMAIL PROTECTED]> wrote:
> Bump for replies..? Does my mail make sense? Do I need to specify
> anything further?
>
> Nino Saturnino Martinez Vazquez Wael wrote:
> > Hi
> >
> > I've been "playing" with both forms and listviews. And I wanted to
> > extend a form creating my own form that has captcha validation as
> > standard, I cant just seem to find where to place the markup when
> > extending Form?

Well, off-hand, I'd expect that the easiest way would be to do it
using markup inheritance -
http://wicket.apache.org/examplemarkupinheritance.html.

> > I then tried doing it with a panel but also ran into
> > sometroubles.

> >
> > Also I've been noticing that if you use a compound model with a
> > listview forexample my page has a  compound model called article I add
> > the listview new listview("comments"). I would expect my item in the
> > populate implementation to get fed a comment compoundmodel, but it
> > does only get the compound model for the page, I then have to call
> > item.getModelObject and set the compundmodel manually. Is this
> > something that has been overseen, or am I missing the bigger picture?

I think so...  Compare this...

HTML:
        <ul wicket:id="comments">
                <li wicket:id="comment">Dummy comment</li>
        </ul>

Java: (compressed for vertical size!)

  class Article {
    private List comments = Arrays.asList(new String[]{"Comment One",
"Comment Two", "Comment Three"});
    public List getComments() { return comments; }
  }

and

  public MyPage(final PageParameters parameters) {
    setModel(new CompoundPropertyModel(new Article()));
    ListView listView = new ListView("comments") {
      protected void populateItem(ListItem item) {
        item.add(new Label("comment", (String)item.getModelObject()));
      }
    };
  }
  add(listView);

gives the following output:

    * Comment One
    * Comment Two
    * Comment Three


/Gwyn
-- 
Download Wicket 1.3.0-rc1 now! - http://wicketframework.org

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to