Adding an icon in Adempiere button


While
Adempiere provides configurable way of defining a button, one of the thing it
has missing is allowing you to put an icon on a button. While text is of course
useful, many times combination of icon with the text makes things more explicit
and reduces training need for the end user. This is what you need to do to be
able to add an icon on an Adempiere button:

 

Step1

Create
one column in the ad_column table to store the image location

         

alter
table only ad_column add column imagelocation character varying(60)

 

Step2

1.    Then login as 
System/System Administrator

2.    Go to “table
and column” and search for ad_column and configure the above created
column.

3.    Go to Window Tab
& Field and search for “Table and column “–>go to
“column” tab of this window and create field for above create
column.

 

So
the last two points creates widget in the “column” tab of
“Table And Column”

 

Step
3

 

1.   
Add following code in the
GridFieldVO.java like this

 

public
String  
imageLocation="";

 

for (int i = 1; i <=
rsmd.getColumnCount(); i++)

                                    {

                          ——————————–

                         
——————————–

                         
else if
(columnName.equalsIgnoreCase(
"imagelocation"))

                                                     
      vo.
imageLocation = rs.getString (i);

                 
        ——————————–

                         
——————————–

                 
}

          

2.   
Add the following code in
GridField.java

 

      public String getImageLocation()

            {

                        return m_vo.imageLocation;

            }

           

 

3.   
Add the following code in
WbuttonEditor.java

             
private void init()

      
{

        
——————————–

        
——————————-

       

       
getComponent().setImage(
gridField.getImageLocation());

        
———————————

        
————————————-

       
}
   

                      

Now
you are all set to use icon on your Adempiere button. I hope you found this
article useful.
Walking Tree is a leading provider of
Adempiere based ERP implementation and if you need our professional services
then do contact
us
with exact detail about your need.

Tagged with: , ,
Posted in ADempiere
4 comments on “Adding an icon in Adempiere button
  1. Nasir Aftab says:

    Good explanation . . .

  2. This is cool. I wrote about your site in http://sourceforge.net/projects/adempiere/forums/forum/611167/topic/3958856/index/page/1

    Do u want your contribution to be in the ADempiere project?

    • wtcindia says:

      Hi Redhuan,
      We are in middle of few deliveries. We do have plan to contribute few cool things to Adempiere community. I will let Ajit Kumar (Author of Adempiere Cookbook, and CTO of the company Walking Tree), decide about the timing.

      Thank you for putting our link on sourceforge.

      Regards
      Alok

    • Ajit Kumar says:

      Hi Red1,

      Following is the initial set of items that we have identified::

      1. Localization of ADempiere for Indian language (Hindi to start with)
      2. complete Mailbox functionality including integration with Mozilla Thunderbird
      3. Enhanced Import/Export
      4. Shopping cart integration with VirtueMart & osCommerce
      5. Improved Help
      6. Enhancement to Application Dictionary
      7. PoC of using the Naked Objects pattern

      Regards
      Ajit

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

We Have Moved Our Blog!

We have moved our blog to our company site. Check out https://walkingtree.tech/index.php/blog for all latest blogs.

Sencha Select Partner Sencha Training Partner
Xamarin Authorized Partner
Recent Publication
%d bloggers like this: