<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pinch Hitter Solutions</title>
	<atom:link href="http://www.phs4j.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phs4j.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Wed, 23 May 2012 20:00:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Add searchfield to a sencha touch 2 list MVC</title>
		<link>http://www.phs4j.com/2012/05/add-a-searchfield-to-a-sencha-touch-2-list-mvc/</link>
		<comments>http://www.phs4j.com/2012/05/add-a-searchfield-to-a-sencha-touch-2-list-mvc/#comments</comments>
		<pubDate>Thu, 17 May 2012 22:40:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sencha Touch 2]]></category>
		<category><![CDATA[Add searchfield]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[search bar]]></category>
		<category><![CDATA[search field]]></category>
		<category><![CDATA[Searchfield]]></category>
		<category><![CDATA[Sencha Touch]]></category>

		<guid isPermaLink="false">http://www.phs4j.com/?p=431</guid>
		<description><![CDATA[Adding a search field to your sencha touch 2 list is fairly straight forward, there is a good example (list-search) that comes with the sencha touch 2 download. Though to add the searchfield to a list in the MVC style can be a wee bit challenging. Here is a way you can do it! You [...]]]></description>
			<content:encoded><![CDATA[<p>Adding a search field to your sencha touch 2 list is fairly straight forward, there is a good example (<em>list-search</em>) that comes with the sencha touch 2 download. Though to add the searchfield to a list in the MVC style can be a wee bit challenging. Here is a way you can do it! You will need a basic understanding of Sencha Touch 2 and it&#8217;s MVC structure.</p>
<p>First we will create a list with the search field. We will place the search field on the bottom toolbar. Like so. <em>(see code below)</em></p>
<pre name="code" class="javascript">
Ext.define('App.view.View', {
    extend: 'Ext.List',
    alias:'widget.contactlist',
    fullscreen: true,
    id: 'contactlist',
    config:{
        disableSelection:true,
        store:'Contacts',
        itemTpl:'{first_name} {last_name}',
        items:[{
            xtype:'toolbar',
            docked:'top',
            title:'Contact List'
        },{
            xtype:'toolbar',                                       //  bottom toolbar
            docked:'bottom',
            items:[{
                xtype: 'searchfield',                          //  here is the searchfield
                itemId:'contact_search',
                id:'contact_search',                         //   we will be using this id in the controller
                placeHolder: 'Search Contacts'
            }]
        }]
    }
});</pre>
<p>An example Store to populate our list and to use for our search functionality could look as so. <em>(see code below)</em></p>
<pre name="code" class="javascript">Ext.define('App.store.Contacts', {
    extend: 'Ext.data.Store',
    config: {
        model: 'App.model.Contacts',
        autoLoad :true,
        sorters: 'last_name',
        grouper : function(record) {
            return record.get('last_name')[0];
        },

        proxy: {
            type: 'ajax',
            url : 'contacts.json',  //  the json file that holds all our contact info.
            reader: {
                type: 'json',
                rootProperty:'contacts'}
        }
    }
});</pre>
<p>An example Model too. <em>(see code below)</em></p>
<pre name="code" class="javascript">Ext.define('App.model.Contacts', {
    extend: 'Ext.data.Model',
    config: {
        fields: [
            {name: 'first_name',  type: 'string'},
            {name: 'last_name',  type: 'string'}
        ]
    }
});</pre>
<p>Here is the json that we will be using to populate our list and that we already defined as contacts.json in the Contacts store.<em>(see code below)</em></p>
<pre name="code" class="javascript">{
    "contacts": [
    {
        "first_name": "Brandon",
        "last_name": "Beachy"
    },
    {
        "first_name": "Jair ",
        "last_name": "Jurrjens"
    },{
        "first_name": "Mike",
        "last_name": "Minor"
    }
    ]
}</pre>
<p>Then inside your app&#8217;s controller we can implement the <em>list-search</em> code that came with the sencha touch 2 download. Take note of <strong>this.control()</strong> and the functions defined below it. <em>(see code below)</em></p>
<pre name="code" class="javascript">Ext.define('App.controller.Main', {

    extend: 'Ext.app.Controller',
    init: function() {

        this.control({

            '#contact_search':{  //  the id or itemId we gave our searchfield
                scope: this,
                clearicontap: this.onSearchClearIconTap,
                keyup: this.onSearchKeyUp
            }

        });
    },
    onSearchKeyUp: function(field) {
        //get the store and the value of the field
        var value = field.getValue(),
        store = Ext.getCmp('contactlist').getStore();    //  getting the store that drives the contact list

        //first clear any current filters on thes tore
        store.clearFilter();

        //check if a value is set first, as if it isnt we dont have to do anything
        if (value) {
            //the user could have entered spaces, so we must split them so we can loop through them all
            var searches = value.split(' '),
            regexps = [],
            i;

            //loop them all
            for (i = 0; i &lt; searches.length; i++) {
                //if it is nothing, continue
                if (!searches[i]) continue;

                //if found, create a new regular expression which is case insenstive
                regexps.push(new RegExp(searches[i], 'i'));
            }

            //now filter the store by passing a method
            //the passed method will be called for each record in the store
            store.filter(function(record) {
                var matched = [];

                //loop through each of the regular expressions
                for (i = 0; i &lt; regexps.length; i++) {
                              var search = regexps[i],
             didMatch = record.get('first_name').match(search) ||
                                  record.get('last_name').match(search);
                            //if it matched the first or last name, push it into the matches array 

                               matched.push(didMatch);

                         }  //if nothing was found, return false (dont so in the store)               

              if (regexps.length &gt; 1 &amp;&amp; matched.indexOf(false) != -1) {
                              return false;
                          } else {
                             //else true true (show in the store)
                             return matched[0];
                            }
            });
        }
    },

    /**
     * Called when the user taps on the clear icon in the search field.
     * It simply removes the filter form the store
     */
    onSearchClearIconTap: function() {
        //call the clearFilter method on the store instance
        Ext.getCmp('contactlist').getStore().clearFilter();
    }

})</pre>
<p>Then finally you can tie it all together with your app.js, an example of that could look like this. <em>(see code below)</em></p>
<pre name="code" class="javascript">Ext.application({
     name: 'App',

     controllers: ['Main'],
     stores: ['Contacts'],
     models: ['Contacts'],
     views: ['View'],

      launch: function() {

         Ext.Viewport.add({
             xtype: 'contactlist'
         });

     }
});
</pre>
<p><a href="http://www.phs4j.com/wp-content/uploads/contact-list.png"><img src="http://www.phs4j.com/wp-content/uploads/contact-list.png" alt="" title="contact-list" width="654" height="465" class="alignnone size-full wp-image-524" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phs4j.com/2012/05/add-a-searchfield-to-a-sencha-touch-2-list-mvc/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Developing IBM i Apps for Mobile Devices</title>
		<link>http://www.phs4j.com/2011/09/developing-ibm-i-apps-for-mobile-devices/</link>
		<comments>http://www.phs4j.com/2011/09/developing-ibm-i-apps-for-mobile-devices/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 14:21:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AS400]]></category>
		<category><![CDATA[IBM i]]></category>
		<category><![CDATA[Mobile Apps for AS400]]></category>
		<category><![CDATA[Mobile Apps for IBMi]]></category>

		<guid isPermaLink="false">http://www.phs4j.com/?p=396</guid>
		<description><![CDATA[Our very own Scott Salisbury had the honor of presenting to OCEAN, A User Group of Southern California, on the nuances of building mobile apps for IBM i. Not sure how long this will be up on their Home page, but here&#8217;s the link to OCEAN and the post&#8230;details below. http://www.ocean400.org/ When considering the available [...]]]></description>
			<content:encoded><![CDATA[<p>Our very own Scott Salisbury had the honor of presenting to OCEAN, A User Group of Southern California, on the nuances of building mobile apps for IBM i. Not sure how long this will be up on their Home page, but here&#8217;s the link to OCEAN and the post&#8230;details below.</p>
<p><a href="http://www.ocean400.org/">http://www.ocean400.org/</a></p>
<p><img src="http://t3.gstatic.com/images?q=tbn:ANd9GcSB9Et2MUjH-CUFEjGbfoX0MkER9xGyB8HWxBx8K_xqoORx9U6zpA" alt="" /></p>
<p><strong>When considering the available technologies needed to bring mobile device solutions to IBM i, developers are faced with a number of questions:</strong></p>
<p>1. What technology choices are available “in the wild” for mobile device programming in general, and what works well with IBM i?<br />
2. Can RPG be used to leverage existing business logic in the mobile arena?<br />
3. What is the learning curve for building these applications?</p>
<p>4. What gotchas or things to consider are lurking when making a commitment to mobile device programming?</p>
<p><strong>Scott Salisbury will explore HTML5 and Javascript technologies now widely in use for mobile device programming and will unpack the above questions and their answers!</strong></p>
<p><strong><br />
</strong></p>
<p><strong>About the Speaker:</strong></p>
<p>Scott Salisbury has spent 25 Years as a technology professional working at all levels of the organization, including software development, project management, software/hardware infrastructure management and senior management.   Scott has worked extensively with IBM i, Unix/Linux and Windows environments and has managed a variety of IT-related departments including programming, networking, telecommunications, project management, technical writing, quality assurance and technology audit.</p>
<p>He has spent the past 10 years focused on web-based technologies including software design and development as well as hardware and network infrastructure concepts.As a consultant, Scott has worked with Coca Cola Enterprises, Union Bank of California, Toyota Logistics, and Kenco Logistics. Scott has written several how-to articles over the years in the technology press.  His work can be seen at MCPressOnline.com and systeminetwork.com.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phs4j.com/2011/09/developing-ibm-i-apps-for-mobile-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Force an ExtJS textfield to uppercase</title>
		<link>http://www.phs4j.com/2011/05/force-an-extjs-textfield-to-uppercase/</link>
		<comments>http://www.phs4j.com/2011/05/force-an-extjs-textfield-to-uppercase/#comments</comments>
		<pubDate>Wed, 11 May 2011 17:44:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Extjs 3]]></category>

		<guid isPermaLink="false">http://www.phs4j.com/?p=297</guid>
		<description><![CDATA[To style a textfield to uppercase you only need to add a style to the textfield&#8217;s config option. For example; { xtype:'textfield', fieldLabel:'User ID', itemId:'userid', style:'text-transform: uppercase', listeners:{ scope:this, specialkey: function(f,e){ if(e.getKey()==e.ENTER){ Ext.Msg.alert('','You typed '+ loginForm.getComponent('userid').getValue().toUpperCase()); } } } } In the example above we used &#8216;text-transform: uppercase&#8217; in the style config to force uppercase. [...]]]></description>
			<content:encoded><![CDATA[<p>To style a textfield to uppercase you only need to add a <em>style</em> to the textfield&#8217;s config option.<br />
For example;</p>
<pre name="code" class="javascript">
                   {
                        xtype:'textfield',
                        fieldLabel:'User ID',
                        itemId:'userid',
                        style:'text-transform: uppercase',
                        listeners:{
                            scope:this,
                            specialkey: function(f,e){
                                if(e.getKey()==e.ENTER){
                                    Ext.Msg.alert('','You typed '+
                                        loginForm.getComponent('userid').getValue().toUpperCase());
                                }
                            }
                        }

                    }
</pre>
<p>In the example above we used <strong>&#8216;text-transform: uppercase&#8217;</strong>  in the <em>style</em> config to force uppercase.  (as shown on line 5)<br />
This takes care of the visual aspect.<br />
When you access the field in your js you still need to use <strong>myField.toUpperCase();</strong>  (as shown on line 11)</p>
<p>Jr</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phs4j.com/2011/05/force-an-extjs-textfield-to-uppercase/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to process the Enter key with ExtJS</title>
		<link>http://www.phs4j.com/2011/05/how-to-process-the-enter-key-with-extjs/</link>
		<comments>http://www.phs4j.com/2011/05/how-to-process-the-enter-key-with-extjs/#comments</comments>
		<pubDate>Thu, 05 May 2011 22:43:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Extjs 3]]></category>

		<guid isPermaLink="false">http://www.phs4j.com/?p=263</guid>
		<description><![CDATA[To use the Enter key on your ExtJS forms, you need to setup a listener on your input fields. For example: { xtype: 'textfield', fieldLabel:'Password', inputType:'password', listeners:{ scope:this, specialkey: function(f,e){ if(e.getKey()==e.ENTER){ Ext.Msg.alert('Keys','You pressed the Enter key'); } } } } So in the example above, there is a specialkey listener on the password field. If [...]]]></description>
			<content:encoded><![CDATA[<p>To use the Enter key on your ExtJS forms, you need to setup a listener on your input fields.</p>
<p>For example:
<pre name="code" class="javascript">
                    {
                        xtype: 'textfield',
                        fieldLabel:'Password',
                        inputType:'password',
                        listeners:{
                            scope:this,
                            specialkey: function(f,e){
                                if(e.getKey()==e.ENTER){
                                    Ext.Msg.alert('Keys','You pressed the Enter key');
                                }
                            }
                        }

                    }
</pre>
<p>So in the example above, there is a <strong>specialkey</strong> listener on the password field.  If you press Enter while the password field has focus, the <strong>specialkey</strong> event will fire, your listener will get control and you can then handle the field and/or the form the same way clicking a button would.</p>
<p>Scott</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phs4j.com/2011/05/how-to-process-the-enter-key-with-extjs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Extend Ext Grid Timeout</title>
		<link>http://www.phs4j.com/2010/02/extend-ext-timeout-for-grids/</link>
		<comments>http://www.phs4j.com/2010/02/extend-ext-timeout-for-grids/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 20:49:41 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Extjs 3]]></category>

		<guid isPermaLink="false">http://pinchhittersolutions.com/?p=93</guid>
		<description><![CDATA[In my last post, I showed how to extend the timeout for an Ext.Ajax.request({&#8230;}); request. Extending the timeout for other Ext objects is not so simple. For grids needing information from the server, you will have to use a connection object and reference it in the datastore via an HttpProxy Object. Take a look at [...]]]></description>
			<content:encoded><![CDATA[<p>In my last post, I showed how to extend the timeout for an Ext.Ajax.request({&#8230;}); request.</p>
<p>Extending the timeout for other Ext objects is not so simple.  For grids needing information from the server, you will have to use a connection object and reference it in the datastore via an HttpProxy Object.  Take a look at this connection object.</p>
<pre name="code" class="javascript">

  var conn = new Ext.data.Connection({
            url: "/myurl.do",
            method: "POST",
            timeout:180000,
            baseParams:{
                cust: "555",
                state: "TN",
                start: 0
            }
        });
</pre>
<p>Note that we have extended the timeout to 180000 (3 minutes).</p>
<p>This encapsulates everything about the ajax request, including the timeout value.  Now that we have this connection object, we can pass it to basically anything and it will be used in place of the defaults and in our case we our interested in extending the 30 second default timeout for an Ext grid.  The connection object is useful elsewhere as well.</p>
<p>Here is an example datastore object that can use the connection object:</p>
<pre name="code" class="javascript">
var myDataStore = new Ext.data.Store({
    proxy: new Ext.data.HttpProxy(conn),
    reader: new Ext.data.JsonReader({
        root: 'myDataArray',
        totalProperty: 'totalCount',
        fields: [
            {
                name: 'field1'
            },
            {
                name: 'field2'
            }
        ]
    })
});
</pre>
<p>So in this case, this datastore is is wrapped around a JsonReader for the purpose of loading a grid.</p>
<p>The grid would reference the datastore which references the connection.</p>
<p>Scott</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phs4j.com/2010/02/extend-ext-timeout-for-grids/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Extend Ext JS Ajax Timeout</title>
		<link>http://www.phs4j.com/2010/02/extend-ext-js-ajax-timeout/</link>
		<comments>http://www.phs4j.com/2010/02/extend-ext-js-ajax-timeout/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 16:20:35 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Extjs 3]]></category>

		<guid isPermaLink="false">http://pinchhittersolutions.com/?p=53</guid>
		<description><![CDATA[To extend the timeout for  Ext.Ajax.request({.....});

  Ext.Ajax.timeout = 90000;  // this changes the 30 second default to 90 seconds]]></description>
			<content:encoded><![CDATA[<p>The default timeout for Ext ajax requests is 30 seconds.   Sometimes that is plenty but other times it&#8217;s not nearly enough. </p>
<p>To extend the timeout duration for  Ext.Ajax.request({&#8230;..}); you must add the following statement:</p>
<p> <strong> Ext.Ajax.timeout = 90000; // this changes the 30 second default to 90 seconds</strong></p>
<p>Since Ext.Ajax is a singleton, this only needs to be done once at the top of the js file that you want to extend the timeout for.</p>
<p>So once the above line executes, the Ext.Ajax.requests will allow for a 90 second timeout.  The value is in milliseconds so just add 3 zeros to whatever timeout you want the timeout duration to be:</p>
<p>90000 (90 seconds)</p>
<p>180000 (3 minutes)</p>
<pre name="code" class="javascript">
Ext.onReady(function(){

                // Extend timeout for all Ext.Ajax.requests to 90 seconds.
                // Ext.Ajax is a singleton, this statement will extend the timeout
                // for all subsequent Ext.Ajax calls.
                Ext.Ajax.timeout = 90000;

                Ext.MessageBox.show({
                    title: "Executing Ajax Call",
                    msg: "Timeout has been extended",
                    buttons: Ext.MessageBox.OK,
                    icon: Ext.MessageBox.INFO
                });

                // Make ajax call.  Timeout is now set to 90 seconds.
                Ext.Ajax.request({
                    url: '/myurl.do',
                    params:{
                        action: "getInfo",
                        cust: "555"
                    },
                    success: function(response) {

                        var returnValue = response.responseText;

                        Ext.MessageBox.show({
                            title: "Customer Info",
                            msg: "Here is your customer info " + returnValue,
                            buttons: Ext.MessageBox.OK,
                            icon: Ext.MessageBox.INFO
                        });

                    },
                    failure: function(response) {
                        Ext.MessageBox.show({
                            title: "Ajax Call Failed",
                            msg: "Your timeout was extended but the call still failed.",
                            buttons: Ext.MessageBox.OK,
                            icon: Ext.MessageBox.ERROR
                        });

                    }
                });
            });</pre>
<p><a class="aligncenter" title="Ext.Ajax API" href="http://www.extjs.com/deploy/dev/docs/?class=Ext.Ajax" target="_blank">Ext.Ajax API</a></p>
<p><em>Scott</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phs4j.com/2010/02/extend-ext-js-ajax-timeout/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
