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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:14:17+00:00 2026-06-14T02:14:17+00:00

I have to say, that I am not sure is that a problem, but

  • 0

I have to say, that I am not sure is that a problem, but I think so. I have a from where is two submit buttons. With first one I fetch product infos via serial number and with two I submit the whole form again.

Search button and code:

BUTTON 1

<p:column><h:outputLabel value="#{bundle.newRma_label_sarjanumero}" for="sarjanro" /></p:column>
                <p:column><p:inputText id="sarjanro" value="#{MainController.selected.sarjanro}" style="width: 200px;" /></p:column>
                <p:column><p:commandButton icon="ui-icon-search"
                                           action="#{MainController.haeTiedotSarjanrolla}" style="width: 100px;" update=":messagePanel"/></p:column>

 //Fetching product info with serial number
public String haeTiedotSarjanrolla() {
    log.info("sarjanro=" + current.getSarjanro());
    Sarjanumerot s = null;

    s = helper.getSerialInfo(current.getSarjanro());
    if (s != null) {
        current.setAn8(s.getAn8());
        current.setDsc1(s.getDsc1());
        current.setDsc2(s.getDsc2());
        current.setSarjanro(s.getId().getLotn());
        current.setTuotenro(s.getId().getLitm());
    }

    // Back to same page!
    return "newRma";
}

Another button (save)

<p:column><p:commandButton action="#{MainController.talletaUusiRma}" value="#{bundle.newRma_tallenna}" immediate="true" style="width: 220px;"/></p:column>

Save (Button 2) is working, BUT request is empty, there is not any data. I tried to check it like that and it is always NULL:

another field what is not populated after first submit:

<p:row>
            <p:column></p:column>
            <p:column><p:outputLabel value="#{bundle.newRma_shortdesc}" for="shortdesc"/></p:column>
            <p:column><p:inputTextarea rows="4" cols="30" id="shortdesc" value="#{MainController.selected.shortdesc}" style="width: 200px;"/></p:column>

        </p:row>

Map<String, String> parameterMap = (Map<String, String>) FacesContext.getCurrentInstance()
                     .getExternalContext().getRequestParameterMap();
    String temp = parameterMap.get("shortdesc");

temp is always NULL!!

Is there any best practise to handle this with primefaces, ajax, js or something else?

Thanks!
Sami

  • 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-14T02:14:19+00:00Added an answer on June 14, 2026 at 2:14 am

    This works only if the bean is @ViewScoped and if you return null or void from action method.

    If you return non-null or void, such as follows

    // Back to same page!
    return "newRma";
    

    then a brand new view scoped bean instance will be created, hereby trashing the initial one.

    Further, I’m not sure why you used immediate="true" on the second button, this makes no sense, but are you aware that this way the data of non-immediate inputs won’t be processed at all and thus you should do it with the data of the previous non-immediate submit?

    By the way, the way how you collected submitted data makes also no sense. You don’t need to traverse the request parameter map (you used an invalid parameter name by the way). Just directly access the bean properties which are been bound to input values.

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

Sidebar

Related Questions

Let's say I have a class (not a static class), A , that in
At first, i have to say that this topic is very common topic. I
First of all, I have to say that I'm going to talk about System.ComponentModel.Component
So I have a problem that I can not figure out. I am writing
Let's say I have the following Java interface that I may not modify: public
Not sure whether this is the right place, but I have a question related
I have read many people say that model types should not be exposed to
I'm working on a three model relationship with one aspect that I'm not sure
Before saying anything I have to say that, albeit I'm an experienced programmer in
I'm a newcomer to PDO and have to say that I like it so

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.