I'll have to pick this up in the morning, if I stare at this for
another minute I'm going to lose it.

I'll create a test case for you tomorrow and send it unless I just
find a rigged-work-around to get this thing out the door using a
ListView or something.

Thanks!

On 5/22/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
download wicket-quickstart project

hack Index page to reproduce the problem

i dont need your entire app, just looking at the code youve sent all i need
from your app is maybe the category object, then instead of calling product
proxy create the list of cats yourself.

then zip up quickstart into a zip and attach it. that way i can download,
open and run it and see the problem myself so i can walk it in the debugger.


-Igor


On 5/22/06, Vincent Jenks <[EMAIL PROTECTED]> wrote:
> Sure, how?  Maybe I'm misunderstanding?  I can't stick the whole app
> in there, however.  Maybe I could just send you both of the entire
> files (java + html)?
>
> I've found that if I set it to 1 column, it renders w/o an exception.
> If I set it to 3 columns, it bombs.  When it does render, I see one
> row w/ 3 items even though there are 5 items.  Weird.
>
> On 5/22/06, Igor Vaynberg <[EMAIL PROTECTED] > wrote:
> > do you want to stick this into wicket-quickstart and let me take a look?
it
> > is the most efficient way i can find the problem
> >
> >
> > -Igor
> >
> >
> > On 5/22/06, VGJ < [EMAIL PROTECTED]> wrote:
> > >
> > >
> > > ok, riddle me this, Batman.
> > >
> > > I changed it to just look like:
> > >
> > > item.add(new GridView("name", provider)
> > > {
> > > };
> > >
> > > Whereas before, I was creating the GridView, *then* adding it to the
> > top-level ListView in two separate steps.
> > >
> > > I'm sure my hierarchy before was right because I can simply change
what I
> > show above to
> > >
> > > GridView gv = new GridView("name", provider)
> > > {
> > > };
> > >
> > > item.add(gv);
> > >
> > > ...and, I get the hierarchy exception!
> > >
> > > I'd be fine w/ the "fix" I came up w/, however, I can't get more than
one
> > row to appear.
> > >
> > > I did this:
> > >
> > > item.add(new GridView("name", provider)
> > > {
> > > }.setRows(3).setColumns(3));
> > >
> > > ...however, I only get one row no matter how many items there are.  If
I
> > switch back to the old ListView I was using, sure enough, all 5 items
show
> > up in a single row.
> > >
> > > any ideas?
> > >
> > >
> > > On Mon, 2006-05-22 at 15:52 -0700, Igor Vaynberg wrote:
> > >
> > >
> > > where is the populateEmptyItem you are supposed to implement for the
> > gridview? this method populate left over cells and is probably what is
> > causing the hierarchy mismatch.
> > >
> > > also here is how to implement detachable idataprovider:
> > >
> > > class mydataprovider implemetns IDataProvider, IDetachable {
> > >    private transient List list;
> > >
> > >    public void detach() { list=null; }
> > >
> > >    public iterator iterateor(int first, int last) {
> > >        return getlist().listiterator(first);
> > >    }
> > >
> > >    public int size() {
> > >       return getlist().size();
> > >    }
> > >
> > >    private List getlist() {
> > >        if (list==null) {
> > >             list=...load list here
> > >         }
> > >         return list;
> > >    }
> > > }
> > >
> > > -Igor
> > >
> > >
> > >
> > >
> > > On 5/22/06, Vincent Jenks < [EMAIL PROTECTED]> wrote:
> > >
> > > Yeah, that's what I figured given the example, however that's where my
> > > problem lies.  The items I'm adding in populateItem in the GridView
> > > can't be found, I'm getting the hierarchy problem exception.
> > >
> > > Here's what I'm doing in the page as an overview:
> > >
> > > 1. List Product Categories (ListView)
> > >   2. for each Category, retrieve and display Products (GridView)
> > >     3. Display 3-column table w/ Product details ("cols" in GridView)
> > >
> > > Here's the code:
> > >
> > >                 //add ListView object to page w/ data
> > >                 add(new ListView("categoryView", categoryModel)
> > >                 {
> > >                         protected void
> > populateItem(ListItem item)
> > >                         {
> > >                                 //get catagory item
> > >                                 final ProductCategory
> > category = (ProductCategory)item.getModelObject();
> > >
> > >                                 //add category label
> > >                                 item.add(new
> > Label("category", category.getName()));
> > >
> > >                                 //STILL DON'T
UNDERSTAND
> > HOW TO PASS THIS INTO GRIDVIEW
> > >                                 IModel productModel =
new
> > LoadableDetachableModel()
> > >                                 {
> > >                                         protected
Object
> > load()
> > >                                         {
> > >
return
> > ProductProxy.getProducts (category);
> > >                                         }
> > >                                 };
> > >
> > >                                 IDataProvider
provider =
> > new
> > > ProductDataProvider(ProductProxy.getProducts(category)); //HARDCODED,
> > > NOT DETACHED!  SEE DETACHED MODEL ABOVE!
> > >                                 GridView productView
=
> > new GridView("productView", provider)
> > >                                 {
> > >                                         protected
void
> > populateItem(Item item)
> > >                                         {
> > >                                                 //get
> > product item
> > >                                                 final
> > Product product = (Product)item.getModelObject();
> > >
> > >
//create
> > thumbnail link w/ event
> > >                                                 Link
> > thumbnailLink = new Link("thumbnailLink")
> > >                                                 {
> > >
> >  public void onClick()
> > >
  {
> > >
> >       setResponsePage(new ProductDetail(product));
> > >
  }
> > >                                                 };
> > >
> > >                                                 //add
> > attribute modifier
> > >
> > thumbnailLink.add(wmc);
> > >
> > >                                                 //add
> > thumbnail link
> > >
> > item.add(thumbnailLink);
> > > .....
> > >
> > > You'll notice I've got a detached model in there...right now it's not
> > > being used since I haven't figured out how to send detached data from
> > > this page into the IDataProvider derived class (another issue, not to
> > > get off track, sorry!)
> > >
> > > Here's my HTML, I'm sure it's fantastically wrong but I need to see it
> > > rendered to decide if it looks right:
> > >
> > > ...............
> > >
> > >                                                 <tr
> > wicket:id="categoryView">
> > >
> > <td>
> > >
> >       <span wicket:id="category"
> > class="titleSmall">category</span>
> > >
> >       <hr width="100%" size="1" />
> > >
> >       <br />
> > >
> >       <table width="200" align="left"
> > wicket:id="productView">
> > >
> >               <tr>
> > >
> >                       <td wicket:id="cols">
> > >
> >                               <table
> > width="200" align="left">
> > >
> >                                       <tr>
> > >
> >
> >    <td>
> > >
> >
> >            <a href="#" wicket:id="thumbnailLink">
> > >
> >
> >                    <img src="#" wicket:id="thumnailImg"
> > width="200"
> > > height="134" border="0" />
> > >
> >
> >            </a>
> > >
> >
> >    </td>
> > >
> >
> > </tr>
> > >
> > > ................
> > >
> > > Here's the exception I'm getting, it's not finding the thumbnailLink
> > > control above:
> > >
> > > WicketMessage: Unable to find component with id 'thumbnailLink' in
> > > [MarkupContainer [Component id = 4, page =
> > > com.myapp.ui.ProductCatalog, path =
> > > 2:categoryView:0:productView:1:cols:4.Item, isVisible
=
> > true,
> > > isVersioned = true]]. This means that you declared
> > > wicket:id=thumbnailLink in your markup, but that you either did not
> > > add the component to your page at all, or that the hierarchy does not
> > > match.[markup =
> > > file:/C:/Program%20Files/jboss-
> >
4.0.4.GA/server/default/tmp/deploy/tmp37375MyAppEAR.ear-contents/MyApp-exp.war/WEB-INF/classes/com/myapp/ui/ProductCatalog.html,
> > > index = 29, current = '<a href="#" wicket:id="thumbnailLink">' (line
> > > 61, column 15)]
> > >
> > > I must just be missing something obvious....I thought I set it up
> > > correctly per the wicket-examples GridViewPage example.
> > >
> > > On 5/22/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:
> > > > cols objects are generated by the gridview, whatever components you
add
> > to
> > > > the gridview in populate have to go inside the cols
> > > >
> > > >  -Igor
> > > >
> > > >
> > > > On 5/22/06, VGJ <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > >
> > > > > The code in examples looks screwy to me too, since it defines
> > > > wicket:id="rows" for the GridView control and wicket:id="cols" as
the
> > > > columns...yet in the class there is no mention of "cols" anywhere.
Is
> > this
> > > > some built-in object?
> > > > >
> > > > > I'm obviously getting an exception because I've setup "rows" and
> > "cols"
> > > > but there is no "cols" - every widget I've nested inside of "cols"
is
> > > > causing my hierarchy to be incorrect.
> > > > >
> > > > >
> > > > > On Mon, 2006-05-22 at 10:02 -0700, Igor Vaynberg wrote:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On 5/22/06, VGJ < [EMAIL PROTECTED]> wrote:
> > > > >
> > > > > Ok, this makes more sense than the example in wicket-examples.
> > However,
> > > > what if the List I'm passing in is actually wrapped in a
> > > > LoadableDetachableModel?
> > > > >
> > > > > that should be ok because dataview will check if the idataprovider
> > impl
> > > > you passed in also implements IDetachable and call detach on it at
the
> > end
> > > > of request.
> > > > >
> > > > > so class MyDataProvider extends ListDataProvider implements
> > IDetachable
> > > > {....}
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Congrats on the baby, by the way!!
> > > > >
> > > > > thank you :)
> > > > >
> > > > > -Igor
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > >
-------------------------------------------------------
> > > Using Tomcat but need to do more? Need to support web services,
security?
> > > Get stuff done quickly with pre-integrated technology to make your job
> > easier
> > > Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
> > >
> >
http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
> > > _______________________________________________
> > > Wicket-user mailing list
> > > Wicket-user@lists.sourceforge.net
> > >
https://lists.sourceforge.net/lists/listinfo/wicket-user
> > >
> > >
> > >
> >
> >
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>
http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to