You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by pieter claassen <pi...@claassen.co.uk> on 2009/07/21 09:55:57 UTC
setVisbile on form makes me reset fields
To clear the clutter in my form, I have a number of subforms hidden behind
toggle links. However, I find that if I toggle these subforms visible using
subform.setVisble(true), then I lose my contents of the rest of the controls
on the main page.
Any tips on how to force retain the already entered data on the form when
setting subform visibility?
P
Re: setVisbile on form makes me reset fields
Posted by Mathias Nilsson <wi...@gmail.com>.
When pressing the link it will tell wicket to refresh the page and the form
will no be submitted.
have you tried submitLink instead of link?
--
View this message in context: http://www.nabble.com/setVisbile-on-form-makes-me-reset-fields-tp24583333p24583629.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: setVisbile on form makes me reset fields
Posted by pieter claassen <pi...@gmail.com>.
Ok, here it is
private class QuestionEditForm extends Form {
private boolean questionformatter = true;
public QuestionEditForm(String id) {
super(id);
TextChunk question =
paragraphwebmodel.getEntity().getStatement();
setModel(new
CompoundPropertyModel(paragraphwebmodel));
VariableTextFieldPanel questionpanel = new
VariableTextFieldPanel(
"question", new PropertyModel(paragraphwebmodel,
"statement.value"));
final AdvancedFormatterPanel formatquestion = new
AdvancedFormatterPanel(
"formatquestion", new AdvancedFormatterWebModel(question
.getFormatter()));
add(new
DropDownChoice("clear",Arrays.asList(QuestionLayoutClearance.values()),new
MyChoiceRenderer()));
formatquestion.setVisible(false);
add(new Link("showquestionformat") {
@Override
public void onClick() {
formatquestion.setVisible(questionformatter);
if (questionformatter) {
questionformatter = false;
} else {
questionformatter = true;
}
}
});
On Tue, Jul 21, 2009 at 10:03 AM, Mathias Nilsson <
wicket.programmer@gmail.com> wrote:
>
> Can you post some code so we can see whats going on?
> --
> View this message in context:
> http://www.nabble.com/setVisbile-on-form-makes-me-reset-fields-tp24583333p24583413.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Pieter Claassen
musmato.com
Re: setVisbile on form makes me reset fields
Posted by Mathias Nilsson <wi...@gmail.com>.
Can you post some code so we can see whats going on?
--
View this message in context: http://www.nabble.com/setVisbile-on-form-makes-me-reset-fields-tp24583333p24583413.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org