Radio button submits encoded value

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Radio button submits encoded value

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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Radio button submits encoded value

Sven Meier
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: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]