On 2/16/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> you shouldnt be calling setresponsepage inside constructors
>
> try RestartResponseException
>
> -igor
>

Other than setresponsepage(), there are also methods like
getMarkupId() , which are not work properly in constructor. May be we
can add flag for those object ( or all component ?) to indicate if the
object is inited or not, then throws exception and recommend user to
use alternative? e.g.:

boolean inited = false;
[constructor] () {
   .....
   inited = true;
}

public String getMarkupId() {
    if(!inited) {
        throws new illegalstateexception("Cannot use getMarkupId() at
constructor, please add AttributeModifier and specify you own Markup
ID");
    } else
        return markupId;
}

May be more difficult to do similar thing at
RequestCycle.setresponsepage() , what do you think about this?

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

Reply via email to