PDA

View Full Version : problem with '<' symbol


pavankumargupta
09-12-2006, 03:27 AM
hi all,

i need a combobox with some operators, like this
<combobox>
<testlistitem text="=" />
<testlistitem text="&lt;" />
<testlistitem text="&gt;" />
<testlistitem text="LIKE" />
</combobox>

here, every item is displaying properly, except second one i.e,. with &lt;.

textlistitem with &gt; is showing '>' and cmb.getText() returns '>'

textlistitem with &lt; is not showing any thing, but it returns '<' symbol.


how to get this

regards
pavan

illogic_code
09-12-2006, 05:39 AM
a while ago i have a problem very liked this yours.
i found that when we put the simbol ">" on the text tag things dont work, like you discribed.
but
i could resolve putting the simbol inside CDATA and outside the text tag.
something like this:

<textlistitem name="tli"><![CDATA[">"]]></textlistitem>

and everithing works well.
thing this is a bug.. dunno. but the workaround is easy.
sry for dont put the code coz i lost it. But that is the idea.

hope this helps.

Luís

pavankumargupta
09-12-2006, 06:41 AM
hi,

thanks for the quick reply.

here is my code,

<combobox name="cmbOperator">
<textlistitem text="NONE" selected="true" />
<textlistitem text="=" />
<textlistitem> <![CDATA["<"]]> </textlistitem>
<textlistitem text="&gt;" />
<textlistitem text="LIKE" /> </combobox>

and the result of cmbOperator.getText() is as given below, when i selected each textlisitem in the same order.

output
------
1) NONE
2) =
3) &quot;&lt;&quot;
4) >
5) LIKE

here in third case i need to get '<' symbol with out quotes.

how to resolve this problem.

regards
pavan.

EvaF
09-12-2006, 01:01 PM
other twist:

<combobox>
<method event="onselect">
<![CDATA[
if (this.value=='&lt;'){
this.setValue('<');
this.setText('<')}
]]>
</method>
<textlistitem text="=" />
<textlistitem text="&amp;amp;lt;" />
<textlistitem text="&gt;" />
<textlistitem text="LIKE" />
</combobox>

pavankumargupta
09-12-2006, 11:01 PM
hi,

thaks for the reply.

this method is also no use. in onselect event, if its value is '&lt;', i set the text to '<'.

the results are same as previous. the text is not displaying in combobox.

and cmb.getText() is returning '<' symbol.

how to display in combobox.

regards
pavan

EvaF
09-12-2006, 11:15 PM
It works for me:

<combobox name="cmbOperator">
<method event="onselect">
<![CDATA[
if (this.value=='&lt;'){
Debug.write(this.value);
this.setValue('<');
this.setText('<')}
]]>
</method>
<textlistitem text="NONE" selected="true" />
<textlistitem text="=" />
<!-- I remove quote -->
<textlistitem> <![CDATA[<]]> </textlistitem>
<textlistitem text="&gt;" />
<textlistitem text="LIKE" />
</combobox>

pavankumargupta
09-12-2006, 11:23 PM
hi,

i have tried it before. and tried it by replacing ur code.

same results. no use.

on select, its displaying empty and getText() method will return '<' symbol.

regards
pavan

origati
02-20-2007, 05:10 AM
Any solution on this?

If you have a LzText instance with text "hello < bye" it just display 'hello'.

If you change the text with the debug window I have this results:

txt.setText('hello < bye') : displays 'hello' on canvas
txt.setText('hello &lt; bye') : displays 'hello < bye' on canvas

But it just works in the debug window, why!?

bfagan
02-20-2007, 05:51 AM
This sounds similar to a bug I filed in JIRA.

try this:


<method event="ontext">
this.setWidth(this.getTextWidth());
</method>