You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ian Marshall <Ia...@GMail.com> on 2010/09/21 20:33:36 UTC
Preventing warnAboutFormComponentInsideEnclosure log entries
I make moderate use of the <wicket:enclosure/> tag in my Wicket HTML. I
notice now that (in development mode) I get log entries of the form
21-Sep-2010 11:04:04 org.apache.wicket.markup.html.internal.Enclosure
warnAboutFormComponentInsideEnclosure
WARNING: Found a form component RadioChoice/frmForm:rcWebSiteMode inside
an enclosure.
Form components do not work well inside wicket:enclosure tags, use
EnclosureContainer instead
whereas a while before now I did not.
To prevent such log entries being made without changing my
"logging.properties" file, I change my code as per my example below, using
instances of org.apache.wicket.markup.html.basic.EnclosureContainer instead
of <wicket:enclosure/> tags.
Since I am aware of no problem with my <wicket:enclosure/> tags, can I just
silence these new log messages, or am I condemned to replace all my
<wicket:enclosure/> tags which enclose form components with
EnclosureContainer instances (with all the HTML and Java code changes that
this will require)?
Old HTML code
-------------
<wicket:enclosure child="rcWebSiteMode">
<tr>
<td>
<br/>
</td>
</tr>
<tr>
<td>
Web sites to search:
</td>
<td>
<sp_an wicket:id="rcWebSiteMode" tabindex="5">
<input type="radio"/>Option 1<br/>
<input type="radio"/>Option 2<br/>
</sp_an>
</td>
</tr>
</wicket:enclosure>
Old Java code
-------------
Form frmForm = new Form(...);
add(frmForm);
RadioChoice<ListChoiceItem> rcWebSiteMode =
new RadioChoice<ListChoiceItem>("rcWebSiteMode", lciItems, crRenderer);
rcWebSiteMode.setRequired(true);
if (...)
rcWebSiteMode.setVisible(false);
frmForm.add(rcWebSiteMode);
New HTML code
-------------
<wicket:container wicket:id="enclAddItem">
<tr>
<td>
<br/>
</td>
</tr>
<tr>
<td>
Web sites to search:
</td>
<td>
<sp_an wicket:id="rcWebSiteMode" tabindex="5">
<input type="radio"/>Option 1<br/>
<input type="radio"/>Option 2<br/>
</sp_an>
</td>
</tr>
</wicket:container>
New Java code
-------------
import org.apache.wicket.markup.html.basic.EnclosureContainer;
Form frmForm = new Form(...);
add(frmForm);
RadioChoice<ListChoiceItem> rcWebSiteMode =
new RadioChoice<ListChoiceItem>("rcWebSiteMode", lciItems, crRenderer);
rcWebSiteMode.setRequired(true);
if (...)
rcWebSiteMode.setVisible(false);
EnclosureContainer enclAddItem = new EnclosureContainer("enclAddItem",
rcWebSiteMode);
enclAddItem.add(rcWebSiteMode);
frmForm.add(enclAddItem);
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Preventing-warnAboutFormComponentInsideEnclosure-log-entries-tp2549176p2549176.html
Sent from the Users forum 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: Preventing warnAboutFormComponentInsideEnclosure log entries
Posted by Ian Marshall <Ia...@GMail.com>.
Thanks Igor.
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Preventing-warnAboutFormComponentInsideEnclosure-log-entries-tp2549176p2715101.html
Sent from the Users forum 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: Preventing warnAboutFormComponentInsideEnclosure log entries
Posted by Igor Vaynberg <ig...@gmail.com>.
if it works fine for your particular usecase then you can silence the warning.
-igor
On Tue, Sep 21, 2010 at 11:33 AM, Ian Marshall <Ia...@gmail.com> wrote:
>
> I make moderate use of the <wicket:enclosure/> tag in my Wicket HTML. I
> notice now that (in development mode) I get log entries of the form
>
> 21-Sep-2010 11:04:04 org.apache.wicket.markup.html.internal.Enclosure
> warnAboutFormComponentInsideEnclosure
> WARNING: Found a form component RadioChoice/frmForm:rcWebSiteMode inside
> an enclosure.
> Form components do not work well inside wicket:enclosure tags, use
> EnclosureContainer instead
>
> whereas a while before now I did not.
>
> To prevent such log entries being made without changing my
> "logging.properties" file, I change my code as per my example below, using
> instances of org.apache.wicket.markup.html.basic.EnclosureContainer instead
> of <wicket:enclosure/> tags.
>
> Since I am aware of no problem with my <wicket:enclosure/> tags, can I just
> silence these new log messages, or am I condemned to replace all my
> <wicket:enclosure/> tags which enclose form components with
> EnclosureContainer instances (with all the HTML and Java code changes that
> this will require)?
>
>
> Old HTML code
> -------------
> <wicket:enclosure child="rcWebSiteMode">
> <tr>
> <td>
> <br/>
> </td>
> </tr>
>
> <tr>
> <td>
> Web sites to search:
>
> </td>
> <td>
> <sp_an wicket:id="rcWebSiteMode" tabindex="5">
> <input type="radio"/>Option 1<br/>
> <input type="radio"/>Option 2<br/>
> </sp_an>
> </td>
> </tr>
> </wicket:enclosure>
>
> Old Java code
> -------------
> Form frmForm = new Form(...);
> add(frmForm);
>
> RadioChoice<ListChoiceItem> rcWebSiteMode =
> new RadioChoice<ListChoiceItem>("rcWebSiteMode", lciItems, crRenderer);
> rcWebSiteMode.setRequired(true);
> if (...)
> rcWebSiteMode.setVisible(false);
> frmForm.add(rcWebSiteMode);
>
>
>
>
> New HTML code
> -------------
> <wicket:container wicket:id="enclAddItem">
> <tr>
> <td>
> <br/>
> </td>
> </tr>
>
> <tr>
> <td>
> Web sites to search:
>
> </td>
> <td>
> <sp_an wicket:id="rcWebSiteMode" tabindex="5">
> <input type="radio"/>Option 1<br/>
> <input type="radio"/>Option 2<br/>
> </sp_an>
> </td>
> </tr>
> </wicket:container>
>
>
> New Java code
> -------------
> import org.apache.wicket.markup.html.basic.EnclosureContainer;
>
> Form frmForm = new Form(...);
> add(frmForm);
>
> RadioChoice<ListChoiceItem> rcWebSiteMode =
> new RadioChoice<ListChoiceItem>("rcWebSiteMode", lciItems, crRenderer);
> rcWebSiteMode.setRequired(true);
> if (...)
> rcWebSiteMode.setVisible(false);
>
> EnclosureContainer enclAddItem = new EnclosureContainer("enclAddItem",
> rcWebSiteMode);
> enclAddItem.add(rcWebSiteMode);
> frmForm.add(enclAddItem);
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Preventing-warnAboutFormComponentInsideEnclosure-log-entries-tp2549176p2549176.html
> Sent from the Users forum 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org