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

Ask A Question

Stats

  • Questions 248k
  • Answers 248k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer the AutoValidate property of the form containing the control defines… May 13, 2026 at 8:59 am
  • Editorial Team
    Editorial Team added an answer manoli.net offers an online copy/paste syntax highlighter: This tool allows… May 13, 2026 at 8:59 am
  • Editorial Team
    Editorial Team added an answer Have you tried fill_color? Code below should work: require "rubygems"… May 13, 2026 at 8:59 am

Related Questions

Given a 2d picture of a rectangle distorted by perspective: I know that the
I am new to haml and want to do some inheritance, but I don't
Is there a way to do something similar to KVC but use the message
I have a website that i've been working on for about a year now.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.