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 7806141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:26:20+00:00 2026-06-02T02:26:20+00:00

I want to make a form using Primefaces Mobile with jsf2.0 and primefaces-3.0.M2, but

  • 0

What i gotExpectedI want to make a form using Primefaces Mobile with jsf2.0 and primefaces-3.0.M2, but after deploying in jboss server and running it on browser(desktop), the look and feel is not so great. Am i missing some jar files?? Also is there any emulator where i can check and run the mobile webpages. I am using the showcase example at http://www.primefaces.org/showcase-labs/mobile/index.jsf

  • 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-02T02:26:21+00:00Added an answer on June 2, 2026 at 2:26 am

    If your mobile/no mobile applications are separated, you have to insert in your faces-config.xml the following line

    <application>
        <default-render-kit-id>PRIMEFACES_MOBILE</default-render-kit-id>
    </application>
    

    if your mobile/no mobile views are in the same application you have to

    write a viewhandler by overriding calculateRenderKitId API and decide
    when to display the page in mobile mode. This approach is suggested if
    your mobile and non-mobile pages are in same application and you need
    to switch renderkits on-the-fly (from Primefaces Mobile Documentation).

    Here a simple ViewHandler class that uses the Spring Mobile functionalities to switch between mobile and non-mobile pages.

    import javax.faces.application.ViewHandler;
    import javax.faces.application.ViewHandlerWrapper;
    import javax.faces.context.FacesContext;
    import javax.servlet.http.HttpServletRequest;
    
    import org.springframework.mobile.device.Device;
    import org.springframework.mobile.device.DeviceUtils;
    import org.springframework.mobile.device.site.SitePreference;
    import org.springframework.mobile.device.site.SitePreferenceUtils;
    
    /**
     * @author <a href="mailto:gesuino.napoli">Gesuino Napoli</a>
     *
     */
    public class MobileViewHandler extends ViewHandlerWrapper {
    
        private ViewHandler wrapped;
    
        public MobileViewHandler(ViewHandler wrapped) {
        this.wrapped = wrapped;
        }
    
        @Override
        public ViewHandler getWrapped() {
            return this.wrapped;
        }
    
        @Override
        public String calculateRenderKitId(FacesContext context) {
            HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
            Device device = DeviceUtils.getRequiredCurrentDevice(request);
            SitePreference sitePreference = SitePreferenceUtils.getCurrentSitePreference(request);
            if (device.isMobile() || sitePreference == SitePreference.MOBILE) {
                return "PRIMEFACES_MOBILE";
            }
            return this.wrapped.calculateRenderKitId(context);
        }
    }
    

    Then register the ViewHandler into the faces-config.xml

    <application>
            <!-- <default-render-kit-id>PRIMEFACES_MOBILE</default-render-kit-id> -->
            <view-handler>com.acme.myproject.web.util.viewhandler.MobileViewHandler</view-handler>
    ....
    </application>
    

    If you want to test your application with an android emulator you can download and installate the sdk-android

    1. Install Android SDK
    2. Install ADT Eclipse plugin
    3. Create an Android Virtual Device (AVD)

    To do this follow this link: http://developer.android.com/sdk/index.html.

    Then, follow this post to “Getting Your Android Emulator to Read Virtual Hosts on your Development Machine” – http://dillieodigital.wordpress.com/2012/03/19/soup-to-nuts-getting-your-android-emulator-to-read-virtual-hosts-on-your-development-machine/

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

Sidebar

Related Questions

I want to make a form the essentially creates an invoice, but using some
I want to make something like http://www.djangosnippets.org/accounts/register/ using django..the register form. I am new
I want to make discussion form kind of website using java, should i just
I'm using greybox and trying the following thing: I want to make a form
I want to make http form post using NSURLConnection in iOS. I have two
i want to make a form using below code i developed Model for View
Hey Friends I want to make a form builder using Yii. For that I
I want to make registration form and write the data into data.txt using ActiveXObject.
I want to make this form: echo '<form method=post action=ratinghandler.php style=width: 250px> <input type=hidden
I want to make a form like this, and i want to post the

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.