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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:13:28+00:00 2026-06-03T18:13:28+00:00

Is it possible to do: jsf code (pseudo): … <f:param name=arg value=document.getElementById(‘naming’).text()> <h:inputText id=naming></h:inputText>

  • 0

Is it possible to do:

jsf code (pseudo):

...
<f:param name="arg" value="document.getElementById('naming').text()">
<h:inputText id="naming"></h:inputText>
...

I mean approach,when <f:param> is set with JS.

Is it bad practice?

Thanks for help.

  • 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-03T18:13:29+00:00Added an answer on June 3, 2026 at 6:13 pm

    You need to use a4j’s commandButton and actionParam to be able to pass a dynamic param back to the server.

    Additionally, you need an attribute on your bean that will receive the param value.

    Example:

    <a4j:commandButton action="#{myBean.action}" value="Submit!">
        <a4j:actionParam name="arg" noEscape="true" value="getTheValue()" assignTo="#{myBean.myBeanArg}" />
    </a4j:commandButton>
    

    Here myBean.myBeanArg will receive the value returned by the javascript function getTheValue().

    Notice the noEscape="true" attribute. This is needed because otherwise the data inside value would be enclosed in single quotes and escaped, resulting in no javascript execution. As stated in the documentation:

    It is possible to use JavaScript expression or function in the “value”
    attribute. In this case the “noEscape” attribute should be set to
    “true”. The result of this JavaScript invocation is sent to the server
    as a value of <a4j:actionparam>.

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

Sidebar

Related Questions

Is it possible in JSF to convert a date value and put it in
Is it possible to test for enum equality in JSF? E.g. where stuff is
I'm trying to integrate Plupload with JSF in the most independent way possible, for
Possible Duplicate: css rule to disable text selection highlighting On my homepage i have
Is it possible to display the current date (today's) in JSF without using a
Possible Duplicate: Javascript fails to access a JSF component by calling through its id
Is it possible to conditionally update JSF components only when validation succeeds? I would
I'm wondering if it is possible to observe a CDI event with multiple JSF
Is it possible to configure JSF 2.0 to remove unnecessary white spaces between XHTML
Is it possible to overload an EL method in JSF 1.1 using Facelets as

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.