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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:59:51+00:00 2026-05-25T15:59:51+00:00

I’ve got a page which loads a picture and the user is able to

  • 0

I’ve got a page which loads a picture and the user is able to crop it. The thing is, the value of (x1,y1) and (x2,y2) are js and I need them on my backBean. How will I pass it to my BackBean?

<script type="text/javascript">

    $(function(){

        $('#jcroptarget').Jcrop({

        trackDocument: true,

        onChange: showCoords,

        onSelect: showCoords,

        aspectRatio: 1

        });
    });

    function showCoords(c)
    {

        $('#x').val(c.x);

        $('#y').val(c.y);

        $('#x2').val(c.x2);

        $('#y2').val(c.y2);

        $('#w').val(c.w);

        $('#h').val(c.h);

    };

</script>

<div>
    <label>X1 <input type="text" name="x" id="x" size="4" /></label>
    <label>Y1 <input type="text" name="y" id="y" size="4" /></label>
    <label>X2 <input type="text" name="x2" id="x2" size="4" /></label>
    <label>Y2 <input type="text" name="y2" id="y2" size="4" /></label>
    <label>W <input type="text" name="w" id="w" size="4" /></label>
    <label>H <input type="text" name="h" id="h" size="4" /></label>
</div>
  • 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-05-25T15:59:52+00:00Added an answer on May 25, 2026 at 3:59 pm

    If those inputs are in the same form which submits to the backing bean, then you can grab them from the request parameter map:

    Map<String, String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
    String x = params.get("x");
    String y = params.get("y");
    String x2 = params.get("x2");
    String y2 = params.get("y2");
    String w = params.get("w");
    String h = params.get("h");
    

    Or, you can declare them as a managed properties, so that JSF will set them upon construction of the request scoped bean:

    @ManagedProperty("#{param.x}")
    private Integer x;
    @ManagedProperty("#{param.y}")
    private Integer y;
    @ManagedProperty("#{param.x2}")
    private Integer x2;
    @ManagedProperty("#{param.y2}")
    private Integer y2;
    @ManagedProperty("#{param.w}")
    private Integer w;
    @ManagedProperty("#{param.h}")
    private Integer h;
    

    Or, you can bind those inputs to bean properties, so that you don’t need to grab them manually or get them as managed properties:

    <label>X1 <h:inputText id="x" value="#{bean.x}" size="4" /></label>
    <label>Y1 <h:inputText id="y" value="#{bean.y}" size="4" /></label>
    <label>X2 <h:inputText id="x2" value="#{bean.x2}" size="4" /></label>
    <label>Y2 <h:inputText id="y2" value="#{bean.y2}" size="4" /></label>
    <label>W <h:inputText id="w" value="#{bean.w}" size="4" /></label>
    <label>H <h:inputText id="h" value="#{bean.h}" size="4" /></label>
    

    with just those properties:

    private Integer x;
    private Integer y;
    private Integer x2;
    private Integer y2;
    private Integer w;
    private Integer h;
    

    and don’t forget to fix the jQuery selectors to prepend the <h:form id> value:

    $('#formId\\:x').val(c.x);
    $('#formId\\:y').val(c.y);
    $('#formId\\:x2').val(c.x2);
    $('#formId\\:y2').val(c.y2);
    $('#formId\\:w').val(c.w);
    $('#formId\\:h').val(c.h);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used javascript for loading a picture on my website depending on which small
I need to clean up various Word 'smart' characters in user input, including but
I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.