that works, usually i like to separate button actions on my forms, so i
would have something like this
abstract class myform extends form {
protected abstract void onsave();
...
add(new button(...) { onsubmit() { onsave(); }});
}
and then in page it would be
final MyPanel panel=new MyPanel(..);
add(panel);
add(new myform(...) { onsave() { panel.setvisible(true); }}
i like this way of wiring things so the form can be a bit more opaque
-igor
On 2/8/07, Ramazan Pekin <[EMAIL PROTECTED]> wrote:
Hi,
I have seperated the myForm and myPage, because of that I can reach the
myPanel by setting it myPage's field.
((MyPage)getPage()).getMyPanel().setVisible(true);
Is this the only way, can I directly reach to the component? :)
Thanks Igor for your helps.
----- Original Message ----
From: Igor Vaynberg <[EMAIL PROTECTED]>
To: wicket-user@lists.sourceforge.net
Sent: Friday, February 9, 2007 12:24:20 AM
Subject: Re: [Wicket-user] How can I add panel on submit?
another way is to keep the panel as a field of the enclosing page/panel
-igor
On 2/8/07, Igor Vaynberg < [EMAIL PROTECTED]> wrote:
>
> the easiest way is to do this
>
> final MyPanel mypanel =new MyPanel(..);
> ...
> onsubmit() { mypanel.setvisible(true); <== it is reachable because it
> was declared final
>
> -igor
>
>
> On 2/8/07, Ramazan Pekin <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> > I have added to my page a panel.
> >
> > CompoundPropertyModel compoundPropertyModel = new
> > CompoundPropertyModel(myModel);
> > add(new myPanel("",compoundPropertyModel).setVisible(false));
> > I am submitting my form and getting form value to the panel. But I
> > cant find how can I reach the component, in the form's onSubmit function.
> > protected void onSubmit(){
> > //How can I reach the panel component and set it to visible?
> > }
> >
> > Thanks for your helps.
> >
> > ----- Original Message ----
> > From: Igor Vaynberg < [EMAIL PROTECTED]>
> > To: wicket-user@lists.sourceforge.net
> > Sent: Thursday, February 8, 2007 12:30:01 AM
> > Subject: Re: [Wicket-user] How can I add panel on submit?
> >
> > one way:
> > add the panel and set it to invisible, in your onsubmit set it back to
> > visible. see component.is/setvisible()<http://component.is/setvisible%28%29>
> >
> > another way:
> > add a placeholder component such as webmarkupcontainer and in onsubmit
> > replace it with your actual panel
> >
> > -igor
> >
> >
> > On 2/7/07, Ramazan Pekin <[EMAIL PROTECTED] > wrote:
> > >
> > > Hi to everyone,
> > >
> > > I want to add a new component to my page on my form submit, can I do
> > > that?
> > >
> > > I want to show the form result on this component. For example I want
> > > to show the result of the form with the Panel.
> > >
> > > Can you help me with example code?
> > >
> > > Thank to everyone.
> > >
> > > ------------------------------
> > > Sucker-punch spam with award-winning protection.
> > > Try the free Yahoo! Mail Beta.
> > >
> > >
> > > -------------------------------------------------------------------------
> > > 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&kid=120709&bid=263057&dat=121642
> > >
> > > _______________________________________________
> > > 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&kid=120709&bid=263057&dat=121642
> > _______________________________________________
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
> >
> > ------------------------------
> > Have a burning question? Go to Yahoo!
Answers<http://answers.yahoo.com/;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx>and
get answers from real people who know.
> >
> >
> > -------------------------------------------------------------------------
> > 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&kid=120709&bid=263057&dat=121642
> > _______________________________________________
> > 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&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
------------------------------
Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo!
Travel<http://travel.yahoo.com/hotelsearchpage;_ylc=X3oDMTFtaTIzNXVjBF9TAzk3NDA3NTg5BF9zAzI3MTk0ODEEcG9zAzIEc2VjA21haWx0YWdsaW5lBHNsawNxMS0wNw--%0A>to
find your fit.
-------------------------------------------------------------------------
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&kid=120709&bid=263057&dat=121642
_______________________________________________
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&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user