You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Entropy <bl...@gmail.com> on 2019/05/15 19:29:39 UTC

Radio button submits encoded value

We have a general audit requirement to capture literally every request and
log it and it's parameters.  We are stripping these parameters from the
HttpServletRequest object in a common method.  Works great...except when it
doesn't.

We have a page where the radio buttons are producing a particularly
nonhelpful log record because even though the object declares a model value
of 'Y' or 'N', and the HTML has values of 'yes' and 'no', Wicket is putting
out 'radio47' and similarly unhelpful things. 

Our L2 customer service person is great at figuring out what users did wrong
from our audit logs.  But she can't make heads or tails of 'radio47'.  

Here's the object declaration:

		RadioGroup<String> q1 = new RadioGroup<String>("q1", new
PropertyModel<String>(adptModel, "seizureArrestedFlag"));
	
add(q1.setRequired(true).setOutputMarkupId(true).setOutputMarkupPlaceholderTag(true));
		q1.add(new Radio<String>("q1_yes", Model.of("Y")));
		q1.add(new Radio<String>("q1_no", Model.of("N")));

Here's the HTML (I hope this goes through okay)



So given that the HTML has values of 'yes' and 'no', and the java has a
Model of 'Y' and 'N', I need the request to actually have one of those, not
'Radio47'.  Mind you, when the java submit runs, it's getting the right
value.  This 'Radio47' is clearly just something Wicket is doing internally. 
I'm just wondering how to get my audit log right.


--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Radio button submits encoded value

Posted by Sven Meier <sv...@meiers.net>.
Hi,

your Radio can override #getValue() and return a custom value, see its 
javadoc.

Have fun
Sven


Am 15.05.19 um 21:29 schrieb Entropy:
> We have a general audit requirement to capture literally every request and
> log it and it's parameters.  We are stripping these parameters from the
> HttpServletRequest object in a common method.  Works great...except when it
> doesn't.
>
> We have a page where the radio buttons are producing a particularly
> nonhelpful log record because even though the object declares a model value
> of 'Y' or 'N', and the HTML has values of 'yes' and 'no', Wicket is putting
> out 'radio47' and similarly unhelpful things.
>
> Our L2 customer service person is great at figuring out what users did wrong
> from our audit logs.  But she can't make heads or tails of 'radio47'.
>
> Here's the object declaration:
>
> 		RadioGroup<String> q1 = new RadioGroup<String>("q1", new
> PropertyModel<String>(adptModel, "seizureArrestedFlag"));
> 	
> add(q1.setRequired(true).setOutputMarkupId(true).setOutputMarkupPlaceholderTag(true));
> 		q1.add(new Radio<String>("q1_yes", Model.of("Y")));
> 		q1.add(new Radio<String>("q1_no", Model.of("N")));
>
> Here's the HTML (I hope this goes through okay)
>
>
>
> So given that the HTML has values of 'yes' and 'no', and the java has a
> Model of 'Y' and 'N', I need the request to actually have one of those, not
> 'Radio47'.  Mind you, when the java submit runs, it's getting the right
> value.  This 'Radio47' is clearly just something Wicket is doing internally.
> I'm just wondering how to get my audit log right.
>
>
> --
> Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> ---------------------------------------------------------------------
> 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