What does a border in the end do??
It writes output before and after the component it borders yes?

so:

    protected void onRender(final MarkupStream markupStream)
    {
        renderComponent(markupStream);
    }

    protected void onRender(final MarkupStream markupStream)
    {
        renderBorderStart()
        renderComponent(markupStream);
        renderBorderEnd()
    }

Thats pretty much what in the end does happen yes?
(i haven't used borders much so don't know exactly what more they really do)

johan


On 7/21/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:
well, ive run into a couple of situations where i needed to do that.

basically i had methods like this

MyForm.addWithErrorBorder(FormComponent c) {
  ErrorBorder eb=new ErrorBorder("eb");
  add(eb);
  eb.add(c);
}

i dont see any way to encapsulate this with 2.0 so you have to copy and paste those two lines everywhere.


-Igor



On 7/21/06, Johan Compagner <[EMAIL PROTECTED]> wrote:
for this we really need to change some more stuff.
Because that component c already has the parent set at the moment..

or are you changing this Component constructor:

public Component(MarkupContainer<?> parent, final String id, final IModel<T> model)
    {
        if (parent == null)
        {
            if (!(this instanceof Page))
            {
                throw new WicketRuntimeException("component without a parent is not allowed.");
            }
        }
        this.parent = parent.resolveParent(this);

and then use this.parent everywhere in the constructor?
It is a bit hacky and what does it exactly solve at the moment?


johan


On 7/21/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:
well, i was just thinking about something like this - not calling any methods or anything on the component being added

MarkupContainer resolveParent(Component c) {
   return new Border(this, "border");
}

-Igor


On 7/21/06, Johan Compagner < [EMAIL PROTECTED]> wrote:
the problem with that is how do you decide that you want to redirect it?

Cast the child to a  XXX class and then call a method on it?

We could have these methods but then we really should make sure that you shouldn't suppose to call things on them


johan

 

On 7/21/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:
i was also thinking of having something like this:

MarkupContainer markupcontainer.resolveParent(Component c);

that would be called before the component is added to give the parent a chance to redirect the component to a different parent.

useful for when you want to wrap a component in a border or something like that, dont know if there are any pitfalls, havent given it any serious thought yet.

ideas?

-Igor



On 7/21/06, Matej Knopp < [EMAIL PROTECTED] > wrote:
It's 2.0 where I neede. In 1.2 I can override add. But in 2.0 there is
no way (except overriding internalAdd) to have a callback on component
insertion.

-Matej

Eelco Hillenius wrote:
> I agree with Johan. Not too crazy about that. And for 2.0 you don't
> need it, right?
>
> Eelco
>
>
> On 7/21/06, Johan Compagner < [EMAIL PROTECTED]> wrote:
>> You can add this method if it was me.
>>
>> But it should cleary state with a big warning that you shouldn't call
>> methods on them. And if you do be very carefull what you call
>> (it should only be none overrideable (final) methods of Component itself)
>>
>> I am not a big fan of these kind of methods because of the pittfalls we
>> can have there. It is very bad programming to call methods on not
>> fully constructed objects...
>>
>> johan
>>
>>
>>  On 7/21/06, Matej Knopp < [EMAIL PROTECTED] > wrote:
>>> Hi,
>>>
>>> does anyone mind these two to be added to markup container?
>>> I know it first one could be little dangerous, because it's dealing with
>>> object that is not fully constructed yet, but I think if the javadoc
>>> states this clearly it should not be a problem.
>>>
>>> Currently I can accomplish it overriding internalAdd and remove, but
>>> that's not good because internalAdd is ... erm.. internal.
>>>
>>> -Matej
>>>
>>>
>> -------------------------------------------------------------------------
>>> 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-develop mailing list
>>> Wicket-develop@lists.sourceforge.net
>>>
>> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>>
>> -------------------------------------------------------------------------
>> 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-develop mailing list
>> Wicket-develop@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>>
>>
>>
>
> -------------------------------------------------------------------------
> 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-develop mailing list
> Wicket-develop@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>


-------------------------------------------------------------------------
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-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop


-------------------------------------------------------------------------
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-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop




-------------------------------------------------------------------------
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-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop




-------------------------------------------------------------------------
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-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop




-------------------------------------------------------------------------
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-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop




-------------------------------------------------------------------------
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-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop



-------------------------------------------------------------------------
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-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to