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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:40:18+00:00 2026-05-15T18:40:18+00:00

i am new to JSF. i have a problem with tag my .jsp page

  • 0

i am new to JSF.

i have a problem with tag my .jsp page is like this:

<h:form id="form1">
                <t:inputHidden id="primaryKey"
                    value="#{EditConfigurationBean.primaryKey}" forceId="true" />
                <t:inputHidden id="beanName"
                    value="#{EditConfigurationBean.beanName}" forceId="true" />
                <t:dataTable id="datatable" value="#{EditConfigurationBean.config}"  rowIndexVar="rowIndex" var="rowvar"
                    rowClasses="standardTable_Row1,standardTable_Row2" 
                    columnClasses="standardTable_Column1,standardTable_Column2,standardTable_Column3">
                        <h:column>
                            <f:facet name="header">
                                <h:panelGroup>
                                    <f:verbatim>
                                        <object width="0px" height="0px"></object>
                                    </f:verbatim>
                                    <h:outputText
                                        value="Entry Name" />
                                </h:panelGroup>
                            </f:facet>
                            <h:outputLabel value="#{rowvar.bean.name}"></h:outputLabel>
                        </h:column>
                        <t:column>
                            <f:facet name="header">
                                <h:panelGroup>
                                    <f:verbatim>
                                        <object width="0px" height="0px"></object>
                                    </f:verbatim>
                                    <h:outputText
                                        value="Entry Value" />
                                </h:panelGroup>
                            </f:facet>
                            <h:inputText styleClass="inputText" value="#{rowvar.value}"></h:inputText>
                        </t:column>
                    </t:dataTable>
                        <t:htmlTag value="div" styleClass="commandBar">

        <h:commandButton onmouseover="over(this)" onmouseout="out(this)" action="#{EditConfigurationBean.back}" id="navigation" immediate="true" value="back" styleClass="commandButton" />

        <h:commandButton onmouseover="over(this)" onmouseout="out(this)" action="#{EditConfigurationBean.update}" value="Update" styleClass="commandButton" />

    </t:htmlTag>
            </h:form>

and my backbean code is:

public class ConfigurationEditBean{
    public String getInit(){
        try {
            config = loadConfig();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        if (config != null)
            this.entriesCount =this.config.size();
        return "";
    }
    private int primaryKey;
    private java.lang.String beanName;
    private int entriesCount;
    private List<ConfigurationFullEntry> config;

    public int getEntriesCount() {
        return entriesCount;
    }

    public void setEntriesCount(int entriesCount) {
        this.entriesCount = entriesCount;
    }

    public void setConfig(List<ConfigurationFullEntry> config) {
        this.config = config;
    }

    public int getPrimaryKey() {
        return primaryKey;
    }

    public void setPrimaryKey(int primaryKey) {
        this.primaryKey = primaryKey;
    }

    public java.lang.String getBeanName() {
        return beanName;
    }

    public void setBeanName(java.lang.String beanName) {
        this.beanName = beanName;
    }
    private List<ConfigurationFullEntry> loadConfig() throws Exception{
        List<ConfigurationFullEntry> entriesList = new ArrayList<ConfigurationFullEntry>();
            //do load from DB
        return entriesList;
    }
    public List<ConfigurationFullEntry> getConfig() {
        return config;
    }
    public String update(){
        return "";
    }
    public String back(){
        return "";
    }
}

the problem is that page display correctly but when i am change value of one

tags and submit the form, corresponding setXXX of backbean is not called.

also when i have tried an inputtext tag outside of

wha’s wrong about my codes?
thanks in advance


Update: this is my generated HTML no nested form exist within it.:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><base href="http://localhost:7001"><title>My JSF 'ConfigurationEditor.jsp' starting page</title></head><body><form id="j_id_id2" name="j_id_id2" method="post" action="/HealthMonitorConsole/ConfigurationEditor.jsf" enctype="application/x-www-form-urlencoded"><input type="hidden" id="primaryKey" name="primaryKey" value="0"><input type="hidden" id="beanName" name="beanName" value="com.pardis.healthMonitor.dm.service.ServiceBean"> <table><thead><tr><th scope="col">Name</th><th scope="col">Value</th></tr></thead><tbody id="j_id_id2:j_id_id5:tbody_element"><tr><td>Server</td><td><input id="j_id_id2:j_id_id5:0:j_id_id13" name="j_id_id2:j_id_id5:0:j_id_id13" type="text" value=""></td></tr><tr><td>arash</td><td><input id="j_id_id2:j_id_id5:1:j_id_id13" name="j_id_id2:j_id_id5:1:j_id_id13" type="text" value=""></td></tr></tbody></table><br> 
<input id="j_id_id2:j_id_id14" name="j_id_id2:j_id_id14" type="submit" value="Save" onclick="if(typeof window.getScrolling!='undefined'){oamSetHiddenInput('j_id_id2','autoScroll',getScrolling());}"> <input type="hidden" name="autoScroll"> <input type="hidden" name="j_id_id2_SUBMIT" value="1"><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5SQ5BLInRDoWgWvcMUADuXlYwCWVxYrNWghZBdlolM+1zLfQTh4aUm4="></form>
<script type="text/javascript"><!--

    function getScrolling()
    {
        var x = 0; var y = 0;if (self.pageXOffset || self.pageYOffset)
        {
            x = self.pageXOffset;
            y = self.pageYOffset;
        }
         else if ((document.documentElement && document.documentElement.scrollLeft)||(document.documentElement && document.documentElement.scrollTop))
        {
            x = document.documentElement.scrollLeft;
            y = document.documentElement.scrollTop;
        }
         else if (document.body) 
        {
            x = document.body.scrollLeft;
            y = document.body.scrollTop;
        }
        return x + "," + y;
    }

//--></script>
</body></html>

i am writing every thing like tutorial examples but it does not work!

  • 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-15T18:40:19+00:00Added an answer on May 15, 2026 at 6:40 pm

    You need to ensure that exactly the same datamodel is preserved during the apply request values phase of the form submit as it was during the render response phase of the initial page display. A normal place is to do the preloading is the constructor of the backing bean.

    public class Bean {
        private List<Item> items;
    
        public Bean() {
            items = itemDAO.list();
        }
    
        // ...
    }
    

    An alternative is to put the bean in the session scope, but this has more impact on user experience.

    Since you’re using Tomahawk, you can also just set the preserveDataModel attribute of the t:dataTable to true like so:

    <t:dataTable preserveDataModel="true">
    

    This will store the datamodel in the view’s component tree (which in turn is stored in the session scope) so that exactly the same datamodel is available in the subsequent request.

    See also:

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

Sidebar

Related Questions

I have jsf page: .... <form jsfc=h:form action=> <h:dataTable value=#{newMusician.strings} var=preferredMusicGenre id=musicGenresSelectTable> <h:column> <h:inputText
I have this new problem. I have the following code in JSF 2.0 with
I am new to JSF and have a problem with my simple JSF application.
I'm new to Maven and JSF and I have the following problem when compiling
I'm new to JSP/JSF and I've run into a problem with my JSP. I
I have a JSF page with two forms (pseudo-code below). First form is for
I have a JSF Portlet which has user form in the view JSP. The
I am new to jsf. I have the bellow code. When I place ui:repeat
I am new to JSF and struggling with a problem. I am hoping that
I have a JSF 2.0 page that I want to allow a GET parameter

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.