Hi Alex and Daniel,

Thanks for the response,
Alex "value" which I had specified is not theproperty. Its  a variable I
used. lets have it as name. I get the value when the itemClick event is
dispatched. I get thevalue through the currentTarget property of the event,

Alex sunce I set the values to teh DG I am prety sure about the type of the
values got from the event.

To be precise I fill the Datagrid with my own object which carries all the
data for the coluns in the Datagrid.
My goal is to set hyperlinks to the data in the Datagrid. and only to the
second column for the DataGrid.

On the Datagrid I call a function in the itemClick event with event and
identity as parameters.Identity is to show the function from which Datagrid
the function is called. I paste the function

    private function openSite(event:ListEvent,whichDG:int):void{
        if(event.columnIndex == 1){
         if(whichDG == 1){
       link = event.currentTarget.selectedItem.name as String;
         }else if(whichDG == 2){
       link = event.currentTarget.selectedItem.url as String;
         }
      if(link.indexOf("file:") > -1 || link.indexOf("http:") > -1){
            navigateToURL(new
URLRequest(link),"_"+link);
      }else{
          navigateToURL(new
URLRequest("http://"+link),"_"+link<http://%22+link),%22_%22+link/>
);
         }
        }
    }

here in the code the line        if(link.indexOf("file:") > -1 ||
link.indexOf("http:") > -1){
never gets satisfied. I even tried to check the value of the condition like
Alert.show(link.indexOf("file:")). But the application doesnt show the
Alert. And all the functionality stop work. To say in simple terms the
applications get hanged. Showing the sign if some error in the code.

*Sorry guys..While I am writing this, I just restarted the Flex builder. Its
working fine now. I mean I could see the indexOf method for the String i
use.*
**
*Sorry again to bother you guys. Dont you guys think this as a bug?.. I
certainly feel so. But its tough to reproduce it.. I dont know what exactly
went wrong. :) . *
**
*Guys do you guys have any idea about how to set a Hand cursor to a
particular column in the DataGrid with out using an itemrenderer. In my case
the first column of a Datagrid to show the data like an hyperlink??*
**
*Thanks again and in advance*
**
*Cheers*
*Hara*




On 5/8/07, Alex Harui <[EMAIL PROTECTED]> wrote:

   Something's wierd.  The ListEvent does not have a value property.  How
did you get the value?  The renderer's data property is an object and not a
string.

 ------------------------------
*From:* [email protected] [mailto:[EMAIL PROTECTED] *On
Behalf Of *Daniel Freiman
*Sent:* Tuesday, May 08, 2007 10:05 AM
*To:* [email protected]
*Subject:* Re: [flexcoders] String methods doesn't work



instead of

if (value.indexOf("Character") > -1) {

try

var temp:int = value.indexOf("Character");
trace(value);
trace("Character");
trace(temp);
if (temp > -1) {

my guess is that the trace will show that either "Character" or value
isn't what you thought it was and that the function is returning -1.
(I'm assuming you're replacing "Character" with a variable or literal
character in the code and not keeping it as "Character", because otherwise
that's you're problem right there).

Dan Freiman
nondocs <http://nondocs.blogspot.com/>

On 5/8/07, haravallabhan <[EMAIL PROTECTED] > wrote:
>
>   Hi,
>
> It seems I alone get such wierd problems. I tried to pass an ListEvent
> from the DataGrid on itemClick. I got the value from the event. I mean
> the de\isplay value. I tried to check for a character in the value
> using the value.indexOf("Character") > -1. it doesnt work. The method
> is not returning anything.
>
> When I check on the helper in the flex builder 2.0 IDE I could see only
> the length method displayed and no other methods which is suppose be
> for a string.
>
> Can some body help me n this regard
>
> Thanks in advance
> Cheers
> Hara
>
>

Reply via email to