Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
dave ch
Liferay js not working
15 de Fevereiro de 2013 09:00
Resposta

dave ch

Ranking: Regular Member

Mensagens: 164

Data de entrada: 6 de Fevereiro de 2012

Mensagens recentes

Hi all,

I am trying to compare two var's in liferay js. But it's not working :

var currentEntries = instance.get('curEntries');
alert("currentEntries :" +currentEntries); // getting all entries like sam, john, kate
for(var i=0; i<currentEntries.length; i++){
var entries = currentEntries;
alert("entries :"+entries.type); // working under For loop

var text = instance.inputNode.val();
alert("text :" +text); // getting, the text i have recently entered

if(text.equals(entries))
{
alert("This Already Exist"); // This is not getting compared
}

The alert This Already Exist that suppose to come is not comming.
If this is not the right way, then, is there any other approach in liferay js. ?

Regards,
dave ch
RE: Liferay js not working
15 de Fevereiro de 2013 12:07
Resposta

dave ch

Ranking: Regular Member

Mensagens: 164

Data de entrada: 6 de Fevereiro de 2012

Mensagens recentes

Even the type it is showing as String. Then why these two strings are not getting compared.

alert(typeof entries ); //String
alert(typeof text); //String


Even i tried to compare them using Ascii

if(toAscii(text)==toAscii(entries))

but still they are different and not the same when compared.

Can any body hav any idea on this?

Regards
dave ch
RE: Liferay js not working
16 de Fevereiro de 2013 06:55
Resposta

dave ch

Ranking: Regular Member

Mensagens: 164

Data de entrada: 6 de Fevereiro de 2012

Mensagens recentes

Any One?