Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax Update of g:select in IE7 issue
    primarykey
    data
    text
    <p>I have the following problem which, I think, is browser-related. I have a company profile and I want to be able to add some headquarters' addresses to the company via ajax. So, I do the following:</p> <p>I have a combobox that holds the addresses:</p> <pre><code>&lt;tr class="prop"&gt; &lt;td valign="top" class="name"&gt; &lt;label for="hasHeadquarters"&gt;&lt;g:message code="company.headquarters.label" default="Company Headquarters" /&gt;&lt;/label&gt; &lt;/td&gt; &lt;td valign="top" class="name"&gt; &lt;g:select id="hasHeadquarters" name="hasHeadquarters" optionKey="id" from="${de.cirquent.basicdata.Headquarter.list()}" multiple="multiple"&gt;&lt;/g:select&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p>and a form to fill out new addresses:</p> <pre><code>&lt;g:formRemote name="addHeadquarter" url="[controller:'company', action:'ajaxAddHeadquarter']" update="hasHeadquarters" onComplete="javascript:Form.reset('addHeadquarter');"&gt; </code></pre> <p>The whole submits to a controller:</p> <pre><code>def ajaxAddHeadquarter = { def p = params def hqInstance = new Headquarter(params.headquarter) if(hqInstance.save(flush:true)){ // some messages } render(template:"/shared/updateHQList", params:params) } </code></pre> <p>which updates the combobox with the template:</p> <pre><code>&lt;g:select id="hasHeadquarters" name="hasHeadquarters" optionKey="id" from="${de.cirquent.basicdata.Headquarter.list()}" multiple="multiple"&gt;&lt;/g:select&gt; </code></pre> <p>As you can see, simple scenario which works on Chrome, Firefox (both 4.0 and 5.0), but it doesn't work in IE7 (haven't tried IE8 yet). By "doesn't work" I mean: The new headquarter/address is saved successfully to the db and the list of headquarters is being returned as well including the new one. What happens is that the comobox is updated with an empty combobox (no values at all, not even the old ones). After Ctrl+R on the whole page, I can see that the new hq is added to the list. </p> <p>The version of grails I'm using is 1.3.7. and prototype.js version is 1.6.1. Is this issue fixable for IE7 and if so I would like to know how. It's pretty nerve-wracking, because no error is returned - apparently prototype.js partly suppreses exceptions so I'm not able to see what happens.</p> <p>Thanks for the help!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload