You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by RobertSchreiber <ma...@robert-schreiber.de> on 2007/05/06 22:55:57 UTC

EventListener fails to update PropertySelection in IE

Dear Tapestry specialists,

I have 2 corresponding PropertySelections in my page.

In Firefox everything works like expected.

As soon as I select a species in PropertySelection 'speciesSelect' the
corresponding 'breedSelect' gets updated.

In Internet Explorer 6/7 I have to update the whole form 'animalEditForm'
but then the form gets validated and fails because other
input fields have not yet been filled in.

Any ideas?

Best regards, Robert from Munich


HTML:
=====
<form jwcid="animalEditForm@Form"  success="listener:doSubmit" method="post"
    clientValidationEnabled="ognl:false" delegate="prop:delegate">
<!-- ... -->
<label jwcid="@FieldLabel" field="component:speciesSelect" >Species:
</label>
<select jwcid="speciesSelect">
   <option>Cats</option>
   <option>Dogs</option>
</select>

<label jwcid="@FieldLabel" field="component:breedSelect" >Breed: </label>
<select id="breedSelect" jwcid="breedSelect">
   <option value="">&nbsp;</option>
   <option value="1">Dog breed 1</option>
   <option value="2">Dog breed 2</option>
</select>

<input jwcid="@Submit" type="submit"  value="message:submit"/>
</form>

Java:
=====
@EventListener(events = "onchange", targets = "speciesSelect",
submitForm="animalEditForm")
public void onSpeciesSelected(IRequestCycle cycle) {
   AnimalBreed bfirst = (AnimalBreed)getBreedController().getFirstEntry();
   setSelectedAnimalBreed(bfirst);
   cycle.getResponseBuilder().updateComponent("breedSelect"); // works in
Firefox not in IE 6
   //cycle.getResponseBuilder().updateComponent("animalEditForm"); // works
in Firefox and IE 6
}

@Component(id = "speciesSelect", bindings = {
   "model=speciesModel",
   "value=selectedAnimalSpecies",
   "displayName=message:speciesSelect"})
public abstract PropertySelection getSpeciesSelect();

@Component(id = "breedSelect", bindings = {
   "model=breedModel",
   "value=selectedAnimalBreed",
   "displayName=message:breedSelect"})
public abstract PropertySelection getBreedSelect();
-- 
View this message in context: http://www.nabble.com/EventListener-fails-to-update-PropertySelection-in-IE-tf3700887.html#a10349141
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: EventListener fails to update PropertySelection in IE

Posted by Martino Piccinato <ma...@gmail.com>.
I'm not completely sure but I think your problem is that the component you
are updating does not refer to the entire select "block" but just to the
label. As the eventlistener/ajaxdojoresponse basically rely client side on
the innerHTML (or similar) javascript function to replace inner html we had
success in this surrounding the entire html select fragment with a bloc tag
(e.g. div or span).

On 5/6/07, RobertSchreiber <ma...@robert-schreiber.de> wrote:
>
>
> Dear Tapestry specialists,
>
> I have 2 corresponding PropertySelections in my page.
>
> In Firefox everything works like expected.
>
> As soon as I select a species in PropertySelection 'speciesSelect' the
> corresponding 'breedSelect' gets updated.
>
> In Internet Explorer 6/7 I have to update the whole form 'animalEditForm'
> but then the form gets validated and fails because other
> input fields have not yet been filled in.
>
> Any ideas?
>
> Best regards, Robert from Munich
>
>
> HTML:
> =====
> <form jwcid="animalEditForm@Form"  success="listener:doSubmit"
> method="post"
>     clientValidationEnabled="ognl:false" delegate="prop:delegate">
> <!-- ... -->
> <label jwcid="@FieldLabel" field="component:speciesSelect" >Species:
> </label>
> <select jwcid="speciesSelect">
>    <option>Cats</option>
>    <option>Dogs</option>
> </select>
>
> <label jwcid="@FieldLabel" field="component:breedSelect" >Breed: </label>
> <select id="breedSelect" jwcid="breedSelect">
>    <option value="">&nbsp;</option>
>    <option value="1">Dog breed 1</option>
>    <option value="2">Dog breed 2</option>
> </select>
>
> <input jwcid="@Submit" type="submit"  value="message:submit"/>
> </form>
>
> Java:
> =====
> @EventListener(events = "onchange", targets = "speciesSelect",
> submitForm="animalEditForm")
> public void onSpeciesSelected(IRequestCycle cycle) {
>    AnimalBreed bfirst = (AnimalBreed)getBreedController().getFirstEntry();
>    setSelectedAnimalBreed(bfirst);
>    cycle.getResponseBuilder().updateComponent("breedSelect"); // works in
> Firefox not in IE 6
>    //cycle.getResponseBuilder().updateComponent("animalEditForm"); //
> works
> in Firefox and IE 6
> }
>
> @Component(id = "speciesSelect", bindings = {
>    "model=speciesModel",
>    "value=selectedAnimalSpecies",
>    "displayName=message:speciesSelect"})
> public abstract PropertySelection getSpeciesSelect();
>
> @Component(id = "breedSelect", bindings = {
>    "model=breedModel",
>    "value=selectedAnimalBreed",
>    "displayName=message:breedSelect"})
> public abstract PropertySelection getBreedSelect();
> --
> View this message in context:
> http://www.nabble.com/EventListener-fails-to-update-PropertySelection-in-IE-tf3700887.html#a10349141
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: EventListener fails to update PropertySelection in IE

Posted by Jesse Kuhnert <jk...@gmail.com>.
Oh - that is easy to fix. Drop the "prop" binding and use ognl.  You won't
need that library anymore anyways..

On 5/7/07, RobertSchreiber <ma...@robert-schreiber.de> wrote:
>
>
> Hi Jessek,
> Thanks for your ultra fast response. The latest snapshot works.
> Since I get always lost with downloading Tapestry via Maven,
> I downloaded the latest Workbench WAR file and copied the libs.
>
> JFYI:
> I caught another error which I could fix.
> Obviously JavaAssist 3.4 cannot handle array indices of type Long any
> more.
> The System showed the (missleading) Exception:
> ognl.OgnlException source is null for getProperty(null, "speciesEntry")
> but the real problem was a CompileError in
> JavaAssist:CodeGen.arrayAccess(ASTree array, ASTree index)
>
> HTML:
> =====
> <li jwcid="@For" source="prop:animalSpeciesSorted"
> value="prop:speciesEntry"
> element="li">
>          speciesEntry.key]" />
> <li>
>
> Java:
> =====
> ...
> public abstract KeyValueEntry getSpeciesEntry();
> ...
>
> public class KeyValueEntry implements Serializable {
>
>     Long key;
>     String value;
> ...
> }
>
> Best regards, Robert
>
>
> Try updating your tapestry version to 4.1.2. This works fine for me there.
>
> On 5/6/07, RobertSchreiber <ma...@robert-schreiber.de> wrote:
> >
> >
> > Dear Tapestry specialists,
> >
> > I have 2 corresponding PropertySelections in my page.
> >
> > In Firefox everything works like expected.
> >
> > As soon as I select a species in PropertySelection 'speciesSelect' the
> > corresponding 'breedSelect' gets updated.
> >
> > In Internet Explorer 6/7 I have to update the whole form
> 'animalEditForm'
> > but then the form gets validated and fails because other
> > input fields have not yet been filled in.
> >...
> --
> View this message in context:
> http://www.nabble.com/EventListener-fails-to-update-PropertySelection-in-IE-tf3700887.html#a10355112
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

Re: EventListener fails to update PropertySelection in IE

Posted by RobertSchreiber <ma...@robert-schreiber.de>.
Hi Jessek,
Thanks for your ultra fast response. The latest snapshot works.
Since I get always lost with downloading Tapestry via Maven, 
I downloaded the latest Workbench WAR file and copied the libs.

JFYI:
I caught another error which I could fix. 
Obviously JavaAssist 3.4 cannot handle array indices of type Long any more.
The System showed the (missleading) Exception:
ognl.OgnlException source is null for getProperty(null, "speciesEntry") 
but the real problem was a CompileError in
JavaAssist:CodeGen.arrayAccess(ASTree array, ASTree index)

HTML:
=====
<li jwcid="@For" source="prop:animalSpeciesSorted" value="prop:speciesEntry"
element="li">
	 speciesEntry.key]" />
<li>

Java:
=====
...
public abstract KeyValueEntry getSpeciesEntry();
...

public class KeyValueEntry implements Serializable {

    Long key;
    String value;
...
}

Best regards, Robert


Try updating your tapestry version to 4.1.2. This works fine for me there.

On 5/6/07, RobertSchreiber <ma...@robert-schreiber.de> wrote:
>
>
> Dear Tapestry specialists,
>
> I have 2 corresponding PropertySelections in my page.
>
> In Firefox everything works like expected.
>
> As soon as I select a species in PropertySelection 'speciesSelect' the
> corresponding 'breedSelect' gets updated.
>
> In Internet Explorer 6/7 I have to update the whole form 'animalEditForm'
> but then the form gets validated and fails because other
> input fields have not yet been filled in.
>...
-- 
View this message in context: http://www.nabble.com/EventListener-fails-to-update-PropertySelection-in-IE-tf3700887.html#a10355112
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: EventListener fails to update PropertySelection in IE

Posted by Jesse Kuhnert <jk...@gmail.com>.
Try updating your tapestry version to 4.1.2. This works fine for me there.

On 5/6/07, RobertSchreiber <ma...@robert-schreiber.de> wrote:
>
>
> Dear Tapestry specialists,
>
> I have 2 corresponding PropertySelections in my page.
>
> In Firefox everything works like expected.
>
> As soon as I select a species in PropertySelection 'speciesSelect' the
> corresponding 'breedSelect' gets updated.
>
> In Internet Explorer 6/7 I have to update the whole form 'animalEditForm'
> but then the form gets validated and fails because other
> input fields have not yet been filled in.
>
> Any ideas?
>
> Best regards, Robert from Munich
>
>
> HTML:
> =====
> <form jwcid="animalEditForm@Form"  success="listener:doSubmit"
> method="post"
>     clientValidationEnabled="ognl:false" delegate="prop:delegate">
> <!-- ... -->
> <label jwcid="@FieldLabel" field="component:speciesSelect" >Species:
> </label>
> <select jwcid="speciesSelect">
>    <option>Cats</option>
>    <option>Dogs</option>
> </select>
>
> <label jwcid="@FieldLabel" field="component:breedSelect" >Breed: </label>
> <select id="breedSelect" jwcid="breedSelect">
>    <option value="">&nbsp;</option>
>    <option value="1">Dog breed 1</option>
>    <option value="2">Dog breed 2</option>
> </select>
>
> <input jwcid="@Submit" type="submit"  value="message:submit"/>
> </form>
>
> Java:
> =====
> @EventListener(events = "onchange", targets = "speciesSelect",
> submitForm="animalEditForm")
> public void onSpeciesSelected(IRequestCycle cycle) {
>    AnimalBreed bfirst = (AnimalBreed)getBreedController().getFirstEntry();
>    setSelectedAnimalBreed(bfirst);
>    cycle.getResponseBuilder().updateComponent("breedSelect"); // works in
> Firefox not in IE 6
>    //cycle.getResponseBuilder().updateComponent("animalEditForm"); //
> works
> in Firefox and IE 6
> }
>
> @Component(id = "speciesSelect", bindings = {
>    "model=speciesModel",
>    "value=selectedAnimalSpecies",
>    "displayName=message:speciesSelect"})
> public abstract PropertySelection getSpeciesSelect();
>
> @Component(id = "breedSelect", bindings = {
>    "model=breedModel",
>    "value=selectedAnimalBreed",
>    "displayName=message:breedSelect"})
> public abstract PropertySelection getBreedSelect();
> --
> View this message in context:
> http://www.nabble.com/EventListener-fails-to-update-PropertySelection-in-IE-tf3700887.html#a10349141
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com