You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ViceGripX <vi...@hotmail.com> on 2009/10/22 21:25:31 UTC

[T4.1] UpdateComponent problems with Internet Explorer 7/8 only

Hi all,

I'm having a problem updating a input field with an empty string using the
"cycle.getResponseBuilder().updateComponent" function in Internet Explorer
7/8 but not Firefox...

What I'm trying to do is have a table of selectable rows and based on the
row selection, values in a bunch of input fields will be set using the
"cycle.getResponseBuilder().updateComponent" function. This works fine in
all browsers when the user selects the row and the values of the inputs are
strings with characters (eg. "Tom", "35", "Manager", even " ").

The problem is when I try to set the value to "" in order to clear the
field, in Internet Explorer 7/8 it won't change the input fields value and
it remains as the previous set value. In Firefox though, the field is set
correctly to "".

Anyone have any ideas? I can get it to work setting the inputs to " "
(space) but doesn't look nice and I have to then worry about inputs with a
space infront or after it...

Thanks!

-- 
View this message in context: http://www.nabble.com/-T4.1--UpdateComponent-problems-with-Internet-Explorer-7-8-only-tp26015765p26015765.html
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: [T4.1] UpdateComponent problems with Internet Explorer 7/8 only

Posted by ViceGripX <vi...@hotmail.com>.
Thanks for the reply! I've fixed the problem but I'd thought I'd post what
worked for anyone else with this issue. Also I'm using Tapestry 4.1.6...

What I was doing was the following:

<input jwcid="userId@TextField" value="ognl:userId"></input>

Then updating like so:

setUserId(newUserId);
cycle.getResponseBuilder().updateComponent("userId");


This wasn't working in IE but was fine in FF so as Andreas suggested I
changed it to the following which worked in IE and FF:

<div jwcid="userIdContainer@Any">
        <label for="userId">User Id</label>
	<input jwcid="userId@TextField" value="ognl:userId"></input>
</div>

Then updating like so:

setUserId(newUserId);
cycle.getResponseBuilder().updateComponent("userIdContainer");


I already had the div for the input for the layout so it was a simple fix to
change it to update the div instead. I did try to update the div that
contained all the inputs before but it didn't work when I tried it, but then
again that could have simply been a mistake in my code.



Andreas Andreou-4 wrote:
> 
> So, are you using updateComponent() with each input field as parameter?
> Is it possible instead of that to update a node that contains that input
> field?
> 
> Otherwise, i see this code in
> tapestry-framework/src/js/tapestry-4.1.6/core.js
> for copying the attributes of the updatedComponents:
> 
> while((attnode=atts[i++])){
> 
> if(tapestry.isIE){
>         if(!attnode){ continue; }
>                 if((typeof attnode == "object")&&
>                     (typeof attnode.nodeValue == 'undefined')||
>                     (attnode.nodeValue == null)||
>             (attnode.nodeValue == '')){
>         continue;
>     }
> }
> ...
> }
> 
> So, it looks like this (skipping attributes with empty value) is done on
> purpose - i'll have to check the commit logs for the reason.
> 
> You should go on by adding a jira ticket for this... and in the meantime,
> you could use your own version of core.js. Which exact version are you
> using?
> 
> 
> On Thu, Oct 22, 2009 at 10:25 PM, ViceGripX <vi...@hotmail.com>
> wrote:
>>
>> Hi all,
>>
>> I'm having a problem updating a input field with an empty string using
>> the
>> "cycle.getResponseBuilder().updateComponent" function in Internet
>> Explorer
>> 7/8 but not Firefox...
>>
>> What I'm trying to do is have a table of selectable rows and based on the
>> row selection, values in a bunch of input fields will be set using the
>> "cycle.getResponseBuilder().updateComponent" function. This works fine in
>> all browsers when the user selects the row and the values of the inputs
>> are
>> strings with characters (eg. "Tom", "35", "Manager", even " ").
>>
>> The problem is when I try to set the value to "" in order to clear the
>> field, in Internet Explorer 7/8 it won't change the input fields value
>> and
>> it remains as the previous set value. In Firefox though, the field is set
>> correctly to "".
>>
>> Anyone have any ideas? I can get it to work setting the inputs to " "
>> (space) but doesn't look nice and I have to then worry about inputs with
>> a
>> space infront or after it...
>>
>> Thanks!
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-T4.1--UpdateComponent-problems-with-Internet-Explorer-7-8-only-tp26015765p26015765.html
>> 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
>>
>>
> 
> 
> 
> -- 
> Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
> Tapestry / Tacos developer
> Open Source / JEE Consulting
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-T4.1--UpdateComponent-problems-with-Internet-Explorer-7-8-only-tp26015765p26027492.html
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: [T4.1] UpdateComponent problems with Internet Explorer 7/8 only

Posted by Andreas Andreou <an...@di.uoa.gr>.
So, are you using updateComponent() with each input field as parameter?
Is it possible instead of that to update a node that contains that input field?

Otherwise, i see this code in tapestry-framework/src/js/tapestry-4.1.6/core.js
for copying the attributes of the updatedComponents:

while((attnode=atts[i++])){

if(tapestry.isIE){
        if(!attnode){ continue; }
                if((typeof attnode == "object")&&
                    (typeof attnode.nodeValue == 'undefined')||
                    (attnode.nodeValue == null)||
            (attnode.nodeValue == '')){
        continue;
    }
}
...
}

So, it looks like this (skipping attributes with empty value) is done on
purpose - i'll have to check the commit logs for the reason.

You should go on by adding a jira ticket for this... and in the meantime,
you could use your own version of core.js. Which exact version are you using?


On Thu, Oct 22, 2009 at 10:25 PM, ViceGripX <vi...@hotmail.com> wrote:
>
> Hi all,
>
> I'm having a problem updating a input field with an empty string using the
> "cycle.getResponseBuilder().updateComponent" function in Internet Explorer
> 7/8 but not Firefox...
>
> What I'm trying to do is have a table of selectable rows and based on the
> row selection, values in a bunch of input fields will be set using the
> "cycle.getResponseBuilder().updateComponent" function. This works fine in
> all browsers when the user selects the row and the values of the inputs are
> strings with characters (eg. "Tom", "35", "Manager", even " ").
>
> The problem is when I try to set the value to "" in order to clear the
> field, in Internet Explorer 7/8 it won't change the input fields value and
> it remains as the previous set value. In Firefox though, the field is set
> correctly to "".
>
> Anyone have any ideas? I can get it to work setting the inputs to " "
> (space) but doesn't look nice and I have to then worry about inputs with a
> space infront or after it...
>
> Thanks!
>
> --
> View this message in context: http://www.nabble.com/-T4.1--UpdateComponent-problems-with-Internet-Explorer-7-8-only-tp26015765p26015765.html
> 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
>
>



-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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