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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:55:00+00:00 2026-05-12T20:55:00+00:00

I do not know whether it is possible but i want something like <f:view>

  • 0

I do not know whether it is possible but i want something like

<f:view>
<h:form>      
    <div>
        <label for="accountId">Type your account id</label>
        <input type="text" name="accountId"/>
    </div>
    <div>
        <label for="amount">Type amount</label>
        <input type="text" name="amount"/>
    </div>
    <div>
        <!--NOTICE IT IS #{accountService.deposit} -->
        <!--BUT I WANT TO USE #{accountService.deposit(accountId, amount)} -->
        <h:commandButton action="#{accountService.deposit}" value="Deposit amount"/>
    </div>
</h:form>
</f:view>

And my service

@Stateless
@Name("accountService")
public class AccountServiceImpl implements AccountService {

    @RequestParemeter
    protected Integer accountId;

    @RequestParemeter
    protected double amount;

    @PersistenceContext
    private EntityManager manager;

    public void deposit() {
        Account account = manager.find(Account.class, accountId);

        account.deposit(amount);
    }

}

It happens i want to use this one instead of shown above

@Stateless
@Name("accountService")
public class AccountServiceImpl implements AccountService {

    @PersistenceContext
    private EntityManager manager;

    public void deposit(Integer accountId, double amount) {
        Account account = manager.find(Account.class, accountId);

        account.deposit(amount);
    }

}

Is it possible ? If so, what should i use – event or something else – to get my goal ?

regards,

  • 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-12T20:55:01+00:00Added an answer on May 12, 2026 at 8:55 pm

    It is possible,

    In order to get my goal, i need to use the following

    <f:view>
    <h:form>      
        <div>
            <label for="accountId">Type your account id</label>
            <input type="text" name="accountId"/>
        </div>
        <div>
            <label for="amount">Type amount</label>
            <input type="text" name="amount"/>
        </div>
        <div>
            <h:commandButton action="#{accountService.deposit(param.accountId, param.amount)}" value="Deposit amount"/>
        </div>
    </h:form>
    </f:view>
    

    The param.accountId and param.amount is evaluated when the action method is invoked. Although Seam allows use built-in Event context component in EL expression as follows

    <h:commandButton action="#{accountService.deposit(eventContext.accountId, eventContext.amount)}" value="Deposit amount"/>
    

    It does not work as expected. Maybe because of it just work when using a component, not when using a request parameter. If you want to pass a request parameter, use param

    regards,

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

Sidebar

Related Questions

I don't know whether this is possible or not. What I want to do
This is not a major problem, just something I want to know whether or
I want to know if something like this is possible: I've overriden a property
I want to know whether it is possible to use an xml layout file
I want to know whether it is possible to write data in /etc folder
I have a string input that i do not know whether or not is
Obviously it's early days, I do not know whether this is information that is
Please let me know whether its correct or not? I am mapping the whole
First of all i don't know whether the title is relevant or not (please
I know compiler may or may not perform inline expansion of a function whether

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.