You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by darkslide <da...@seznam.cz> on 2011/11/21 14:51:34 UTC

Onclick actionlink

Hi,
I would like to ask you : I have an actionlink as below:

<t:actionlink t:id="update" context="errorConfig" disabled="EditDisabled"
onclick="HighLightTR(this,'#c9cc99','cc3333');">Edit</t:actionlink>

And JS:

var preEl ;
var orgBColor;
var orgTColor;
function HighLightTR(el, backColor,textColor){
  if(typeof(preEl)!='undefined') {
     preEl.bgColor=orgBColor;
     try{ChangeTextColor(preEl,orgTColor);}catch(e){;}
  }
  orgBColor = el.bgColor;
  orgTColor = el.style.color;
  el.bgColor=backColor;

  try{ChangeTextColor(el,textColor);}catch(e){;}
  preEl = el;
}


function ChangeTextColor(a_obj,a_color){  ;
   for (i=0;i<a_obj.cells.length;i++)
    a_obj.cells(i).style.color=a_color;
}


The action link is posited into grid and I wanna click on 'Edit' for the
selected record in grid after that the row should be highlighted . How can I
do that?

The solution doesn't work.

Please help.

Thanks a lot

BR

Lukas P.

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Onclick-actionlink-tp5010564p5010564.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: Onclick actionlink

Posted by Taha Hafeez Siddiqi <ta...@gmail.com>.
Hi

I couldn't understand the use case. I think when you click, if the default action is not prevented(event.preventDefault()) it will go to the given url in which case the page will be reloaded and so there is no point in changing the color. 

regards
Taha

On Nov 21, 2011, at 7:21 PM, darkslide wrote:

> Hi,
> I would like to ask you : I have an actionlink as below:
> 
> <t:actionlink t:id="update" context="errorConfig" disabled="EditDisabled"
> onclick="HighLightTR(this,'#c9cc99','cc3333');">Edit</t:actionlink>
> 
> And JS:
> 
> var preEl ;
> var orgBColor;
> var orgTColor;
> function HighLightTR(el, backColor,textColor){
>  if(typeof(preEl)!='undefined') {
>     preEl.bgColor=orgBColor;
>     try{ChangeTextColor(preEl,orgTColor);}catch(e){;}
>  }
>  orgBColor = el.bgColor;
>  orgTColor = el.style.color;
>  el.bgColor=backColor;
> 
>  try{ChangeTextColor(el,textColor);}catch(e){;}
>  preEl = el;
> }
> 
> 
> function ChangeTextColor(a_obj,a_color){  ;
>   for (i=0;i<a_obj.cells.length;i++)
>    a_obj.cells(i).style.color=a_color;
> }
> 
> 
> The action link is posited into grid and I wanna click on 'Edit' for the
> selected record in grid after that the row should be highlighted . How can I
> do that?
> 
> The solution doesn't work.
> 
> Please help.
> 
> Thanks a lot
> 
> BR
> 
> Lukas P.
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Onclick-actionlink-tp5010564p5010564.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
> 


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