you certainly can, but the problem is that you do not reference one of the components in your markup. perhaps one of those labels you add to the loop item.

-Igor


On 4/6/06, Anders Peterson <[EMAIL PROTECTED]> wrote:
"this" is the page. Can't I add to the LoopItem?

Loop tmpLoop = new Loop("instruments", Instrument.ALL.size()) {

        protected void populateItem(LoopItem anItem) {

                int tmpIter = anItem.getIteration();

                 anItem.add(new Label("name",
Instrument.ALL.get(tmpIter).getName()));
                 anItem.add(new Label("market", new
PropertyModel(tmpMod, " marketWeights.toBigDecimal(" + tmpIter + ",0)")));
                 anItem.add(new Label("raw", new PropertyModel(tmpMod,
"modifiedWeights.toBigDecimal(" + tmpIter + ",0)")));
                 anItem.add(new Label("normalised", new
PropertyModel(tmpMod, "normalisedWeights.toBigDecimal(" + tmpIter +
",0)")));
                 anItem.add(new Label("optimised", new
PropertyModel(tmpMod, "optimisedWeights.toBigDecimal(" + tmpIter + ",0)")));
        }

};

this.add(tmpLoop);



Igor Vaynberg wrote:
> this usually means you added a component to the component tree, but it was
> never referenced in the markup so it was not rendered - nor will it ever be..
>
> If you show us more code we might be able to help you more.
>
>
> -Igor
>
>
> On 4/6/06, Anders Peterson < [EMAIL PROTECTED]> wrote:
>> I'm using a Loop now (on a different page).
>>
>> Then I get a WicketRuntimeException: The component(s) below failed to
>> render:
>> 1. [Component id = name, page = se.optimatika.blapp.gui.PgEvaluate, path
>> = 3:instruments:0:name.Label, isVisible = true, isVersioned = true]
>> ......
>>
>> I can't see what's wrong. The component tree (on the error page) looks
>> ok. The toString method on ALL model objects seems to have worked.
>>
>> What is usually the cause of not being able to render a component?
>>
>> /Anders
>>
>> Eelco Hillenius wrote:
>>> Anything would have worked as long as the list that you return is
>>> fresh by either using a detachable model, or one of the models that
>>> re-evaluate on every call, like PropertyModels or e.g. a model like:
>>>
>>> IModel listViewModel = new Model() {
>>>   Object getObject(Component c) {
>>>     return tmpInstrument.getCorrelations();
>>>   }
>>> }
>>>
>>> There is no specific advantage of Loops over ListViews in this case.
>>> Loops are simply designed to be a simpler but more limited version. of
>>> ListView.
>>>
>>> Eelco
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by xPML, a groundbreaking scripting
>> language
>> that extends applications into web and mobile media. Attend the live
>> webcast
>> and join the prime developer group breaking into this new coding
>> territory!
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
>> _______________________________________________
>> Wicket-user mailing list
>> Wicket-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>
>


--
http://ojalgo.org/

Mathematics, Linear Algebra and Optimisation with Java


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to