Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7814337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:09:51+00:00 2026-06-02T05:09:51+00:00

I have created a VerticalFieldmanager optFieldManager in which i have added some CustomButtons Then

  • 0

I have created a VerticalFieldmanager optFieldManager
in which i have added some CustomButtons
Then i want to invoke the button’s functionality using touch event method
i tried this using the TouchEvent() method
For this i do fetch the index of optFieldManager which gives the index value as 0
which confirms that the field is present
But then i again ask for the field inside the manager which returns -1 value which means there is no field added to Manager … which isn’t true
I debugged the code and found that the clicked postions are correctly returned

int index1=optionVertFldMgr.getFieldAtLocation(message.getX(1), message.getY(1)); 

but the index1 value comes as -1 which is wrong

what’s the problem

I have added the snippet of code below

protected boolean touchEvent(TouchEvent message) {

            switch(message.getEvent())
            {

            case TouchEvent.CLICK:
            {
                int index=getFieldAtLocation(message.getX(1), message.getY(1));
                //int index1=optionVertFldMgr.getFieldAtLocation(message.getX(1), message.getY(1));
                if(index!=-1)
                {
                    Field field=getField(index);
                    if(field.equals(optionVertFldMgr))  
                    {

                        int index1=optionVertFldMgr.getFieldAtLocation(message.getX(1), message.getY(1));
                        System.out.println("HELOOOOOOO"+((VerticalFieldManager) field).getFieldAtLocation(message.getX(1), message.getY(1)));
                        //int index1=optionVertFldMgr.getFieldWithFocusIndex();
                        if(index1>-1)
                        {
                            Field fld=optionVertFldMgr.getField(index1);
                            if(fld.equals(m_agendaBtn))
                            {
                                fld.setFocus();
                                return true;
                            }else if(fld.equals(m_eventFeedBackBtn))
                            {
                                fld.setFocus();
                                UiApplication.getUiApplication().pushScreen(new EventFeedbackScreen());
                                return true;
                            }
                        }
                    }
                }
            }
            }
            return false;
            }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T05:09:52+00:00Added an answer on June 2, 2026 at 5:09 am

    You can always override Field.navigationClick on each button, or even override once in the screen and manage from there all events from every field:

        public boolean navigationClick(int status, int time){
            Field f = getLeafFieldWithFocus();
            if(f == button1){
                //do something 1
                return true;    
            } else if(field == button2){
                //do something 2
                return true;
            }
            //more fields
            return false;   
        }
    

    This approach works both for touchscreens and trackpad.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created some forms using zendframework on my local machine that send the
I have created one application in which i want to display compass.but my application
I have created some Load Tests to an HTTP server which consist of simple
I have created a basic site using ASP.NET routing according to Mike Ormond's example
i have created a simple public ref class in the vc++ project, which is
I have created one table using the below command: create table Table1( Id int
I have created an ActiveX dll using VB6 and packaged it using the Package
I have created an xPages application which uses a lot of server side javascript
I have created a module in Magento which takes certain views from customers about
I have created a tab-pane using HAML as shown in my code snippet below

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.