That would work except that I still have the problem of removing the behavior from the list while the list is being iterated. Also, this uses the api in a way that doesn't match up with the wicket documentation, and I know that will cause some grief down the road.

thx,
jim

Eelco Hillenius wrote:
On second thought... can't you use the detach method of behaviours?
This has the same effect as onEndRequest.

Eelco

On 1/26/06, Jim McLaughlin <[EMAIL PROTECTED]> wrote:

That would be great. I would prefer my custom components know as little
as possible about what the behavior needs to do.

thx,
jim

Eelco Hillenius wrote:

If you work with custom components, you could override onEndRequest
and do the work there. I thought that this issue might come up some
time, and kind of expected we might want to implement life cycle call
backs (onBeginRequest, onEndRequest) on behaviours some day. I didn't
implement it right away, as I first wanted us to get across a use case
where this would actually be wanted. This might be such a use case.

Eelco


On 1/26/06, Juergen Donnerstag <[EMAIL PROTECTED]> wrote:


May be we could implement a class Behaviors which provdes an interface
similar to List which provides "secure" implementations of e.g.
remove().

Juergen

On 1/26/06, Jim McLaughlin <[EMAIL PROTECTED]> wrote:


What I would like to do have the behavior remove itself by calling
component.getBehaviors ().remove (this); in its rendered() method (this
is the last method called on the Behavior during the request cycle,
right?). I don't believe this is safe since the behavior list is being
iterated at that point. Any ideas how and where this can be done?

thx,
jim

Juergen Donnerstag wrote:


It should be possible. Component.getBehaviors().remove(myBehavior)

Juergen

On 1/26/06, Martijn Dashorst <[EMAIL PROTECTED]> wrote:



I ran into the same question yesterday.

Usecase:

singleton attributemodifier.

in css:
.hidden {
 display : none;
}

in html:
<html>
<body>
<div wicket:id="foo">
</div>
<div wicket:id="bar">
</div>
</body>
</html>

in Java:
class MyModifiers {
 private static AttributeModifier hider = new ClassAttributeModifier();
 public static void hide(Component comp) {
     comp.add(hider);
 }
 public static void show(Component comp) {
     comp.remove(hider);
 }
}

class MyPage {
 MyPage() {
     MarkupContainer foo = new MarkupContainer("foo");
     MarkupContainer bar = new MarkupContainer("bar");
     if(somecondition) {
         MyModifiers.hide(foo);
         MyModifiers.show(bar);
     } else {
         MyModifiers.show(foo);
         MyModifiers.hide(bar);
     }
 }
}

On 1/26/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:



I don't really understand how/ where/ when you would do the add/
remove operation. However, I can't think of anything against the
option of removing behaviors either.

Eelco


On 1/25/06, Jim McLaughlin <[EMAIL PROTECTED]> wrote:



Yes my behavior is smart enough not to do its transform if the
RequestTarget isn't of the right type, but what I really want to do is
add the behavior only if the RequestTarget is a ComponentRequestTarget,
and then remove it once that request cycle is done. That way it is only
there if it is needed, and not by default, and not when the user does a
full page refresh for the next request.  Like you said, it can be coded
around. But there is a use for removing behaviors, and it would be
pleasant to have it supported :). Should I open an rfe?

thx,
jim

Eelco Hillenius wrote:



I think the best you can do is make your behavior smart enough so that
it doesn't do anything after it did it's transform.

Eelco


On 1/25/06, Jim McLaughlin <[EMAIL PROTECTED]> wrote:




Is it possible to remove a behavior from a component? I have created a
MarkupEscapeTransformer and would like to remove it after the transform
has occurred. If it is possible, where in the request cycle should it
happen?

thanks,

jim



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=k&kid3432&bid#0486&dat1642



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



--
Living a wicket life...

Martijn Dashorst - http://www.jroller.com/page/dashorst

Wicket 1.1 is out: http://wicket.sourceforge.net/wicket-1.1


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=k&kid3432&bid#0486&dat1642



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=k&kid3432&bid#0486&dat1642



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=k&kid3432&bid#0486&dat1642



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to