You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Matt Schmidt <ms...@gmail.com> on 2011/06/18 23:04:29 UTC

RadioGroup nulled out during form submit in IE

I have a form that is working correctly in FireFox but not IE. This puzzled
is quite puzzling to me since it is server side functionality.

Here's a much simplified version of what I've got:

<!-- MyPage.html -->
<form wicket:id="form">
   <!-- some other form fields here, text areas, etc. that submit fine in IE
and FF -->
   <div wicket:id="myRadioGroupComponent1"/>
   <div wicket:id="myRadioGroupComponent2"/>
   <div wicket:id="myRadioGroupComponent3"/>
   <input type="submit" value="Save" wicket:id="saveButton" />
</form>

<!-- MyRadioGroupComponent.html -->
<div wicket:id="radioGroup">
   <input type="radio" wicket:id="radio1" />
   <label>Radio 1</label>
   <input type="radio" wicket:id="radio2" />
   <label>Radio 2</label>
   <input type="radio" wicket:id="radio3" />
   <label>Radio 3</label>
</div>

The RadioGroup's also have an AjaxFormChoiceComponentUpdatingBehavior on it,
and the submit button is an IndicatingAjaxButton.

When I submit the form in FF, everything works fine. When I submit it in IE,
my form's model object has null values for each of the
"myRadioGroupComponent" properties. I stepped through the code and found
that convertedInput is getting set to null during the form's validate(),
because the radio group's value is not in the request
(FormComponent.getInputAsArray()). So it seems to me that IE is not
submitting the form correctly, or that I have invalid HTML that I cannot
identify.

I'm pretty stumped on this one. I can show some of my java if needed, but
the problem doesn't seem to be on that end to me. Any help is appreciated!

Thanks,
Matt

Re: RadioGroup nulled out during form submit in IE

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

 >Is this necessary or is this just working by coincidence?

no, adding the group to the request is not needed (normally).

 >>In order to be supported by this behavior the group components must 
output
 >>children with markup id in format of 'groupId-childId'
 >
 > Does this just mean this, or something more?

RadioGroup and Radio already do the heavy lifting for you. As long as 
you don't use custom markup ids, it should just work.
Note that the javadoc is talking about *markup ids*, not wicket ids.

Sven

On 06/19/2011 06:51 PM, Matt Schmidt wrote:
> After further investigation, my problem is with the
> AjaxFormChoiceComponentUpdatingBehavior. After adding the radio group to the
> target in the behavior's onUpdate(), it works.
>
> I have my radio's styled with some fancy jQuery button looks, so I was
> unable to see that the actual radio remained unselected after clicking it
> when using the Ajax behavior. But adding the group to the target fixes that.
>
> myRadioGroup.add(new AjaxFormChoiceComponentUpdatingBehavior()
> {
> @Override
> protected void onUpdate(AjaxRequestTarget target)
> {
> target.addComponent(myRadioGroup);
>                  //whatever else....
> }
> });
>
> Is this necessary or is this just working by coincidence?
>
> On a side note, the javadoc for AjaxFormChoiceComponentUpdatingBehavior
> says: (wicket 1.4.16)
>
>> In order to be supported by this behavior the group components must output
>> children with markup id in format of 'groupId-childId'
>
> Does this just mean this, or something more? It seems to work even if the
> structure is not formatted this way....
>
> <div wicket:id="myGroup">
>     <input type="radio" wicket:id="myGroup-radio1" />
>     <input type="radio" wicket:id="myGroup-radio2" />
>     <input type="radio" wicket:id="myGroup-radio3" />
> </div>
>
> On Sun, Jun 19, 2011 at 7:17 AM, Sven Meier<sv...@meiers.net>  wrote:
>
>> Hi Matt,
>>
>> it could be a tag open/close issue which leads IE to put your radio tags
>> outside of the form.
>> I'd suggest to check your markup, i.e. look out for non-closed tags.
>>
>> Hope this helps
>>
>> Sven
>>
>>
>> On 06/18/2011 11:04 PM, Matt Schmidt wrote:
>>
>>> I have a form that is working correctly in FireFox but not IE. This
>>> puzzled
>>> is quite puzzling to me since it is server side functionality.
>>>
>>> Here's a much simplified version of what I've got:
>>>
>>> <!-- MyPage.html -->
>>> <form wicket:id="form">
>>>     <!-- some other form fields here, text areas, etc. that submit fine in
>>> IE
>>> and FF -->
>>>     <div wicket:id="**myRadioGroupComponent1"/>
>>>     <div wicket:id="**myRadioGroupComponent2"/>
>>>     <div wicket:id="**myRadioGroupComponent3"/>
>>>     <input type="submit" value="Save" wicket:id="saveButton" />
>>> </form>
>>>
>>> <!-- MyRadioGroupComponent.html -->
>>> <div wicket:id="radioGroup">
>>>     <input type="radio" wicket:id="radio1" />
>>>     <label>Radio 1</label>
>>>     <input type="radio" wicket:id="radio2" />
>>>     <label>Radio 2</label>
>>>     <input type="radio" wicket:id="radio3" />
>>>     <label>Radio 3</label>
>>> </div>
>>>
>>> The RadioGroup's also have an AjaxFormChoiceComponentUpdatin**gBehavior
>>> on it,
>>> and the submit button is an IndicatingAjaxButton.
>>>
>>> When I submit the form in FF, everything works fine. When I submit it in
>>> IE,
>>> my form's model object has null values for each of the
>>> "myRadioGroupComponent" properties. I stepped through the code and found
>>> that convertedInput is getting set to null during the form's validate(),
>>> because the radio group's value is not in the request
>>> (FormComponent.**getInputAsArray()). So it seems to me that IE is not
>>> submitting the form correctly, or that I have invalid HTML that I cannot
>>> identify.
>>>
>>> I'm pretty stumped on this one. I can show some of my java if needed, but
>>> the problem doesn't seem to be on that end to me. Any help is appreciated!
>>>
>>> Thanks,
>>> Matt
>>>
>>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@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


Re: RadioGroup nulled out during form submit in IE

Posted by Matt Schmidt <ms...@gmail.com>.
After further investigation, my problem is with the
AjaxFormChoiceComponentUpdatingBehavior. After adding the radio group to the
target in the behavior's onUpdate(), it works.

I have my radio's styled with some fancy jQuery button looks, so I was
unable to see that the actual radio remained unselected after clicking it
when using the Ajax behavior. But adding the group to the target fixes that.

myRadioGroup.add(new AjaxFormChoiceComponentUpdatingBehavior()
{
@Override
protected void onUpdate(AjaxRequestTarget target)
{
target.addComponent(myRadioGroup);
                //whatever else....
}
});

Is this necessary or is this just working by coincidence?

On a side note, the javadoc for AjaxFormChoiceComponentUpdatingBehavior
says: (wicket 1.4.16)

> In order to be supported by this behavior the group components must output
> children with markup id in format of 'groupId-childId'


Does this just mean this, or something more? It seems to work even if the
structure is not formatted this way....

<div wicket:id="myGroup">
   <input type="radio" wicket:id="myGroup-radio1" />
   <input type="radio" wicket:id="myGroup-radio2" />
   <input type="radio" wicket:id="myGroup-radio3" />
</div>

On Sun, Jun 19, 2011 at 7:17 AM, Sven Meier <sv...@meiers.net> wrote:

> Hi Matt,
>
> it could be a tag open/close issue which leads IE to put your radio tags
> outside of the form.
> I'd suggest to check your markup, i.e. look out for non-closed tags.
>
> Hope this helps
>
> Sven
>
>
> On 06/18/2011 11:04 PM, Matt Schmidt wrote:
>
>> I have a form that is working correctly in FireFox but not IE. This
>> puzzled
>> is quite puzzling to me since it is server side functionality.
>>
>> Here's a much simplified version of what I've got:
>>
>> <!-- MyPage.html -->
>> <form wicket:id="form">
>>    <!-- some other form fields here, text areas, etc. that submit fine in
>> IE
>> and FF -->
>>    <div wicket:id="**myRadioGroupComponent1"/>
>>    <div wicket:id="**myRadioGroupComponent2"/>
>>    <div wicket:id="**myRadioGroupComponent3"/>
>>    <input type="submit" value="Save" wicket:id="saveButton" />
>> </form>
>>
>> <!-- MyRadioGroupComponent.html -->
>> <div wicket:id="radioGroup">
>>    <input type="radio" wicket:id="radio1" />
>>    <label>Radio 1</label>
>>    <input type="radio" wicket:id="radio2" />
>>    <label>Radio 2</label>
>>    <input type="radio" wicket:id="radio3" />
>>    <label>Radio 3</label>
>> </div>
>>
>> The RadioGroup's also have an AjaxFormChoiceComponentUpdatin**gBehavior
>> on it,
>> and the submit button is an IndicatingAjaxButton.
>>
>> When I submit the form in FF, everything works fine. When I submit it in
>> IE,
>> my form's model object has null values for each of the
>> "myRadioGroupComponent" properties. I stepped through the code and found
>> that convertedInput is getting set to null during the form's validate(),
>> because the radio group's value is not in the request
>> (FormComponent.**getInputAsArray()). So it seems to me that IE is not
>> submitting the form correctly, or that I have invalid HTML that I cannot
>> identify.
>>
>> I'm pretty stumped on this one. I can show some of my java if needed, but
>> the problem doesn't seem to be on that end to me. Any help is appreciated!
>>
>> Thanks,
>> Matt
>>
>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: RadioGroup nulled out during form submit in IE

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

it could be a tag open/close issue which leads IE to put your radio tags 
outside of the form.
I'd suggest to check your markup, i.e. look out for non-closed tags.

Hope this helps

Sven

On 06/18/2011 11:04 PM, Matt Schmidt wrote:
> I have a form that is working correctly in FireFox but not IE. This puzzled
> is quite puzzling to me since it is server side functionality.
>
> Here's a much simplified version of what I've got:
>
> <!-- MyPage.html -->
> <form wicket:id="form">
>     <!-- some other form fields here, text areas, etc. that submit fine in IE
> and FF -->
>     <div wicket:id="myRadioGroupComponent1"/>
>     <div wicket:id="myRadioGroupComponent2"/>
>     <div wicket:id="myRadioGroupComponent3"/>
>     <input type="submit" value="Save" wicket:id="saveButton" />
> </form>
>
> <!-- MyRadioGroupComponent.html -->
> <div wicket:id="radioGroup">
>     <input type="radio" wicket:id="radio1" />
>     <label>Radio 1</label>
>     <input type="radio" wicket:id="radio2" />
>     <label>Radio 2</label>
>     <input type="radio" wicket:id="radio3" />
>     <label>Radio 3</label>
> </div>
>
> The RadioGroup's also have an AjaxFormChoiceComponentUpdatingBehavior on it,
> and the submit button is an IndicatingAjaxButton.
>
> When I submit the form in FF, everything works fine. When I submit it in IE,
> my form's model object has null values for each of the
> "myRadioGroupComponent" properties. I stepped through the code and found
> that convertedInput is getting set to null during the form's validate(),
> because the radio group's value is not in the request
> (FormComponent.getInputAsArray()). So it seems to me that IE is not
> submitting the form correctly, or that I have invalid HTML that I cannot
> identify.
>
> I'm pretty stumped on this one. I can show some of my java if needed, but
> the problem doesn't seem to be on that end to me. Any help is appreciated!
>
> Thanks,
> Matt
>


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