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

  • Home
  • SEARCH
  • 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 8722297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:22:51+00:00 2026-06-13T07:22:51+00:00

I am sending values to my view from my bean and from my view

  • 0

I am sending values to my view from my bean and from my view to my bean, everything is fine if I work with event such as “acitonListener” but now I want to send the user to other page (with a navigation rule, it works perfect) when I click on a button, but before of that I want to set in my bean one value, how can I do this?

I am doing something like this

   <p:commandButton value="Send" id="sendButton" action="#{myBean.myMethod}" 
    update=":form:growTop" >
   </p:commandButton>

Before of that there is only a table with <h:outputText/> with values from my bean, any way to do this?

Thanks

  • 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-13T07:22:52+00:00Added an answer on June 13, 2026 at 7:22 am
    action="#{myBean.myMethod(myParameter)}
    

    The above method expression will send myParameter to the myMethod function in your backing bean:

    public void myMethod(String myParameter) {
        // ...
    }
    

    You can also send the user to the next page by returning a valid navigation outcome from your action method:

    public String myMethod(String myParameter) {
        // ...
        return "myPage?faces-redirect=true";
    }
    

    In your concrete case if there is a backing bean value which is printed out:

    <h:outputText value=#{myBean.myParameter}/>
    

    the following action

    <p:commandButton value="Send" id="sendButton" action="#{myBean.myMethod(myParameter)} 
        update=":form:growTop" >
    </p:commandButton>
    

    will pass myParameter to your action method.

    In order to get the expected behavior with primefaces datatable use at least @ViewScoped backing bean behind your table values.

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

Sidebar

Related Questions

Am am successfully parsing and sending JSON values from my client for my server
sending text to label and number to int from tabelview to viewcontroller but it
I am using play 1.2.5. I am sending a JSON object from a view
I'm sending an email from my ASP.NET MVC app using the Spark View Engine
I am encrypting values of variables that I am sending through hyper link such
Im sending a list from my controller class to my View which contain a
Process A is calculating values for objects a1, a2, a3 etc. and is sending
Sending XML from C# Server and receiving it it in Android Java client This
sending mail along with embedded image using asp.net I have already used following but
I sending ajax request from a jQuery file like below, which expects response in

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.