Thanks, Johan, for the detailed answer.
final Label loggedInAsLabel = new Label("labelLoggedInAs", new Model()
{
public Object getObject(Component comp)
{
return session.getEmail();
}
});
and the visibility:
final Label loggedInAsLabel = new Label("labelLoggedInAs", email)
{
boolean isVisible()
{
return email != null;
}
}
And how can I do both together? The label only should contain the email and
should be displayed, when the email was entered.
BTW, are you sure, that your second example also would work when email is a
plain string?
--
Thanks in advance,
Tom
Johan Compagner schrieb:
you said you want to reload a page in a browser.
But it will always be the page you made once if you do a refresh or
submit to that page.
We don't create new pages all the time. We keep state in the pages.
HomePage and Bookmarkable urls that point to pages will create a new
Page (done by the framework)
besides that you create them youreself like setResponsePage(new
MyNextPage());
What needs to be refreshed of that page?
What i see is that you initilialize everything upfront.
(model data and also the visibility)
if for example this:
final Label loggedInAsLabel = new Label("labelLoggedInAs", email);
should update to the new email
then you have to do that through a model
final Label loggedInAsLabel = new Label("labelLoggedInAs", new Model()
{
public Object getObject(Component comp)
{
return session.getEmail();
}
});
and the visibility:
final Label loggedInAsLabel = new Label("labelLoggedInAs", email)
{
boolean isVisible()
{
return email != null;
}
}
On 2/16/06, *Thomas Singer* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
Hi Martijn,
> You are free to write anything yourself, and put it in the wiki.
There is only so much we can do in our FREE time.
I'm sure I would contribute to the wiki, but at the moment I'm not
of any
help because of my lack of experience with web applications at all and
wicket in special.
> .. to reload the page, you don't do anything.
OK, then most likely I do or expect something wrong. In the
constructor of
my Page I have following code:
final MySession session = getMySession();
final String email = session.getEmail();
final Label loggedInAsLabel = new Label("labelLoggedInAs", email);
final MessageForm messageForm = new MessageForm("messageInputForm",
session, this);
loggedInAsLabel.setVisible(email != null);
messageForm.setVisible (email == null);
add(loggedInAsLabel);
add(messageForm);
It looks like the constructor is only called when I invoke my
bookmarked URL
http://localhost:8080/foo , but not with the automatically happening
redirect.
--
Cheers,
Tom
Martijn Dashorst schrieb:
> Tom,
>
> Search the mailinglist for more information on writing documentation.
> You are free to write anything yourself, and put it in the wiki.
There
> is only so much we can do in our FREE time.
>
> As for your other question, to reload the page, you don't do
anything.
> To go to another page, set the responsepage to the page you want
to go
> to, just as you would do in a onclick event of a Link.
>
> Martijn
>
>
> On 2/16/06, *Tom S.* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
<mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
>
> Hi,
>
> What I need to do, that after executing the form.onSubmit()
method,
> wicket
> reload the current page or redirects to another? The GuestBook
> example uses
> currentListView.modelChanged(), but I don't use such a model.
I've also
> searched the wiki, but could not find something useful.
>
> I know, that developers much more prefer to write code, but
wouldn't
> it make
> sense to first document the existing stuff or provide much more
> better and
> larger real-world-problem examples, e.g. including the
handling of
> resources? It's also very hard to find something useful on the
> wicket side,
> because the information is scattered all over the place.
>
> --
> Thanks in advance,
> Tom
>
>
> -------------------------------------------------------
> 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
<http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642>
> <
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
<http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642>>
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
<mailto:Wicket-user@lists.sourceforge.net>
> <mailto:Wicket-user@lists.sourceforge.net
<mailto:Wicket-user@lists.sourceforge.net>>
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
>
>
> --
> Living a wicket life...
>
> Martijn Dashorst - http://www.jroller.com/page/dashorst
<http://www.jroller.com/page/dashorst>
> <http://www.jroller.com/page/dashorst>
>
> Wicket 1.1.1 is out: http://wicket.sourceforge.net/wicket-1.1
<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?cmd=lnk&kid=103432&bid=230486&dat=121642
<http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642>
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
<mailto:Wicket-user@lists.sourceforge.net>
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=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user