Friday, 20 July 2012

Flex tip: conditions like ‘&&’ in MXML in MXML part



<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
        <mx:VBox x="0" y="0" height="100%" width="100%">
                <mx:CheckBox label="Checkbox 1" id="check1"/>
                <mx:CheckBox label="Checkbox 2" id="check2"/>
                <mx:Label text="{check1.selected && check2.selected?
                        'Both checked':
                        'Not both checked'}"/>
        </mx:VBox>
</mx:Application>
We want to show the string "Both checked" in the label, if both of  the checkboxes are checked, otherwise the label should show "Not both  checked". When you use the above code in Flex, it will show you the  error: "The entity name must immediately follow the ‘&’ in the  entity reference.". It is complaining about the line where the  "&&" appears.
MXML files are treated as XML files and as such the parser expects to  see a symbol name after the "&" character. Hence the error message.
With this in mind, we can convince Flex Builder and the mxml-compiler  to still use "&&" as a condition, by properly escaping them, as  in:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
        <mx:VBox x="0" y="0" height="100%" width="100%">
                <mx:CheckBox label="Checkbox 1" id="check1"/>
                <mx:CheckBox label="Checkbox 2" id="check2"/>
                <mx:Label text="{check1.selected &amp;&amp; check2.selected?
                        'Both checked':
                        'Not both checked'}"/>
        </mx:VBox>
</mx:Application>
The above may look weird in the editor, but it compiles cleanly and does what one would expect.
The same applies to other operators: "< " should be written as "&lt;" and ">" should be written as "&gt;".





Thanks For Visiting..............................

Tuesday, 3 July 2012

FLEX - Function to convert a string into Camel Casing:

FLEX - Function  to convert a string into Camel Casing:


public function camelCaseString(inputstr:String):String
{
var loopcount:int;
var returnstr:String = "";
var origStr:String;
loopcount = inputstr.length;
origStr = inputstr;
while(loopcount>0)
{
var lastSpaceIndex:int = origStr.indexOf(" ",0);
if(lastSpaceIndex<0)
{
lastSpaceIndex=origStr.length;
}
var tempstr:String = origStr.substring(0,lastSpaceIndex);
var firstpartStr:String = tempstr.substr(0,1);
var secondpartStr:String = tempstr.substr(1,tempstr.length);

returnstr =  returnstr+firstpartStr.toUpperCase()   +secondpartStr.toLowerCase()+" ";

origStr = origStr.substring(lastSpaceIndex+1,origStr.length);

loopcount = loopcount - 1;

}

return returnstr;
}






Thanks for Visiting.....

Thursday, 21 June 2012

Bounce Tomcat

How to Bounce tomcat  in Unix using command prompt(using ExPutty)?

Steps:
  1. Connect the unix command Prompt using ExPutty or XShell or some other software using login
      credentials.
  2. Type the command
      $ sudo /etc/init.d/tomcat stop     (to stop tomcat)
      $ sudo /etc/init.d/tomcat start     (to start tomcat)


            Ex: $sudo /etc/init.d/tomcat7 stop
                 $sudo /etc/init.d/tomcat7 start


            Here tocmat7 represents the version of the tomcat.  








Thanks for visiting...............................






  

Wednesday, 23 May 2012

How to know if a PopUpManager window is open

How to know if a PopUpManager window is open or closed


Solution:


       we have the function 'hasVisiblePopups()' function in the PopUpUtils Class  which is available in  below mention Project. This function written true if popUp is opened otherwise returns false.

             http://www.devahead.com/blog/2009/12/getting-all-the-popups-in-a-flex-application/ 




Thanks for visiting......

Friday, 13 April 2012

Flex Developer Help Library Resources

Flex sites:


http://www.cflex.net
http://www.flexauthority.com
http://www.markme.com
http://www.flexdaddy.info
http://www.clinttredway.com/blog
http://www.richinternet.de/blog


Documentation:

http://livedocs.macromedia.com/flex/15/asdocs_en/index.html
http://www.macromedia.com/go/flex15_java_livedocs
http://www.macromedia.com/cfusion/knowledgebase/index.cfm

Lists:

http://www.macromedia.com/cfusion/webforums/forum/categories.cfm?catid=346
http://groups.yahoo.com/group/flexcoders/




Thanks for Visiting.................



Monday, 26 March 2012

Focus Problem on Application StartUp

Focus Problem on Application StartUp

Solution
add below code  in index.template.html  In body tag.

<body onload="document.getElementById('${application}').focus()">



Thanks for Visiting.................

Wednesday, 14 March 2012

Use full setting in PL/SQL Developer


Hi friends,

I am using Pl/Sql Developer IDE to connect different databases and performing different database operations at the same time. Its been proved that Pl/Sql developer is very useful tool for sql and/or plsql statement/query execution.

What I liked in Pl/Sql Developer are

  1. Select some part of the query and execute the selected part in the query. I liked it very much.
  2. Export output result to excel as a table
  3. Code assistant which will display all the tables in that schema when you entered your_schema_name.
  4. Working in different windows like SQL window, Test window, Program window, Command window and Diagram window at the same time
  5. Macros which can do certain action once recorded

What I have learn today is

i) Logon History

Are you able to remember all the username and passwords of different databases?
Fed up of typing username and password everytime when logging?


Use "Fixed Users" option in Logon History Preferences

We can create different menus to differentiate users or type of logons

Syntax:
>Menu
username/password@database

Example:
>Test
abc/abc123@xyz
def/def234@psr

Note: 
  • More than one users under the same menu should be in next line
  • Avoid @ usage in password because database delimeter is @ so it will treat first @ onwards as database

Example: ghi/lkj@123@qwe
Here
username: ghi
password: lkj@123
database: qwe

but
pl/sql developer will treat
username: ghi
password: lkj
database: 123@qwe

Because first @ onwards it will treat as database.
We can have many menus with many logon to connect different databases with very less effort.
Click the Logon Button Arrow and select the menu->username/password@database
It will get connected automatically without typing username and password

Very Useful .. Try it

ii) Auto Replace facility

Open Pl/Sql Developer->Click on Tools->Preferences->Select Editor Preferences

Scroll down to AutoReplace tab and use the syntax and example to use the facility

syntax: shortcutword=full(part)command

example: saf = select * from 

When you type saf and space then you can see select * from as a replacement of saf