Rendered in selectOneMenu

Hi I would like to use the rendered command to change the value of the selectOneMenu below.
if
rendered="#{editReq.programCode != null}
then I want the value to be editReq.programCode
else
the value should be request2.progkey
h:selectOneMenu value=""#{editReq.programCode}"
binding="#{backing_req_Request2.selectOneMenu1}"
id="selectOneMenu1"
valueChangeListener="#{backing_req_Request2.progChangeListener}" onchange="submit();">
<f:selectItem itemLabel="SelectProgram" itemValue="SelectProgram"/>
<f:selectItems value="#{backing_req_Request2.progList}"
binding="#{backing_req_Request2.selectItems1}"
id="selectItems1"/>
</h:selectOneMenu>

Hi,
did your web.xml file had any parameter regarding explicitly indicating the way to save state?
I mean something like
<context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
  </context-param>One last question: did you stay with request scope beans or session ones?
Greetings.
MogaRick

Similar Messages

  • Rendering of SelectOneMenu

    In the code below during the initial rendering of the JSP the getProjects method is being called twice rather than once, this is the bind method for the f:selectItems tag.
    I have added a phase listener which indicates the following:
    INFO: Server startup in 7563 ms
    PhaseTracker: Before: RESTORE_VIEW 1
    PhaseTracker: After: RESTORE_VIEW 1
    PhaseTracker: Before: RENDER_RESPONSE 6
    ProjectSpendBean: GetProjects
    ProjectSpendBean: GetProjects
    PhaseTracker: After: RENDER_RESPONSE 6
    Any ideas as this will cause performance issues as the data volume increases.
    <%@ page contentType="text/html" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <f:view>
       <f:loadBundle basename="bundles.tmsBundles" var="tms"/>
       <head>
          <title>
            <h:outputText value="#{tms.tmsUserTitle}"/>
          </title>
          <link rel="stylesheet" type="text/css"
               href="<%= request.getContextPath() %>/styles.css" /> 
       </head>
       <body>
         <h:form>
            <h:panelGrid  columns="2"  border="0" columnClasses="menu-style,body-style"
                                                   rowClasses="panel-top"  width="100%" >
                <h:panelGrid columns="1" border="0"  >
                   <h:panelGrid columns="3" cellspacing="10" cellpadding="1" border="0"  >
                   <%--  Project Name --%>
                   <h:outputLabel for="projectName" >
                       <h:outputText value="Project Name: " styleClass="text-normal" />
                   </h:outputLabel>
                   <h:selectOneMenu id="projectName" 
                       styleClass="text-normal"
                       value="#{projectSpend.searchBookingCode}">
                       <f:selectItems value="#{projectSpend.projects}" />
                   </h:selectOneMenu>
                   <!-- submit button --> 
                   <h:commandButton title="submit" value="Search"    styleClass="text-normal"
                       actionListener="#{projectSpend.searchForSpends}" />
                   </h:panelGrid>
                </h:panelGrid>
            </h:panelGrid>
         </h:form>
      </body>
    </f:view>

    What does the page look like when viewed in a browser?
    Which version of DW are you using ?
    If the site is messed up when viewing in a browser, it may be
    best to link
    to a live example of the page, that way people can check the
    code to see if
    there's anything wrong that may be causing the issue.
    Nadia
    Adobe® Community Expert : Dreamweaver
    CSS Templates |Tutorials |SEO Articles
    http://www.DreamweaverResources.com
    ~ Customisation Service Available ~
    http://www.csstemplates.com.au
    Spry Widget Examples
    http://www.dreamweaverresources.com/spry-widgets/
    ~ Forum Posting Guidelines ~
    http://www.adobe.com/support/forums/guidelines.html
    "manchomark" <[email protected]> wrote in
    message
    news:fk9hq0$2r9$[email protected]..
    > For some reason the rendering of the Layers in DW has
    blow out. I don't
    > think
    > anything changed in the css and it was displaying
    correctly. I did DUMP my
    > config file for DW to see if it would resolve, but no.
    >
    > See this screen shot:
    http://www.ntfb.org/dev/problem-layers.gif
    >
    > Someone said this is a known issue but I searched
    extensively here on
    > adobe
    > and I didnt' see it. Using the keywords Render DW css
    layers.
    >
    > Any advice is appreciated.
    >
    >

  • Problem when applying new renderer

    Hi, I am new to JSF, just I am trying to change the rederer for the JSF components, so I am
    trying to add Richfaces renderers. I don't know whether I am applying correct or not but thing
    I am sure some where I am doing mistake thats why I came here to introduce my problem.
    The richfaces renderer class is not able to applying for JSF selectonemenu. So plz help me
    <render-kit>
    <renderer>
    <component-family>javax.faces.component.html.HtmlSelectOneMenu</component-family>
    <renderer-type>selectOneMenu</renderer-type>
    <renderer-class>org.richfaces.renderkit.html.ComboBoxRenderer</renderer-class>
    </renderer>
    </render-kit>
    <render-kit>
    <renderer>
    <component-family>javax.faces.component.UISelectOne</component-family>
    <renderer-type>selectOneMenu</renderer-type>
    <renderer-class>org.richfaces.renderkit.html.ComboBoxRenderer</renderer-class>
    </renderer>
    </render-kit>

    Why are you doing this? Why not just use the components provided by the RichFaces component set that are already associated with those Renderers?

  • SelectOneMenu and custom object

    Hi everybody,
    i have problems using selectOneMenu component.
    <h:panelGroup rendered="#{Navi.rendered}">
                        <h:selectOneMenu id="selPerson" value="#{Navi.user}">
                             <f:selectItems value="#{Navi.list}"/>
                        </h:selectOneMenu>
                   </h:panelGroup>Here is the code from the backing bean:
    private List list;
    private User user;
    public List getList() {
              if (list == null){
                   loadDefault();
              return list;
         public void setList(List list) {
              this.list = list;
         public User getUser() {
              return user;
         public void setUser(User name) {
              this.user = name;
         }The list is loaded from db as follows:
    while (result.next()){
         User user = (User) result.get(0);
         userlist.add(new SelectItem(user,user.getFirstname()+ " 
            "+user.getSurname(),user.getScreenName()));
    }I get a validation error when trying to get the value from the list. Can anybody help? Regards,
    ak

    Hi Sushil,
    To write to the activity stream, these are the things you need
    1) A service definition in service-definition.xml . Similar to here http://docs.oracle.com/cd/E15523_01/webcenter.1111/e10148/jpsdg_svc_intro.htm#JPSDG506
    2) Use the ActivityStreaming API to publish the event. (Note: I have only tried this from within WebCenter Portal so I can't be sure how the API may be called remotely)
         a) oracle.webcenter.activitystreaming.ActivityStreamingService.createActivityElement() to construct the activity element
         b) oracle.webcenter.activitystreaming.ActivityStreamingService.publish() to publish the activity element.
    I can try and distil my code into a sample later this week.

  • How to selectOneMenu

    Hi
    I'm rendering a selectOneMenu and I need to show one value in selected way, of course this must be in a dinamyc way but I don't find how to do it.
    <h:selectOneMenu id="tipo" styleClass="input"  value="#{semaphoreBean.typeId}" style="width:200px;">
         <f:selectItems value="#{semaphoreBean.types}" />                                        
    </h:selectOneMenu>     Could somebody help me please?
    Any help is welcome
    Regards

    Thank BalusC
    but I have a doubt. How can I preset this value if I'm receiving it across of a parameter, let me see that
    this the previous jsp
      <h:commandLink value="Ver mas detalles..." action="#{semaphoreBean.detail}">
             <a4j:actionparam value="#{userLogin.nodeId}" assignTo="#{*semaphoreBean.nodeId*}"></a4j:actionparam>
            <a4j:actionparam value="#{userLogin.indicatorId}" assignTo="#{semaphoreBean.typeId}"></a4j:actionparam>
    </h:commandLink> and this is the current jsp
    <h:selectOneMenu id="tipo" styleClass="input" value="#{semaphoreBean.typeId}" style="width:200px;">
         <f:selectItems value="#{semaphoreBean.types}" />                                        
    </h:selectOneMenu>     
    and the ManagedBean look like this
    private String indicatorId;
         private Collection<SelectItem>types = new ArrayList<SelectItem>();     
         private Long nodeId;
         public SemaphoreBean(){
              System.out.println("const");          
              System.out.println(this.getTypeId());
         public Collection<Indicator> getIndicators() {
              IndicatorService service = getBean().getIndicatorService();
              if(user == null){
                   user = getCurrentUser();
              IndicatorTypeService typeService = getBean().getIndicatorTypeService();
              IndicatorType type = typeService.getTypeByName(this.getTypeId());
              indicators = service.getIndicatorByNode(user, type, nodeId);
              return indicators;
         public void setIndicators(Collection<Indicator> indicators) {
              this.indicators = indicators;
         public String getIndicatorId() {
              return indicatorId;
         public void setIndicatorId(String indicatorId) {
              this.indicatorId = indicatorId;
         public Long getNodeId() {
              return nodeId;
         public void setNodeId(Long nodeId) {
              this.nodeId = nodeId;
         public String detail(){          
              return "detail";
         public Collection<SelectItem> getTypes() {
              System.out.println("getTypes");
              IndicatorTypeService indicatorTypeService = getBean().getIndicatorTypeService();
              if(types.size()==0){
                   for(IndicatorType type : indicatorTypeService.getAllTypes()){
                        SelectItem select = new SelectItem();
                        select.setLabel(type.getDescription());
                        select.setValue(type.getId());
                        types.add(select);
              return types;
         public void setTypes(Collection<SelectItem> types) {
              this.types = types;
         public String getTypeId() {
              return typeId;
         public void setTypeId(String typeId) {
              this.typeId = typeId;
              System.out.println("setTypeId");
         public User getUser() {
              return user;
         public void setUser(User user) {
              this.user = user;
         

  • SelectOneMenu rendering SelectItems List twice

    Hi All,
    I have a bit of a problem I have not been able to track down. I have a JSP that sometimes duplcates my list data in a SelectOneMenu and sometimes the data is only listed once...ie: the list might have selectItem entry values of { All, None } and sometimes {All, None, All, None }.
    The SelectOneMenu code is as follows::
    <td width="*" class="bodyCopy">
           <aa:zoneJSF id="ReleaseZone">                         
                  <h:selectOneMenu id="release" styleClass="bodyCopy" value="#{filterBean.selectedRelease}" immediate="true" >
                                                <f:selectItems value="#{filterBean.release}"/>
                  </h:selectOneMenu>
            </aa:zoneJSF>
    </td>I do see the getter on the FilterBean being invoked multiple times, though I don't think that's the problem as I see the "Release" list data always returning only 2 values (never duplicated). So what confuses me is why the values in the list would be duplicated (or rendered more then once).
    Incase you were wondering, the <aa:> tag is for using Ajax Anywhere with JSF tags.
    Any leads would be appreciated. I don't think of myself as a JSF newbie, but I'm really beginning to suspect otherwise.
    Regards,
    ~Rob.

    It's not clear to me why I'd need to do a list.clear() in the backing bean, but I'll give it a shot. I don't know that I'd need to do this as the getter always returns the correct number of elements in the list.
    But by way of disclosing more information about my backing bean with regards to the release info, see below:
    // --- From the FilterBean object ---
        private SelectItem[] release = null;
        public FilterBean()
            setupReleaseList("All");
            SessionUtil.getSession().setAttribute("filterBean", this);
        public SelectItem[] getRelease()
        {   return(release);    }
        public String setupReleaseList( String _version )
            StringBuffer xml = new StringBuffer();
            xml.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
                 xml.append("<options><option value='All'>All</option><option value='N''>None</option>");
                this.release      = new SelectItem[2];
                this.release[0] = new SelectItem("A","All");
                this.release[1] = new SelectItem("N","None");
            xml.append("</options>");
            return (xml.toString());
        }I started kicking around an idea of using xml, but at htis point It's probably a dead end.

  • Problem rendering JSF selectManyListbox component from JSF selectOneMenu

    hello all. i have a problem rerender-ing selectManyListbox in "onchange" event of selectOneMenu.
    When i used both component as selectOneMenu then rerender-ing works fine but my requirement is to select many option and size also should be set which cannot be done in selectManyMenu component. so my tryint to use selectManyListbox
    So, when i change the rerender-ing component to selectManyListbox then rerendering doesnt work in onchange event of selectOneMenu.
    how can i use the selectManyListbox as rerender in onchange event of selectOneMenu?? please help and thanks in advance. please be free to answer to my post
    NOTE: i have specified 3 component
    1. selectManyListbox
    2. selectOneMenu
    3. selectManyMenu

    Did you found a solution to the problem?
    I am having similar problem in my page.
    Thanks,
    Bablu

  • Problem with selectOneMenu in Datatable

    Hi
    I have the following datatable that binds correctly to a set of Game objects.
    I need to have a dropdown with the numbers 1 to 10 as items which is bound to each dataItem's newRating field.
    However there is some problem with the dropdown that i can't figure out. The datatable stops rendering when it hits the first dropdown.
    At the moment,
    The new rating field in the Game class is of type SelectItem with the appropriate get and set methods.
    Could anyone please point out what I'm doing wrong
    Thanks.
    Here is the relevant part in Home.jsp:
                                              <h:dataTable binding="#{Home.newGamesTable}" id="newGamesTable" value="#{Home.newGames}" var="dataItem">
                                                                <h:column>
                                                                    <f:facet name="header">
                                                                        <h:outputText value=""/>
                                                                    </f:facet>
                                                                    <h:panelGroup layout="block" styleClass="new_game_main">
                                                                        <h:outputText styleClass="new_game_title" value="#{dataItem.title}"/>
                                                                        <h:outputText escape="false" styleClass="new_game_label" value="Date added: "/>
                                                                        <h:outputText styleClass="new_game_data" value="#{dataItem.dateString}"/>
                                                                        <h:outputText escape="false" styleClass="new_game_label" value="Average Rating:"/>
                                                                        <h:outputText styleClass="new_game_data" value="#{dataItem.rating}"/>
                                                                        <h:outputText styleClass="new_game_label" value="Uploaded by:"/>
                                                                        <h:outputText styleClass="new_game_data" value="#{dataItem.userName}"/>
                                                                        <h:commandLink styleClass="new_game_label" value="Play Now!"/>
                                                                        <h:selectOneMenu styleClass="new_game_rating" value="#{dataItem.newRating}">
                                                                            <f:selectItems value="#{ratingItems}" />
                                                                        </h:selectOneMenu>
                                                                        <h:commandLink action="#{Home.rateNewGame}" styleClass="message_link" value="Rate"/>
                                                                    </h:panelGroup>
                                                                </h:column>
                                                            </h:dataTable>and Home.java
    private List<SelectItem> ratingItems = null;
         public List<SelectItem> getRatingItems()
             if (ratingItems == null)
                 ratingItems = new ArrayList<SelectItem>();
                 for (int i = 1; i <= 10; i++)
                     SelectItem item = new SelectItem();
                     item.setValue(Integer.valueOf(i));                        
                     ratingItems.add(item);
             return ratingItems;
         public void setRatingItems(List<SelectItem> items)
             ratingItems = items;        
        private List<Game> newGames = null;
        private boolean hasNewGames;
        public List<Game> getNewGames()
            if (newGames ==null)
                newGames = DataFactory.getNewGames();           
            hasNewGames = !newGames.isEmpty();
            return newGames;
        }

    What do you mean by stops rendering? Can you paste the relevant portion of the output (from view source in the browser).

  • CommandButton with conditional-rendered doesn't work???

    Hi,
    My problem:
    I just would like to show the Submit-Button (commandButton) after I change the value of the "selectOneMenu ". So for that I set the boolean variable for the rednerer to true. After that the Submit-Button is shown. But when I click on that Submit-Button, the action is not invoked?
    But when I remove the "rendered="#{bean.rendered}" attribute from the commandButton, the action is invoke!
    What do I wrong?
    Would be great if someone could help me!
    <h:form id="choose2">
      <h:panelGrid columns="2" rowClasses="panelChooseRow" columnClasses="panelChooseCol">
        <h:outputText value="#{msgs.beanUserName}" />
        <h:panelGroup>
          <h:selectOneMenu id="userMenu" value="#{bean.userName}" onchange="submit()" required="true">  
             <f:selectItems id="userItems" binding="#{bean.userItems}" />
          </h:selectOneMenu>
          <h:message for="userMenu" errorClass="errMsg" />
        </h:panelGroup>
        <h:outputText value="" rendered="#{bean.rendered}"/>
        <h:commandButton id="send" value="#{msgs.beanSave}" action="#{bean.actionModify}" rendered="#{bean.rendered}"/>
      </h:panelGrid>
    </h:form>
    Bean-Code:
      public void setUserName( String newValue )
        _userName = newValue;
        _bRendered = true;
    public String actionModify()
        System.out.println("actionModify");
        return null;
      public boolean isRendered()
        return _bRendered;
      }

    Hi,
    well, I don't see what could be wrong in your code, but I have an example working.
    So I will just post my code and you can compare.
    Some code snipped off my JSF Site:
    <h:commandButton id="upload"  rendered="#{uploadFileBean.check}" onclick="submit()" action="#{uploadFileBean.upload}" value="#{messages.upload}" styleClass="bgTextBright" tabindex="4"/>
    <h:commandButton id="correct" rendered="#{not uploadFileBean.check}" onclick="submit()" action="#{uploadFileBean.correct}" value="#{messages.correct}" styleClass="bgTextBright" tabindex="4"/>Here the code in my uploadFileBean:
    private boolean check;
        public boolean isCheck()
            return check;
        public void setCheck(boolean b)
            this.check = b;
    public String upload()
            String retVal = Constants.UPLOAD_OK;
            return retVal;
    public String correct()
            String retVal = Constants.CORRECT_OK;
            return retVal;
        }There is only one commandButton shown (depending on my check property) and if I press it, the associated action method is called.
    Did you have a look, if you call the right method? Meaning, does the method exist in the given bean? Do you have your bean declared in the faces-config.xml?
    As I can tell you, the posted code works fine, so hope this could help you.

  • How to make use of Listener to auto refresh  items in SelectOneMenu

    Hi,
    I have a transaction jsp page that make use of the SelectOneMenu of which the Selectitems for example consists of all the item_code are added to the dropdownitems through the sessionBean1 ArrayList.
    The problem started when new item_code are being added to the SQL tables using other JSP that allow user to input new item code.
    JSF transaction page using SelectOneMenu could not effectively updated the options to include and reflect the new item subsequently added simply because the page has been rendered to the user .
    I believe using some sort of listener , whenever any action or event took place , JSP that are having the particular UI components being rendered could be auto refresh at the client side of JSP html page.
    Could anyone provide some hints?
    Thank

    Hi,
    Thank for the suggestion,
    In fact I am looking for two possiblity on how to overcome this sort of issues,
    Firstly , if the JSF page has not been rendered , you could always make use of the sessionbean1 to do the job , for example if you add a new item to the selectOneMenu dropitems, you could make use of this method to update the list of items in the dropitems , though it would always be the last items on the sorted list .
    Secondly , using some sort of autorefresh to push to the client to inform the user that new item have been added , advise them to manual refresh the page.
    I am in fact using the first method to add new item to the dropdownmenu for those JSP that involve page forwarding and redirect such as shopping basket / cart beans .
    My concern is when displaying the list of real-time shopping items available to the user , method 1 would not work at all , simply because JSF page was already rendered to the user browser, only beaming alerting message seems to be able to overcome such shortcoming when scenario demand realtime.
    Thank

  • How to set the default item showed in a h:selectonemenu

    I need to show the second, or the third, and on so.
    i tried some ways to set the default item showed in it, but failed.
    i had tried the attribute value, but it stiil showed the first item.
    Can u help me?
    in the JSP
    <h:selectOneMenu id = "companyName" rendered="true" binding="#{j03CMSyainAddBean.selectCompany}" style="width:150">
           <f:selectItems value="#{j03CMSyainAddBean.companyList2}"/>
    </h:selectOneMenu>in the back BEAN
    private UISelectOne selectCompany;
    private ArrayList companyList2;In the ArrayList companyList2, there are several selectItems.
    Thanks
    George

    Sanjeev K Sharma wrote:
    and without messing with /boot/grub/grub.cfg  ?
    I need this so that new kernels show up but do not change the default boot kernel
    Is there a way to do it by file name instead of position within the menuentry / submenu list?
    I found some ubuntu and fedora sugestions but all by position, none by name
    AND how to set the kdump kernel as the default?
    Arch is putting this kernel under a submenu - would this pose problems for setting it as the default?
    In /etc/default/grub you can use the name of your entry you wish to use as default
    GRUB_DEFAULT='Arch Linux, with Linux core repo kernel'
    You can tell grub to stop using submenus by doing:
    GRUB_DISABLE_SUBMENU=y
    Or you can just make a purely custom menuentry in /etc/grub.d/40_custom if you'd like:
    menuentry "Other Linux" {
    linux <KERNEL IMAGE HERE>
    initrd <INITRD IMAGE HERE>
    EDIT: /etc/grub/default -> /etc/default/grub
    Last edited by Slabity (2015-04-07 11:16:22)

  • SelectOneMenu inside h:dataTable gives conversion error

    Hi guys,
    I'm enduring quite alot of misery attempting to put selectOneMenu UI components in my h:dataTable. Due to the 30000 character restriction, I can only submit my view and backing bean and DTO and the converter (even though the total characters of my files is only 26,583? [cat * | wc -c]). Perhaps you can figure out a way I can send me all my files and you'll be able to test it much easier.
    The jist of the problem is that I get a conversion error between the selectOneMenu and the backing DTO of the <h:dataTable>. After I define a converter I get a ClassCastException.
    My BIGGEST question is "Why do I even need a converter?", the selectItem(s)/options are hardcoded label/value Strings and so is the the property of the dataTable row's backing DTO!!!
    Here's the files, any assistance will be greatly appreciated.
    P.S. I'm running JDeveloper 10.1.3.3.
    Thanks.
    (All these files are in the same package so you can just put them all in a directory named "example"):
    My DTO BudgetEquipmentListVO.java:
    package example;
    import java.util.Date;
    import java.util.List;
    public class BudgetEquipmentListVO {
        private Integer rowNo = new Integer("0");               //Row number for paging thru dataTables.
        private String equipmentListId = new String("0");                        //From equipment_list table.
        private Integer equipmentCodeId = new Integer("0");         //From equipment_codes table
        private String objectCode = "0730";                     //So far, 0730,0735 are possible.
        private Integer budgetId = new Integer("0");            //fed_budget_id from fed_budget table.
        private String  description = "";
        private String  equipNo = "";                           //Alphanumeric
        private Date    dateAcquired = new Date();  
        private Integer estimatedCost = new Integer("0");       //Used for Stimulus Application
        private Integer actualCost = new Integer("0");          //Used for EOY expenditures.  Disable for stimulus application
        private String  bldgLocation = "";                      //Address where equipment is at.
        private String  approvedInd = "N";                      //Whether item's been approved or not. Y/N
        private Integer amountApproved = new Integer("0");      //Gets set on approval page.
        private StringBuffer comment = new StringBuffer(4000);  //Currently max 4000 chars
        private String  suppInstInd = "I";            //Support or Instruction item, S or I
        private Integer approvedById = new Integer("0");        //User id of approver.
        private Date    approvedDate = null;                    //Date approved
        private List<BudgetEquipmentListVO> innerList;
        public BudgetEquipmentListVO() {
        public void setObjectCode(String objectCode) {
            this.objectCode = objectCode;
        public String getObjectCode() {
            return objectCode;
        public void setBudgetId(Integer budgetId) {
            this.budgetId = budgetId;
        public Integer getBudgetId() {
            return budgetId;
        public void setDescription(String description) {
            this.description = description;
        public String getDescription() {
            return description;
        public void setEquipNo(String equipNo) {
            this.equipNo = equipNo;
        public String getEquipNo() {
            return equipNo;
        public void setDateAcquired(Date dateAcquired) {
            this.dateAcquired = dateAcquired;
        public Date getDateAcquired() {
            return dateAcquired;
        public void setEstimatedCost(Integer estimatedCost) {
            this.estimatedCost = estimatedCost;
        public Integer getEstimatedCost() {
            return estimatedCost;
        public void setActualCost(Integer actualCost) {
            this.actualCost = actualCost;
        public Integer getActualCost() {
            return actualCost;
        public void setBldgLocation(String bldgLocation) {
            this.bldgLocation = bldgLocation;
        public String getBldgLocation() {
            return bldgLocation;
        public void setApprovedInd(String approvedInd) {
            this.approvedInd = approvedInd;
        public String getApprovedInd() {
            return approvedInd;
        public void setAmountApproved(Integer amountApproved) {
            this.amountApproved = amountApproved;
        public Integer getAmountApproved() {
            return amountApproved;
        public void setComment(StringBuffer comment) {
            this.comment = comment;
        public StringBuffer getComment() {
            return comment;
        public void setSuppInstInd(String suppInstInd) {
            this.suppInstInd = suppInstInd;
        public String getSuppInstInd() {
            return suppInstInd;
        public void setApprovedById(Integer approvedBy) {
            this.approvedById = approvedBy;
        public Integer getApprovedById() {
            return approvedById;
        public void setApprovedDate(Date approvedDate) {
            this.approvedDate = approvedDate;
        public Date getApprovedDate() {
            return approvedDate;
        public void setRowNo(Integer rowNo) {
            this.rowNo = rowNo;
        public Integer getRowNo() {
            return rowNo;
        // Helpers ------------------------------------------------------------------------------------
         // Getters ------------------------------------------------------------------------------------
         public String getKey() {
             return equipmentListId;
         public BudgetEquipmentListVO getValue() {
             return this;
        // This must return true for another Foo object with same key/id.
        public boolean equals(Object other) {
            return other instanceof BudgetEquipmentListVO && equipmentListId != null && equipmentListId.equals(((BudgetEquipmentListVO) other).getEquipmentListId());
        // This must return the same hashcode for every Foo object with the same key.
        public int hashCode() {
            return equipmentListId != null ? this.getClass().hashCode() + equipmentListId.hashCode() : super.hashCode();
        // Override Object#toString() so that it returns a human readable String representation.
        // It is not required by the Converter or so, it just pleases the reading in the logs.
        public String toString() {
            return "BudgetEquipmentListVO[" + equipmentListId.toString() + ", " + equipmentCodeId.toString() + ", " + objectCode + ", " + approvedInd + ", " + suppInstInd + "]";
        public void setEquipmentListId(String equipmentListId) {
            this.equipmentListId = equipmentListId;
        public String getEquipmentListId() {
            return equipmentListId;
        public void setEquipmentCodeId(Integer equipmentCodeId) {
            this.equipmentCodeId = equipmentCodeId;
        public Integer getEquipmentCodeId() {
            return equipmentCodeId;
        public void setInnerList(List<BudgetEquipmentListVO> innerList) {
            this.innerList = innerList;
        public List<BudgetEquipmentListVO> getInnerList() {
            return innerList;
    The View, equipmentList.jspx:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:af="http://xmlns.oracle.com/adf/faces"
              xmlns:afh="http://xmlns.oracle.com/adf/faces/html">
      <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
                  doctype-system="http://www.w3.org/TR/html4/loose.dtd"
                  doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
      <jsp:directive.page contentType="text/html;charset=windows-1252"/>
      <f:view>
      <f:loadBundle basename="myBundle" var="myBundle"/>
        <afh:html>
          <afh:head title="ARRA - Equipment List (0730, 0735)">
            <meta http-equiv="Content-Type"
                  content="text/html; charset=windows-1252"/>
            <link rel="stylesheet" type="text/css" href="/css/crud.css" />
            <script type="text/javascript" src="/js/global.js"></script>
          </afh:head>
          <afh:body>
            <h:form id="equipmentForm">
              <afh:tableLayout width="100%">
                <afh:rowLayout width="100%" halign="center">
                  <afh:cellFormat columnSpan="1" width="100%" halign="center"
                                  rowSpan="1">
                    <h:dataTable value="#{backing_equipmentScreen.dataList}"
                                 binding="#{backing_equipmentScreen.dataTable}"
                                 styleClass="dataTable" rowClasses="rowOdd,rowEven"
                                 var="dataItem" id="table" border="2"
                                 bgcolor="#C2DFFF" width="100%"
                                 rows="#{backing_equipmentScreen.numItems}">
                    <f:facet name="header">
                        <af:outputText value="#{myBundle.headerTable}"
                                       inlineStyle="font-size:small;"/>
                      </f:facet>
                        <h:column>
                            <f:facet name="header">
                                <af:outputText value="#{myBundle.headerColumnRowNumber}"
                                         inlineStyle="font-size:small;"/>
                            </f:facet>
                            <af:outputText value="#{backing_equipmentScreen.dataTable.rowIndex + 1}"
                                       inlineStyle="font-size:small;"/>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnDesc}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:outputText value="#{dataItem.description}"/>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnEquipNo}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:inputText value="#{dataItem.equipNo}"
                                           />
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnDateAcquired}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <af:selectInputDate value="#{dataItem.dateAcquired}"/>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnObjCode}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:selectOneMenu value="#{dataItem.objectCode}" binding="#{backing_equipmentScreen.objCodeMenu}">
                                <f:selectItem id="item1" itemLabel="0730" itemValue="0730"/>
                                <f:selectItem id="item2" itemLabel="0735" itemValue="0735"/>
                                <f:converter converterId="selectOneMenuConverter"/>
                              </h:selectOneMenu>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnInsSuppInd}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:selectOneMenu value="#{dataItem.suppInstInd}" binding="#{backing_equipmentScreen.suppInstMenu}">>
                                <f:selectItem id="supportitem1" itemLabel="Support" itemValue="S"/>
                                <f:selectItem id="supportitem2" itemLabel="Instruction" itemValue="I"/>
                              </h:selectOneMenu>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnEstCost}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:inputText value="#{dataItem.estimatedCost}">
                              <f:convertNumber
                                                currencySymbol="$"
                                                groupingUsed="#{true}"
                                                maxFractionDigits="0"
                                                type="currency"/>
                              </h:inputText>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnActualCost}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:inputText value="#{dataItem.actualCost}">
                              <f:convertNumber
                                                currencySymbol="$"
                                                groupingUsed="#{true}"
                                                maxFractionDigits="0"
                                                type="currency"/>
                              </h:inputText>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnBldgLoc}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:inputTextarea value="#{dataItem.bldgLocation}"/>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnApprovedInd}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:selectOneMenu value="#{dataItem.approvedInd}" binding="#{backing_equipmentScreen.yesNoMenu}">>
                                <f:selectItem id="yesnoitem1" itemLabel="Yes" itemValue="Y"/>
                                <f:selectItem id="yesnoitem2" itemLabel="No" itemValue="N"/>
                              </h:selectOneMenu>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                      <h:column>
                        <f:facet name="header">
                          <h:panelGroup>
                            <afh:rowLayout>
                              <afh:cellFormat inlineStyle="font-size:small;">
                                <h:outputText value="#{myBundle.headerColumnComments}"/>
                              </afh:cellFormat>
                            </afh:rowLayout>
                          </h:panelGroup>
                        </f:facet>
                        <h:panelGroup>
                          <afh:rowLayout>
                            <afh:cellFormat inlineStyle="font-size:small;">
                              <h:inputTextarea value="#{dataItem.comment}"/>
                            </afh:cellFormat>
                          </afh:rowLayout>
                        </h:panelGroup>
                      </h:column>
                        <f:facet name="footer">
                            <h:panelGrid columns="4">
                                <h:outputLabel for="rows" value="#{myBundle.labelRowsPage}:" />
                                <h:panelGroup>
                                    <h:inputText id="rows" value="#{backing_equipmentScreen.dataTable.rows}" styleClass="input" size="1"><f:validateLongRange minimum="1" maximum="100" /></h:inputText>
                                    <h:commandButton value="#{myBundle.buttonSet}" action="#{backing_equipmentScreen.pageFirst}" styleClass="input" />
                                </h:panelGroup>
                                <h:outputText value="#{myBundle.labelPaging}:" />
                                <h:panelGroup>
                                    <h:commandButton value="#{myBundle.buttonFirst}" action="#{backing_equipmentScreen.pageFirst}" styleClass="input" disabled="#{backing_equipmentScreen.dataTable.first == 0}" />
                                    <h:commandButton value="#{myBundle.buttonPrevious}" action="#{backing_equipmentScreen.pagePrevious}" styleClass="input" disabled="#{backing_equipmentScreen.dataTable.first == 0}" />
                                    <h:commandButton value="#{myBundle.buttonNext}" action="#{backing_equipmentScreen.pageNext}" styleClass="input" disabled="#{backing_equipmentScreen.dataTable.first + backing_equipmentScreen.dataTable.rows >= backing_equipmentScreen.dataTable.rowCount}" />
                                    <h:commandButton value="#{myBundle.buttonLast}" action="#{backing_equipmentScreen.pageLast}" styleClass="input" disabled="#{backing_equipmentScreen.dataTable.first + backing_equipmentScreen.dataTable.rows >= backing_equipmentScreen.dataTable.rowCount}" />
                                    <h:outputText value="#{myBundle.labelPage}: #{backing_equipmentScreen.currentPage} / #{backing_equipmentScreen.totalPages}" />
                                </h:panelGroup>
                                <h:outputLabel for="add" value="#{myBundle.labelAddRows}:" />
                                <h:panelGroup>
                                    <h:inputText id="add" value="#{backing_equipmentScreen.addCount}" styleClass="input" size="1"><f:validateLongRange minimum="1" maximum="100" /></h:inputText>
                            <af:commandButton action="#{backing_equipmentScreen.actionAdd}"
                                              styleClass="input"
                                              text="#{myBundle.buttonAdd}"/>
                          </h:panelGroup>
                                <h:outputText value="#{myBundle.labelActions}:" />
                                <h:panelGroup>
                                    <h:commandButton value="#{myBundle.buttonSelectAll}" action="#{backing_equipmentScreen.actionSelectAll}" rendered="#{!backing_equipmentScreen.editMode and !backing_equipmentScreen.selectAll}" styleClass="input" />
                                    <h:commandButton value="#{myBundle.buttonUnselectAll}" action="#{backing_equipmentScreen.actionSelectAll}" rendered="#{!backing_equipmentScreen.editMode and backing_equipmentScreen.selectAll}" styleClass="input" />
                                    <h:commandButton value="#{myBundle.buttonEdit}" action="#{backing_equipmentScreen.actionEdit}" rendered="#{!backing_equipmentScreen.editMode}" styleClass="input" />
                                    <h:commandButton value="#{myBundle.buttonDelete}" action="#{backing_equipmentScreen.actionDelete}" rendered="#{!backing_equipmentScreen.editMode}" styleClass="input" />
                                    <h:commandButton id="save" value="#{myBundle.buttonSave}" action="#{backing_equipmentScreen.actionSave}" rendered="#{backing_equipmentScreen.editMode}" styleClass="input" />
                                    <h:commandButton value="#{myBundle.buttonRefresh}" action="#{backing_equipmentScreen.actionRefresh}" immediate="true" styleClass="input" />
                                    <h:commandButton value="#{myBundle.buttonReset}" action="#{backing_equipmentScreen.actionReset}" immediate="true" styleClass="input" />
                                </h:panelGroup>
                            </h:panelGrid>
                        </f:facet>
                    </h:dataTable>
                    <h:panelGroup rendered="#{empty backing_equipmentScreen.dataList and !backing_equipmentScreen.message}">
                        <h:panelGroup rendered="#{!backing_equipmentScreen.searchMode}">
                            <h:outputText value="#{myBundle.textNoData}" />
                            <h:commandButton value="#{myBundle.buttonAdd}" action="#{backing_equipmentScreen.actionAdd}" styleClass="input" />
                        </h:panelGroup>
                        <h:outputText value="#{myBundle.textRefineSearch}" rendered="#{backing_equipmentScreen.searchMode}" />
                    </h:panelGroup>
                    <h:panelGroup rendered="#{backing_equipmentScreen.message}">
                        <h:outputText value="#{myBundle.textErrors}" styleClass="error" />
                        <h:messages styleClass="error" />
                    </h:panelGroup>
                  </afh:cellFormat>
                </afh:rowLayout>
              </afh:tableLayout>
            </h:form>
          </afh:body>
        </afh:html>
      </f:view>
    </jsp:root>

    Hi evryone,
    I have following piece of code
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <af:document>
    <af:messages/>
    <af:form>
    <af:selectOneChoice>
    <f:selectItem itemLabel="ABC" itemValue="ABC"/>
    <f:selectItem itemLabel="DEF" itemValue="DEF"/>
    <f:selectItem itemLabel="GHI" itemValue="GHI"/>
    <f:selectItem itemLabel="JKL" itemValue="JKL"/>
    <f:selectItem itemLabel="MNO" itemValue="MNO"/>
    </af:selectOneChoice>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    When I run this program , I get following compiler error:
    Error(12): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
    Error(12): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
    Error(13): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
    Error(13): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
    Error(14): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
    Error(14): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
    Error(15): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
    Error(15): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
    Error(16): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
    Error(16): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
    Anyone has any ideas? Where could be problem?

  • Problem with rerendering h:panelGrid with rendered attribute

    Hi,
    I am new to jsf and trying to learn its features as I find it easy and fast for development purpose.I have been developing with jsf for past few weeks and got myself stuck with a problem, tired of which I had to take the forum's help :). My problem is that I need to show/hide h:panelGrid using any of the options below:
    I tried putting the grid in the div and show/hide that div using javascript..works fine but the problem with this is, even when the div is hidden the components (h:inputText ) within the grid are submitted with the form, which should not be the case since its hidden (as with normal jsps).
    I worked around with rendered attribute of the grid, and show/hide this grid using the backing bean method which is actually a valueChangeListener of h:selectOneMenu and set the boolean for the rendered to true/false as required, the grid is hide/shown correctly, but this isn't giving me any solution because when I submit the form with this grid shown on the view, its components values are still not submitted :( I dont know whats the reason behind this or what clue am I missing here. I dont know why when the grid is shown correclty, its components values are not submitted.. hence not validated too..
    Any help will be highly appreciable.
    Regards
    srehman

    >
    gimbal2 wrote:
    No, in "normal jsps" you'll get the same thing - even though you
    visibly hide a component, it is still there and thus will still be part
    of a form submit. If you don't want form fields to submit, you'll have
    to make sure they are physically not there, or the fields are disabled.Well thanks alot for correcting me on this mate.
    Don't know either, it should work if you did everything correctly. Are
    you sure the databinding (to a JSF backing bean field) of the grid is
    correct? When you create a similar setup but without any of the
    show/hide logic, does it work then?I guess I have done it correctly but let me tell you, I have no direct binding to the grid itself, instead I have h:inputText fields in the grid that are bound to the backing bean's properties, which I need to submit and validate too. e.g{color:#800000}<h:panelGrid id="myPanel" columns="3" rendered="Bean.renderStatus">
    <h:outputText value="variable"/>
    <h:inputText id="v" value="Bean.property" required="true">
    <a4j:support ......... />
    </h:inputText>
    </h:panelGrid>{color}
    {color:#800000}<rich:message for="v"/>{color}
    Here I am able to hide and show the grid but I am unable to submit the field in any case whether its hidden or shown :( At first the grid is hidden and then on the valueChangeListener of h:selectOneMenu rendered value is set to either true or false.( renderStatus is set in the value change listener ).
    And yeah without this logic of hide/show its working fine with me. Any guess or idea what am I doing wrong here.
    Thanks for your time by the way.
    Regards,
    Shoaib

  • Value binding not working with rendered attribute

    In my jsf page i'm encountering problem with value binding it is not working for a h:inputText with rendered condition even when the rendered condition evaluates to true & the component is rendered.While trying to retrieve the value of the components with conditional rendering on submit i'm unable to retreive the value while on removing rendered condition the value binding is working perfectly
    <h:selectOneMenu id="DropDown" value="#pc_GeneralRequestInfo.objInfoDTO.State}" rendered="#pc_GeneralRequestInfo.objAddressRequestDetailsDTO.selectedAddressType == 'HOME'}">                    
    <f:selectItems value="#{pc_GeneralRequestInfo.statesList}" />
    </h:selectOneMenu>

    There is a { missing from the value attribute in the code you posted.                                                                                                                                                                                           

  • H:selectOneMenu - Update problem through a Java Function

    Hi,
    I'm designed a little form which has two h:selectOneMenu.
    <h:form>
    <h:selectOneMenu id="listas_disponibles"
                                 value="#{sesion.listaSeleccionada}"
                                 valueChangeListener="#{sesion.escogerLista}"
                                 onchange="submit();"
                                 immediate="true">
        <f:selectItems value="#{sesion.listasConfiguracionIDNombre}"/>
    </h:selectOneMenu>
    <h:selectOneMenu id="listas_hijas"
                                value="#{sesion.listaHijaSeleccionada}"
                                valueChangeListener="#{sesion.escogerListaHija}"
                                onchange="submit()">
        <f:selectItems value="#{sesion.listasHijas}" />
    </h:selectOneMenu>The problem is that when I change the "listas_hijas" value, I want update the "listas_disponibles" value through the "sesion.escogerListaHija" method.
    public void escogerListaHija(ValueChangeEvent value){
    this.listaSeleccionada
    = idListNewValue;
    }But when the JSF page is rendered, the value of "listas_disponibles" hasn't changed.
    Can anybody help me? Need you more data or code? Thanks!!

    Try to access your list through the ValueBinding.In your function
    FacesContext context = FacesContext.getCurrentInstance();
    context.getApplication().createValueBinding("#{sesion.listaSeleccionada}").setValue(context, idListNewValue);
    you must have the setter for you list.

Maybe you are looking for