a4j:commandButton Back end bean method is not invoked on click event.

I am using below code. It seems back end bean method is not called when I click commandbutton. I think it has some thing to with rendering.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:a4j="http://richfaces.org/a4j"
     xmlns:rich="http://richfaces.org/rich"
     xmlns:cdm="http://mportal.com/cdm">
<ui:composition>
     <rich:panel>
          <a4j:form id="RefreshPropertiesInstanceForm">
               <table id="RefreshPropertiesTable" width="100%" border="0">
                    <tr>
                         <td width="35%" align="right">
                         <div class="fieldLabel">Property File Name :<span
                              class="requiredField">*</span></div>
                         </td>
                         <td style="margin-top: 15px; padding-left: 15px" nowrap="nowrap"
                              align="left"><rich:comboBox id="combo"
                              value="#{testPropertyRefreshHelper.selectedPropertyFile}"
                              enableManualInput="false">
                              <f:selectItems value="#{testPropertyRefreshDetails.propertyFileNameList}" />
                              <a4j:support event="onchange"
                                   reRender="RefreshPropertiesInstanceForm" BypassUpdates="false"
                                   ajaxSingle="true" action="#{testPropertyRefreshHelper.getPropertyFileContentFromRemoteServer}" />
                         </rich:comboBox></td>
                    </tr>
                    <tr>
                         <td style="margin-top: 10px; padding-left: 100px" align="left"
                              colspan="3"><h:inputTextarea id="firstTextArea" value="#{testPropertyRefreshHelper.propertyFileContent}"
                              rows="21" cols="150"
                              style="overflow-x: auto; overflow-y: scroll"
                              rendered="#{testPropertyRefreshHelper.selectedPropertyFile != 'Choose from below'}"
                              disabled="#{testPropertyRefreshHelper.selectedPropertyFile == 'Choose from below'}">
                         </h:inputTextarea></td>
                    </tr>
                    <tr>
                         <td style="margin-top: 10px; padding-left: 400px" align="left"
                              colspan="2">
                         <a4j:commandButton id='refreshPropertyButton' value="refresh"
                              image="#{imageManager.imageMap['REFRESH_BUTTON']}"
                              rendered="#{testPropertyRefreshHelper.selectedPropertyFile != 'Choose from below'}"
                              action="#{testPropertyRefreshHelper.updatePropertyFileContentInRemoteServer}"
                              reRender="RefreshPropertiesInstanceForm" >     
                         </a4j:commandButton>
                         </td>
                    </tr>
               </table>
          </a4j:form>
     </rich:panel>
</ui:composition>
</html>
Every thing works perfectly. But when I click command button "#{testPropertyRefreshHelper.updatePropertyFileContentInRemoteServer}" backing bean method is not invoked. Other componenets are working properly.

try what the linked article says: make your bean session scoped.
NOTE: when working with Ajax I tend to make the backing bean session scoped to have less issues with partial updates and such. If you use JSF 2.0 you could make it view scoped to get the same result.

Similar Messages

  • How to call Back end Bean method on Refresh (F5 from i.e.)

    I am very much new to JSF. I tried hard learning it. But I am not able to achive one thing.
    Question :
    How do we set some value in Back end bean when user presses F5(refresh from i.e)
    I have some root tag as given below. I tried checking properties of a4j:form but nothing seems to be releveant.
    <ui:composition>
         <rich:panel>
              <a4j:form id="FirstForm">
    I am kind of stuck with one week. Please provide help.

    Pasting the entire sample code. Here bBean is singleton.
    <ui:composition>
         <rich:panel>
              <a4j:form id="FirstForm">
         <table id="table" width="100%">
                        <tr>
                             <td style="margin-top: 8px;" class="fieldLabel" nowrap="nowrap"
                                  align="left" width="15%">
                             <p><h:outputText value="Option Name :">
                             </h:outputText> <span class="requiredField">*</span></p>
                             </td>
                             <td style="margin-top: 8px; width: 120px" class="fieldLabel"
                                  nowrap="nowrap" align="left"><rich:comboBox id="combo"
                                  value="#{bBean.selectedOption}"
                                  enableManualInput="false">
                                  <f:selectItems value="#{bBean.getAllOptions}" />
                                  <a4j:support event="onchange"
                                       reRender="FirstForm" BypassUpdates="false"
                                       ajaxSingle="true"" />
                             </rich:comboBox></td>
                        </tr>
                   </table>
              </a4j:form>
         </rich:panel>
    </ui:composition>
    </html>

  • ..this method should be invoked from the event-dispatching thread?

    I see this (the title that is) in every single Java demo/example program on this (Sun's) site. However, I just tend to
    public static void main(String[] args){
       new whateverTheClassIsCalled();
    }And I've seen this approach on other sites and other example programs.
    So what exactly is better about this;
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
        }where createAndShowGUI() sets and packs the frame. I just do all this in the class constructor (when it's a JFrame!)
    So what does all this thread dispatching stuff mean, why should I use it etc etc.
    tia.

    Is it just me? For some reason it rubs me the wrong way that swing isn't thread safe. From what I've read, my understanding is that its safe to modify swing components from other threads as long as they haven't asked to be painted. If you don't do paint(), pack() or setVisible(true) until the end of your initialization, you will be safe.
    The reason for not being thread safe is almost certainly performance. Swing is slow enough as it is. Since the vast majority of Swing activity takes place in response to events and thus is on the EDT, there usually isn't a problem.
    This is a serious nuisance in network and database programs where multiple threads are used. I end up using invokeLater a lot in those cases, but never for initialization. Sun has only started to recomment that recently.
    Note that the fireXXX methods do not put the event on the EDT, these simply create Event objects and send them to Listeners. If they are executed off the EDT the Listeners will get called off the EDT.

  • Using more than one component to a back end bean

    I have to ask,
    if i use a component more than once on a page eg
                        <tr:panelGroupLayout>
                             <tr:selectOneChoice id="HPIDesc" label="HPI Description" value="#{iPISelectBean.selectValue}" >
                                  <f:selectItems value="#{iPISelectBean.scenarioItemDescSelectItems}"/>
                                  <f:attribute name="scenarioItemType" value="HPI"/>     
                             </tr:selectOneChoice>
                             <tr:selectOneChoice id="UnEmploymentDesc" label="Unemployment Description" value="#{iPISelectBean.selectValue}">
                                  <f:selectItems value="#{iPISelectBean.scenarioItemDescSelectItems}"/>
                                  <f:attribute name="scenarioItemType" value="UNEMPLOYMENT"/>     
                             </tr:selectOneChoice>
                             <tr:selectOneChoice id="ZeroDesc" label="Zero Description" value="#{iPISelectBean.selectValue}">
                                  <f:selectItems value="#{iPISelectBean.scenarioItemDescSelectItems}"/>
                                  <f:attribute name="scenarioItemType" value="ZERO"/>     
                             </tr:selectOneChoice>     
                        </tr:panelGroupLayout>     1. is that possible, or a good practice
    2. can I get attribute values for the components in the backend bean.
    Please help..!!

    you need to do a join, there's no other way you can do it. What about using rownum to join the tables
    select a.col1, b.col2, a.col1/b.col2 col3
    from
    (select col1,rownum r1
    from table1) a,
    (select col2,rownum r2
    from table2) b
    where a.r1 = b.r2
    I think this would work. If you play with it more maybe you can even make it easier and more efficient
    null

  • Event structure does not capture mouse click event on toolbar activeX control

    Hi
    We have a toolbar activeX control on FP.  It works perfectly on my computer, but on my coworkers deskyop,  somehow the event structure doesn't capture mouse click event.
    Any idea?  Thanks a lot for any help.
    Anne

    It's a standard activeX control.  I attach a simple vi .
    thanks  for any help.
    Attachments:
    toolbar test.vi ‏41 KB

  • ValueChangeListener not invoking backing bean method

    Hi Everybody
    I am using a valueChangeListener attribute with <h:selectOneListbox>. As i am using onChange, the form is getting submitted but the associated backing bean method is not getting invoked.
    My JSP code:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <html>
       <head>
          <title>Song Detail</title>
       </head>
       <body>
          <f:view>   
               <h:form id="songForm">
                       <H4>Select a song to view detail.</H4>
                </Br>
                       <h:selectOneListbox id="songList" value="#{songBean.selectedSong}"
    valueChangeListener="#{songBean.songInformation}" immediate="true" onchange="submit();">
                              <f:selectItems value="#{songBean.songList}"/>
                     </h:selectOneListbox>
                <p>
                 <h:outputText id="result" value="#{songBean.songDetail}"/>
             </p>   
         </h:form>                  
       </f:view>
      </body>
    </html> My Backing bean method:
    public void songInformation(ValueChangeEvent vce) throws AbortProcessingException
              System.out.println("Method invoked");
           } This songInformation() method is not getting invoked.
    Please help.

    I never say to put every bean in session scope.
    I recommend that the following beans are in session scope:
    (1) the value property of h:dataTable
    (2) the value property of f:selectItems
    (3) the rendered property
    They are evaluated before Update Model Values phase.

  • JSF Problem invoking backing bean method

    I want a backing bean method to be invoked when the submit button is clicked but for some strange reason the method is not getting invoked any Help in this regards would be great.
    I am able to properly get the values from database and display on the page , after the user types in some more additional information like password , hint question the form has to be submitted when clicked on the submit button..
    Register.jsp
    <body>
         <f:view>
         <h:graphicImage url="/header.jpg"></h:graphicImage>
               <br><h:form id="user">
                        <table>
                        <tr>
                             <td>
                                  <h:outputLabel for="" value="uUser Name:" styleClass="orderlabelcell"></h:outputLabel></td><td>
                                  <h:inputText onblur="JavaScript:doSubmit();" value="#{registerFormBean.userName}" id="userName"></h:inputText>
                             </td>
                        </tr>
                        <tr>     
                             <td>
                             <h:outputLabel for="" value="First Name:" styleClass="orderlabelcell"></h:outputLabel></td><td>
                             <h:inputText value="#{registerFormBean.firstName}" id="firstName"></h:inputText></td>
                        </tr>
                        <tr>     
                             <td><h:outputLabel for="" value="Middle Name:" styleClass="orderlabelcell"></h:outputLabel></td><td>
                             <h:inputText id="middleName" value="#{registerFormBean.middleName}"></h:inputText></td>
                        </tr>
                        <tr>     
                             <td><h:outputLabel for="" value="Last Name:" styleClass="orderlabelcell"></h:outputLabel></td><td>
                             <h:inputText id="lastName" value="#{registerFormBean.lastName}"></h:inputText></td>
                        </tr>
                        <tr>
                             <td>
                                  <h:outputLabel for="" value="Password:" styleClass="orderlabelcell"></h:outputLabel></td><td>
                                  <h:inputText id="password" value="#{registerFormBean.password}"></h:inputText>
                             </td>
                        </tr>
                        <tr>     
                             <td><h:outputLabel for="" value="Re-type Password:" styleClass="orderlabelcell"></h:outputLabel></td><td>
                             <h:inputText></h:inputText></td>
                        </tr>
                        <tr>     
                             <td><h:outputLabel for="" value="Password Hint Question:" styleClass="orderlabelcell"></h:outputLabel></td><td>
                             <h:inputTextarea id="hintQuestion" value="#{registerFormBean.hintQuestion}"></h:inputTextarea></td>
                        </tr>
                        <tr>     
                             <td><h:outputLabel for="" value="Password Hint Answer:" styleClass="orderlabelcell"></h:outputLabel></td><td>
                             <h:inputTextarea id="hintAnswer" value="#{registerFormBean.hintAnswer}"></h:inputTextarea></td>
                        </tr>
                        <tr>     
                             <td>
                                  <h:commandButton id="submit" value="Submit" type="submit" action="#{registerFormBean.saveUser}"/>
                                  <h:commandButton id="Reset" value="Reset" type="reset"/>
                                  </td>
                        </tr>
                        </table>
                   </h:form>
         </f:view>
    </body> 
    RegisterFormBean.java
      package services;
    import java.sql.SQLException;
    import java.util.ArrayList;
    import dao.DatabaseHandler;
    import model.User;
    public class RegisterFormBean {
    User selectedUser;
    String userName;
    String firstName;
    String middleName;
    String lastName;
    String password;
    String hintQuestion;
    String hintAnswer;
    String errMsg;
    private DatabaseHandler dbHandle;
    public RegisterFormBean() {
         javax.faces.context.FacesContext context = javax.faces.context.FacesContext.getCurrentInstance();
         javax.faces.application.Application app = context.getApplication();
         dbHandle = (DatabaseHandler)app.createValueBinding("#{databaseHandler}").getValue(context);
    public void setUserDetails() {
         try{
              System.out.println("gettting Details for user: "+userName);
              selectedUser = (User)dbHandle.getUser(userName);
         catch (SQLException e) {
              errMsg = "Problem gettting records";
    public String getUserName() {
         if(null!=userName){
              setUserDetails();
         if(null!=selectedUser)
              return selectedUser.getLoginName();
         else
         return "";
    public void setUserName(String userName){
         this.userName = userName;
    public String getFirstName() {
         if(null!=selectedUser)
              return selectedUser.getFirstName();
         else
         return "";
    public void setFirstName(String firstName) {
         System.out.println("in setFirst name");
         this.firstName = firstName;
    public String getMiddleName() {
         if(null!=selectedUser)
              return selectedUser.getMiddleName();
         else
         return "";
    public void setMiddleName(String middleName) {
         System.out.println("in set middle name...");
         this.middleName = middleName;
    public String getLastName() {
         if(null!=selectedUser)
              return selectedUser.getLastName();
         else
         return "";
    public void setLastName(String lastName) {
         System.out.println("in set last name....");
         this.lastName = lastName;
    public String getPassword() {
         return password;
    public void setPassword(String password) {
         if(null!=password){
              System.out.println("$$$$$$$$$$$$ setting password.."+password);
              selectedUser.setPassword(password);
    public String getHintQuestion() {
         return hintQuestion;
    public void setHintQuestion(String hintQuestion) {
         if(null!=hintQuestion){
              System.out.println("#########  Hint Question "+hintQuestion);
              selectedUser.setHintQuestion(hintQuestion);
    public String getHintAnswer() {
         return hintAnswer;
    public void setHintAnswer(String hintAnswer) {
         if(null!=hintAnswer){
              System.out.println("@@@@@@@  Hint Answer"+hintAnswer);
              selectedUser.setHintQuestion(hintAnswer);
    public String saveUser(){
         String flag = "";
         System.out.println("IN registerUser Method....");
         try{
              if(null!=selectedUser){
                   flag = dbHandle.registerUser(setUserDefaults(selectedUser));
         catch(SQLException se){
         flag="fail";
         System.out.println("FAILED DUE TO THE EXCEPTION :- "+se.getMessage());
         errMsg = "Unable to Register the User...";
         return flag;
    public User setUserDefaults(User user){
         System.out.println("SETTING USER DEFAULTS.....");
         user.setActive(true);
         user.setLoginType("False");
         user.setCreatedUserName("SOMEUSERNAME");
         user.setSecIdFunctionGroup(17);
         user.setChallangeWord("CHANGE IT");
         user.setTrusted(false);
         user.setUserTypeIdTypeOf(1);
         user.setChangePwdNextLogin("False");
         user.setLoginIsDisabled(false);
         user.setPasswordNeverExpires(false);
         user.setThinWorkOrder(false);
         user.setCurrencyTypeId(2);
         return user;
    I am able to fetch the details from Database and display on the page so DAO is working properly hence not copying here
    faces-config.xml
      <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
                                  "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
    <managed-bean>
      <managed-bean-name>databaseHandler</managed-bean-name>
      <managed-bean-class>dao.DatabaseHandler</managed-bean-class>
      <managed-bean-scope>application</managed-bean-scope>
    </managed-bean>
    <managed-bean>
      <managed-bean-name>registerFormBean</managed-bean-name>
      <managed-bean-class>services.RegisterFormBean</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <navigation-rule>
      <from-view-id>/Register.jsp</from-view-id>
      <navigation-case>
       <from-outcome>success</from-outcome>
       <to-view-id>/Success.jsp</to-view-id>
      </navigation-case>
    </navigation-rule>
    </faces-config>

    A conversion or validation error may have been occurred. Add <h:messages/> to the page to note them all. If you're using at least Sun Mojarra 1.2, then you should be able to note them all in the application server logs.

  • How to call the backing bean method through javascript

    Hi
    I have a command button associated with actionListener . Action Listener method associated with backing bean methods.
    I want to fire the event on command button and backing bean method should be invoked from javascript dynamically.
    can anybody help me asap

    JSF<h:form id="formId">
        <h:commandButton id="buttonId" value="submit" actionListener="#{myBean.action}" />
    </h:form>JSdocument.getElementById('formId:buttonId').click();

  • ***How to Invoke backing bean method by DOUBLE-CLICK the table ROW!!***

    Hi,
    How can I collect the selected row value & navigate to next page by DOUBLE-CLICK the result table row.
    My application got searchResult page where I am displaying the list of user in result table. Then selecting any one row and navigating to master details page by clicking the continue button. Button Action method will collect the selected row userID which I am forwarding to the masterDetails page.
    Same functionality I want to do by double click the row instead of clicking the button!!. I want to trigger the backing bean method if the user double click the row basically. Please help me in this how to do this?
    Current button action method:
    *public String userSelected() {*
    FacesCtrlHierNodeBinding binding = (FacesCtrlHierNodeBinding) searchResultTable.getSelectedRowData();
    currentRow = binding.getRow();
    selectedNetID = (String) currentRow.getAttribute("netid");
    System.out.println("selectedNetID -->"+selectedNetID);
    requestContext.getPageFlowScope().put("netid",selectedNetID);
    return "continue";
    *}*

    Puthanampatti ,
    Yes, I am using the same. Below is my code. I am trying to get the object of the MAIN jspx page region (where I am displaying the fragments) and refresh the one. But cant able to get the object for the region it is returning null. without refresh seems the navigation wont work.
    public void doDbClick(ClientEvent clientEvent) {
    FacesCtrlHierNodeBinding binding = (FacesCtrlHierNodeBinding) searchResultTable.getSelectedRowData();
    currentRow = binding.getRow();
    selectedNetID = (String) currentRow.getAttribute("netid");
    System.out.println("selectedNetID -->"+selectedNetID);
    requestContext.getPageFlowScope().put("netid",selectedNetID);
    try{
    FacesContext facesCtx = FacesContext.getCurrentInstance();
    NavigationHandler nh = facesCtx.getApplication().getNavigationHandler();
    nh.handleNavigation(facesCtx, "", "continue");
    System.out.println("region obj -->" +facesCtx.getViewRoot().findComponent("advse1"));
    // Refresh the current region; advse1 is the id of the region component inside jspx page
    AdfFacesContext.getCurrentInstance().addPartialTarget(facesCtx.getViewRoot().findComponent("advse1"));
    catch(Exception e){
    System.out.println("Error is: " +e);
    Is this correct coding to get the region object?? actually the "result table" and "Master details" are 2 different fragments which are linked with task-flow and the task flow is part of main jspx page as a region. I am using that region ID to get the obj, but cant able to get so....!!! any idea

  • Action / actionListener in h:commandButton with managed beans

    I have a problem with a backing bean whose method is not invoked when i click it. I've seen some posts on here about this yet, I still don't understand what I am doing wrong, if anything.
    Some context...I've modeled my application after 'jcatalog' from this article:
    http://www.javaworld.com/javaworld/jw-07-2004/jw-0719-jsf.html . It's simpler than the article -- I'm not using Spring/Hibernate and the persistence is the file system. For each business object (Resource), there's a backing bean (ResourceBean).
    In short, I can't get the backing bean to respond to the button event for 'Add' bound to addAction. This is just like the jcatalog 'createProduct' impl -- which doesn't use the (FacesEvent fe ) approach.
    Anyway, I would appreciate anyone's help to get past this.
    -Lorinda
    (Below are the codes...)
    Here's my beans-config.xml:
         <!-- view -->
         <managed-bean>
              <description>
                   Managed bean that is used as an application scope cache
              </description>
              <managed-bean-name>applicationBean</managed-bean-name>
              <managed-bean-class>
                   com.intalio.qa.tcm.view.beans.ApplicationBean
              </managed-bean-class>
              <managed-bean-scope>application</managed-bean-scope>
              <managed-property>
                   <property-name>viewServicesManager</property-name>
                   <value>#{viewServicesManagerBean}</value>
              </managed-property>
              </managed-bean>
         <managed-bean>
              <description>
                   View service manager impl for business services
              </description>
              <managed-bean-name>viewServicesManagerBean</managed-bean-name>
              <managed-bean-class>
                   com.intalio.qa.tcm.view.beans.ViewServicesManagerBean
              </managed-bean-class>
              <managed-bean-scope>application</managed-bean-scope>
         </managed-bean>
         <managed-bean>
              <description>
                   Backing bean that contains product information.
              </description>
              <managed-bean-name>resourceBean</managed-bean-name>
              <managed-bean-class>
                   com.intalio.qa.tcm.view.beans.ResourceBean
              </managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
    (Note, the applicationBean uses view services manager. The manager is used by the ResourceBean. (It's initialized by the h:output dummy variable reference at the top of my .jsp page)). I can see the initialization in the debug trace.
    Here's the resource bean:
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.FacesException;
    import javax.faces.model.SelectItem;
    import com.intalio.qa.exceptions.DuplicateIdException;
    import com.intalio.qa.exceptions.TCMException;
    import com.intalio.qa.tcm.model.Resource;
    import com.intalio.qa.tcm.view.builders.ResourceBuilder;
    import com.intalio.qa.tcm.view.util.FacesUtils;
    * Resource backing bean.
    public class ResourceBean extends RootBean {
    * The Resource id
         private String id;
         * The Resource name
         private String name;
    * Description
    private String description;
         * the resource type id associated with the Resource
         private String resourceTypeId;
    // the resource type id associated with the Resource
    private List resourceTypeIds;
    * @return Returns the resourceTypeIds.
    public List getResourceTypeIds() {
    return resourceTypeIds;
    * @param resourceTypeIds The resourceTypeIds to set.
    public void setResourceTypeIds(List resourceTypeIds) {
    this.resourceTypeIds = resourceTypeIds;
         * Default constructor.
         public ResourceBean() {
    super();
    init();
         * Initializes ResourceBean.
         * @see RootBean#init()
         protected void init() {
              try {
                   LOG.info("ResourceBean init()");
                   if (id != null) {
                        Resource resource = viewServicesManager.getResourceService().getResourceById(id);
                        ResourceBuilder.populateResourceBean(this, resource);
              } catch (TCMException ce) {
                   String msg = "Could not retrieve Resource with id of " + id;
                   LOG.info(msg, ce);
                   throw new FacesException(msg, ce);
         * Backing bean action to update Resource.
         * @return the navigation result
         public String updateAction() {
              LOG.info("updateAction is invoked");
              try {
         //          Resource Resource = ResourceBuilder.createResource(this);
              //     LOG.info("ResourceId = " + Resource.getId());
              //     viewServicesManager.getResourceService().updateResource(Resource);
                   //remove the ResourceList inside the cache
                   //FacesUtils.resetManagedBean(BeanNames.RESOURCE_LIST_BEAN);
              } catch (Exception e) {
                   String msg = "Could not update Resource";
                   LOG.error(msg, e);
                   FacesUtils.addErrorMessage(msg + ": Internal Error.");
                   return NavigationResults.FAILURE;
              LOG.info("Resource with id of " + id + " was updated successfully.");
              return NavigationResults.SUCCESS;
         * Backing bean action to create a new Resource.
         * @return the navigation result
         public String addAction() {
              LOG.info("addAction is invoked");
              try {
                   Resource resource = ResourceBuilder.createResource(this);
    LOG.info("between");
                   viewServicesManager.getResourceService().saveResource(resource);
              } catch (DuplicateIdException de) {
                   String msg = "This id already exists";
                   LOG.info(msg);
                   FacesUtils.addErrorMessage(msg);
                   return NavigationResults.RETRY;
              } catch (Exception e) {
                   String msg = "Could not save Resource";
                   LOG.error(msg, e);
                   FacesUtils.addErrorMessage(msg + ": Internal Error");
                   return NavigationResults.FAILURE;
              String msg = "Resource with id of " + id + " was created successfully.";
              LOG.info(msg);
              return NavigationResults.SUCCESS;
         * Backing bean action to delete Resource.
         * @return the navigation result
         public String deleteAction() {
              LOG.info("deleteAction is invoked");
              try {
         //          Resource Resource = ResourceBuilder.createResource(this);
         //          viewServicesManager.getResourceService().deleteResource(Resource);
                   //remove the ResourceList inside the cache
    //               FacesUtils.resetManagedBean(BeanNames.RESOURCE_LIST_BEAN);
              } catch (Exception e) {
                   String msg = "Could not delete Resource. ";
                   LOG.error(msg, e);
                   FacesUtils.addErrorMessage(null, msg + "Internal Error.");
                   return NavigationResults.FAILURE;
              String msg = "Resource with id of " + id + " was deleted successfully.";
              LOG.info(msg);
              FacesUtils.addInfoMessage(msg);
              return NavigationResults.SUCCESS;
         public String getId() {
              return id;
         * Invoked by the JSF managed bean facility.
         * <p>
         * The id is from the request parameter.
         * If the id is not null, by using the id as the key,
         * the Resource bean is initialized.
         * @param newQueryId the query id from request parameter
         public void setId(String newId) {
              id = newId;
         public String getName() {
              return name;
         public void setName(String newName) {
              name = newName;
         public String getDescription() {
              return description;
         public void setDescription(String newDescription) {
              description = newDescription;
         public String getResourceTypeId() {
              return resourceTypeId;
         public void setResourceTypeId(String newResourceTypeId) {
              resourceTypeId = newResourceTypeId;
         public String toString() {
              return "id=" + id + " name=" + name;
    Here's the jsp:
    <f:subview id="resourcesCombinedView_subview">
         <h:form id="createResourceForm" target="dataFrame">
              <h:outputText value="#{applicationBean.dummyVariable}" rendered="true" />
              <div align="center">
              <head>
              <link href="../../css/stylesheet.css" rel="stylesheet" type="text/css">
              <FONT color="#191970" size="4" face="Arial">Resources View</FONT>
              </head>
              <table style="margin-top: 2%" width="35%" cellpadding="10">
              <div align="left">
              <FONT color="#191970" size="3" face="Arial">Update Resources </FONT>
              </div>
                   <tr>
                        <td align="center" valign="top" align="center" style="" bgcolor="white" />
                        <table>
                             <tbody>
                                  <tr>
                                       <td align="left" styleClass="header" width="100" />
                                       <td align="left" width="450"/>
                                  </tr>
                                  <tr>
                                       <td align="right" width="100"><h:outputText value="Id" /></td>
                                       <td align="left" width="450"><h:inputText
                                            value="#{resourceBean.id}" id="id" required="true" /> <h:message
                                            for="id" styleClass="errorMessage" /></td>
                                  </tr>
                                  <tr>
                                       <td align="right" width="100"><h:outputText value="Name" /></td>
                                       <td align="left" width="450"><h:inputText
                                            value="#{resourceBean.name}" id="name" required="true" /> <h:message
                                            for="name" styleClass="errorMessage" /></td>
                                  </tr>
                                  <tr>
                                       <td align="right" width="100" valign="bottom"><h:outputText
                                            value="Type" /></td>
                                       <td align="left" width="550">
                                       <h:selectOneMenu
                                            value="#{resourceBean.resourceTypeId}" id="resourceTypeId">
                                            <f:selectItem itemValue="" itemLabel="Select Resource Type" />
                                            <f:selectItem itemValue="database" itemLabel="Database" />
                                            <f:selectItem itemValue="external application"
                                                 itemLabel="External Application" />
                                            <f:selectItem itemValue="internal"
                                                 itemLabel="Intalio|n3 Products" />
                                            <f:selectItem itemValue="os" itemLabel="Operating System" />
                                       </h:selectOneMenu> <h:outputText
                                            value="#{resourceBean.resourceTypeId}" /> <h:message
                                            for="resourceTypeId" styleClass="errorMessage" /></td>
                                  </tr>
                                  <tr>
                                       <td align="right" width="100" valign="bottom"><h:outputText
                                            value="Description" /></td>
                                       <td align="left" width="450"><h:inputText
                                            value="#{resourceBean.description}" id="description" size="96" />
                                       <h:message for="description" styleClass="errorMessage" /></td>
                                  </tr>
                             </tbody>
                        </table>
                        </h:form></td>
                        <!-- END DATA FORM -->
                        <!-- BEGIN COMMANDS -->
                        <td width="30%" align="left" valign="top"><h:form
                             id="buttonCommandsForm">
                             <h:panelGroup id="buttons">
                                  <h:panelGrid columns="1" cellspacing="1" cellpadding="2"
                                       border="0" bgcolor="white">
                                       <h:commandButton value="Add"
                                            style="height:21px; width:51px;font-size:8pt; font-color: black;"
                                            actionListener="#{resourceBean.addAction}">
                                       </h:commandButton>
                                       <h:commandButton id="deleteCB" value="Delete"
                                            style="height:21px; width:51px;font-size:8pt"
                                            action="#{resourceBean.deleteAction}">
                                       </h:commandButton>
                                       <h:commandButton id="spaceFillerButton" tabindex="-1"
                                            style="height:21px; width:51px;font-size:8pt;background-color: #ffffff;color: #ffffff;border: 0px;">
                                       </h:commandButton>
                                       <h:commandButton id="saveCB" value="Save"
                                            style="height:21px; width:51px;font-size:8pt"
                                            actionListener="#{resourceBean.saveAction}">
                                       </h:commandButton>
                                       <h:commandButton id="updateCB" value="Update"
                                            style="height:21px; width:51px;font-size:8pt"
                                            actionListener="#{resourceBean.updateAction}">
                                       </h:commandButton>
                                  </h:panelGrid>
                             </h:panelGroup>
                        </h:form> <!-- end buttons --></td>
                   </tr>
              </table>
              <HR align="center" size="2" width="60%" />
              <!-- data table --></div>
    </f:subview>

    Hey, anyway, have you note your jsp reference to the backing bean begins with a lowercase letter, and your backing bean class name begins with an uppercase letter?? I think that's it... I think, cause I'm too unexperienced in JSF.... Bye!!

  • MOPZ - Error during call of SAP back end system

    Hi Experts,
    I have this error during MOPZ - "select OS/DB dependent files" and following option as well.
    I have checked SAP NOTE 982045, but still cannot solve the issue.
    SM59 - SAP-OSS and SAPOSS connection test is successful.
    I have no idea what else is going wrong. kindly advise id you have any idea.
    Below are some error logs.
    From MOPZ
    Error calling SAP back-end system: Local gateway not running / CPIC-CALL: 'ThSAPCMRCV'SAP-OSS via RFC destination.
    From SM21
    Call of function GwRead failed, RC: -095
    Communication error, CPIC return code 017, SAP return code 24
    > Conversation ID: 13681187
    > CPI-C function: CMRCV
    From dev_rfc8
    **** Trace file opened at 20140904 134347 Malay Peninsula Standard Time, by disp+work
    **** Versions SAP-REL 721,0,300 RFC-VER U 3 1498740 MT-SL
    ======> CPIC-CALL: 'ThSAPCMRCV' : cmRc=17 thRc=247
    Local gateway not running                                               
    ABAP Programm: CL_SM_DATA_SENDER_RFC=========CP (Transaction: )
    Called function module: /SPN/SBI_INTERFACE
    User: BT_BASIS (Client: 100)
    Destination: SAP-OSS (Handle: 4, DtConId: 22F633E42CC0F1D280C9A0D3C1069543, DtConCnt: 1, ConvId: 12214252,{22F633E4-2CC0-F1D2-80C9-A0D3C1069543})
    EPP RootContextId: A0D3C10695431ED48CFEB45C956820C9, ConnectionId: D3F533E43BF2F12C80C9A0D3C1069543, ConnectionCnt: 1
    EPP TransactionId: D3F533E43BF2F12A80C9A0D3C1069543
    SERVER> RFC Server Session (handle: 1, 18243574, {D3F533E4-3BF2-F12C-80C9-A0D3C1069543})
    SERVER> Caller host:
    SERVER> Caller transaction code:  (Caller Program: CL_MO_SMP_ADAPTER=============CP)
    SERVER> Called function module: AGS_MOPZ_SMP_RFC
    Error RFCIO_ERROR_SYSERROR in abrfcpic.c : 3712
    CPIC-CALL: 'ThSAPCMRCV' : cmRc=17 thRc=247
    Local gateway not running                                               
    Error RFCIO_ERROR_MESSAGE in abrfcio.c : 1973
    Thank you.
    Por.

    Hi
    there are following things you can do
    1. log on to your SAP Router
    2. check entries in SAPRoutab.
    3. Telnet SAPSERV2 (Sap responding server) (Tcode oss1 will give you details of which SAP serve you are connecting ) on port 3299
    4. if you are able to telnet SAPserve from your Router server  then raise the call to SAP and ask whether they can reach your saprouter or not
    5. check /etc/services files and check for service 3299 defined or not
    6. telnet local Router server with port 3299
    7 try to download Sap Note from SNOTE in you solman system.
    all the best
    Regards
    Dishant.

  • Using bean methods within JSP declaration

    Is it true that bean methods will not work in JSP Methods ?
    For example:
    // get the bean
    <jsp:useBean id="FormValidate" scope="session" class="fsm.frontendCtr.FormValidate" />
    // build a new method in jsp
    <%!
    boolean validate(HttpServletRequest req, String submitFlag) {
    FormValidate.checkMandatory("ADRNACHNAME");
    %>ServletExec return:
    Undefined Variable or class name: FormValidate
    If i use the bean Methods outside the method it worx.
    Is there a trick with which I can use BeanMethods in a JSP Method?

    Is it true that bean methods will not work in JSP
    Methods ?
    For example:
    // get the bean
    <jsp:useBean id="FormValidate" scope="session"
    class="fsm.frontendCtr.FormValidate" />
    // build a new method in jsp
    <%!
    boolean validate(HttpServletRequest req, String
    submitFlag) {
    FormValidate.checkMandatory("ADRNACHNAME");
    %>ServletExec return:
    Undefined Variable or class name: FormValidate
    If i use the bean Methods outside the method it worx.
    Is there a trick with which I can use BeanMethods in a
    JSP Method?FormValidate is this Object. If you need others, pass them from parameters. Try to understand the structure of servlet generated by your JSP.
    <%!
    boolean validate(HttpServletRequest req, String submitFlag) {
    this.checkMandatory("ADRNACHNAME");
    %>
    hope this helps,
    yang

  • ValueChangeListener not invoked inside h:dataTable h:inpuText

    Hi,
    I'm creating a simple dataTable with an inputText in each row. Each inputText has a valueChangeListener that is never invoked.
    Does anyone know why this is happening ?
    Thanks in advance,
    - Juan

    Thanks for your answer.
    First option is excluded.
    Third option also, because we are using RichFaces dataTable components.
    You are saying that getter method for dataTable value attribute needs to return exactly the same object list which was returned in the request before when the list was populated for the first time, in order for commandButton in dataTable action method to be invoked, right?
    In my case loading managed bean fields in constructor is excluded, because we are using EJB dependency injection, so our EJB's from which we are getting data aren't available in managed bean constructors. They are available in other methods. That leaves me to the field initialization in dataTable value getter method, when the list is populated for the first time. Which is the most elegant way to preserve this list between requests, and retrieve this list in later requests? Is saving object list in FacesContext session possible solution?

  • Closing the JWS Applet: shutdown hook is not invoked

    Windows 2000, Java Web Start 1.4.2_05
    I am running my applet with Java Web Start.
    If I close the JWS Applet window by clicking the upper right "X" button, the applet is being shut down.
    I want to perform a task like showing a warning message, before the applet disappears, but even if I implement the "Shutdown Hook", the according methods are not invoked by JWS.
    Does anybody know, how I can prevent the JWS window from being closed without notifying my applet?

    Another idea: Is it perhaps possible to disable/remove the "X" button from the JWS applet window?

  • Backing Bean method not invoked - h:selectOneRadio

    Hi,
    I am trying to invoke a method in the backing bean when a radio button is selected, but for some reasons the method is not getting invoked, any idea why is it so? copying the code for reference.
    I have a command button in this jsp which when clicked is fetching the records(from the backing bean) perfectly and a radio button for each of the record so user can select any one of the records listed.
    example.jsp
    <%@ page language="java" pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
         <base href="<%=basePath%>">
         <title>My Page</title>
         <meta http-equiv="pragma" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache">
         <meta http-equiv="expires" content="0">   
         <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
         <meta http-equiv="description" content="sample List">
         <!--
         <link rel="stylesheet" type="text/css" href="style.css">
         <link rel="stylesheet" href="styleNN.css" type="text/css">
         -->
         </head>
    <body>
         <f:view>
              <h:form id="contacts">
              <table width="200" border="0" title="sample List" style="border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-style: solid" bgcolor="#F0F0F0" cellpadding="2" cellspacing="2">
                   <h:outputLabel value="Product List:" style="font-family: Verdana, Arial, Sans-Serif; font-size: 14px; color: Black; font-weight: bold; font-style: normal; width: 198px" styleClass="bigfieldcell"></h:outputLabel>
                          </table>
              <br>
         <div style="height: 400px; overflow: auto">
                   <h:dataTable border="1" value="#{contactsBean.contactsList}" var="contact" bgcolor="#EEEEEE" frame="box" styleClass="orderlabelcell" cellpadding="3">
                   <h:column>
                             <f:facet name="header">
                                  <h:outputText value="Select to Edit"/>
                             </f:facet>
                                  *<h:selectOneRadio valueChangeListener="#{contactsBean.test}">*
                    *               <f:selectItem itemValue="#{contact}" />*
                *               </h:selectOneRadio>*               </h:column>
                        <h:column>
                             <f:facet name="header">
                                  <h:outputText value="Category"/>
                             </f:facet>
                             <h:inputText value="#{contact.category}" style="border-right-style: none; border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-color: #FFFFFF; border-top-color: #FFFFFF"></h:inputText>
                        </h:column>
                        <h:column>
                             <f:facet name="header">
                                  <h:outputText value="Location"/>
                             </f:facet>
                             <h:outputText value="#{contact.location}"></h:outputText>
                        </h:column>
                        <h:column>
                             <f:facet name="header">
                                  <h:outputText value="Problem Type"/>
                             </f:facet>
                             <h:outputText value="#{contact.problemType}"></h:outputText>
                        </h:column>
                        <h:column>
                             <f:facet name="header">
                                  <h:outputText value="Problem Details"/>
                             </f:facet>
                             <h:outputText value="#{contact.problemDetails}"></h:outputText>
                        </h:column>
                        <h:column>
                             <f:facet name="header">
                                  <h:outputText value="Contact"/>
                             </f:facet>
                             <h:outputText value="#{contact.contact}"></h:outputText>
                        </h:column>
                   </h:dataTable>
                   </div>
                   </h:form>
              </f:view>
    </body>
    </html>
    faces-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
                                  "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
    <managed-bean>
      <managed-bean-name>contactsBean</managed-bean-name>
      <managed-bean-class>services.ContactsBean</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <managed-bean>
      <managed-bean-name>contactsDatabaseHandler</managed-bean-name>
      <managed-bean-class>dao.ContactsDatabaseHandler</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    </faces-config>
    ContactsBean.java
    package services;
    import java.util.ArrayList;
    import java.util.Hashtable;
    import java.util.List;
    import javax.faces.context.FacesContext;
    import javax.faces.event.AbortProcessingException;
    import javax.faces.event.ValueChangeEvent;
    import javax.faces.model.SelectItem;
    import sun.security.action.GetLongAction;
    import dao.ContactsDatabaseHandler;
    import model.Contact;
    public class ContactsBean {
         private String selectedLocation;
         private List locationList;
         private String selectedProblemType;
         private List problemTypeList;
         private List contactsList;
         private ContactsDatabaseHandler dbHandler;
         private String address;
         private Hashtable region;
         private Contact selectedContact;
         public void test(ValueChangeEvent event)throws AbortProcessingException {
              System.out.println("In Backing Bean : test method.... ");
    }Thanks in Advance

    The valueChangeListener runs at the server side. You need to submit the form to the server side to invoke the valueChangeListener. There is no client side magic like Javascript.
    To submit the parent form on change of the dropdown, just add the following attribute with a piece of Javascript to the h:selectOneMenu:onchange="this.form.submit()"

Maybe you are looking for