I used my name page otherwise it wouldn't have compiled :).
Here is the markup :

<wicket:extend>
<a href="" wicket:id="createLink">Create New Contact</a><br/><br/>
<table wicket:id="users" cellspacing="0" cellpadding="2" class="grid">
  <wicket:fragment id="addr-frag">
    <select wicket:id="dropdown"></select>
  </wicket:fragment>
</table>
</wicket:extend>

and here is the populateItem method :

 public void populateItem(final Item item, final String componentId, final
                             IModel rowModel)
    {
      Fragment frag = new Fragment(componentId, "addr-frag",       
                                                    ListContactsPage.this);
      item.add(frag);
      frag.add(new DropDownChoice("dropdown", new PropertyModel(rowModel,
                                    "addresses"), new IChoiceRenderer()
                                                    {
                                                      public String getIdValue(Object o, int idx)
                                                      {
                                                        return String.valueOf(idx);
                                                      }

                                                      public String getDisplayValue(Object o)
                                                      {
                                                        return((Address)o).getStreet();
                                                      }
                                                    }));
      }

as I mentioned it seems a problem that has to do with the DataTable markup, since in the exception a cell element is displayed.

Jaime.




Igor Vaynberg <[EMAIL PROTECTED]> wrote:
you need to be more careful when copying code :)

Fragment frag=new Fragment(componentId, "addresses-frag", Mypage.this);

which in your case would be

Fragment frag=new Fragment(componentId, "addresses-frag", ListContactsPage.this);

-Igor

On 9/26/06, Jaime De La Jara <[EMAIL PROTECTED]> wrote:
I tried the code, but it throws the following exception :

Exception : wicket.markup.MarkupException: Markup does not contain a fragment with id=addr-frag; Component: [MarkupContainer [Component id = cell, page = wicket.contrib.phonebook.web.page.ListContactsPage , path = 2:users:rows:1:cells:7:cell.Fragment, isVisible = true, isVersioned = true]]

I included the fragment in the ListContactsPage as follows :

<wicket:extend>
<a href="" wicket:id="createLink">Create New Contact</a><br/><br/>
<table wicket:id="users" cellspacing="0" cellpadding="2" class="grid">

  <wicket:fragment id="addr-frag">
    <select wicket:id="dropdown"></select>
  </wicket:fragment>

</table>
</wicket:extend>

It seems that it is expecting to find the fragment inside the markup of DataTable.
What can be wrong?

Thanks,

Jaime.






Igor Vaynberg < [EMAIL PROTECTED]> wrote:
dont quote me on this

in MyPage.html
<wicket:fragment id="addresses-frag"><select wicket:id="dropdown"></select></wicket:fragment>

class MyPage {

class AddressColumn extends AbstractColumn {

void populateItem(final Item cellItem, final String componentId, final IModel rowModel) {
  Fragment frag=new Fragment(componentId, "addresses-frag", Mypage.this);
  item.add(frag);

  frag.add (new DropDownChoice("dropdown", new PropertyModel(rowModel, "addresses", new IChoiceRenderer() {
  String getId(Obect o, int idx) { return idx}
String getDisplayValue(Object o) { return ((Address)o).getStreet(); }});


}

}

-Igor


On 9/26/06, Jaime De La Jara < [EMAIL PROTECTED]> wrote:
Hi, playing with the phonebook example app I added a collection field to Contact class, this field is a collection of instances of class Address which has two String fields : city and street. I'd like to display a drop down choice containing the street property for each address instance that a contact has, How could I achieve this?

Thanks,

Jaime.

Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small Business.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user


All-new Yahoo! Mail - Fire up a more powerful email and get things done faster.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user


How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone call rates.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to