SelectBooleanCheckBox value pickup

Hi ppl ,
I have a small problem with rendering checkboxes.....
Basically i do some logic ( not elaborating as i feel not too relevant ), and it boils down in the end to a value that i hold in my transient attribute.
Now, if the value of this attribute is "Y" i want my selectBoolean checkbox to be checked else unchecked.
I know for sure that my transient variable holds the right value i.e Y and N , as i display another column with outputText and i can clearly see the Ys and Ns displayed correctly.
1) I tried dropping a selectBooleanCheckBox with selected State Value : Y and Unselected State Value :N
this generated the following in by page definition:-
<button id="MenuTreeViewObjGrantIndicatorStatus"
IterBinding="MenuTreeViewObjIterator">
<AttrNames>
<Item Value="GrantIndicatorStatus"/>
</AttrNames>
<ValueList>
<Item Value="Y"/>
<Item Value="N"/>
</ValueList>
</button>
And this was on the jspx
<af:column sortable="false" headerText="Permission">
<af:selectBooleanCheckbox value="#{bindings.MenuTreeViewObjGrantIndicatorStatus.inputValue}"
label="#{bindings.MenuTreeViewObjGrantIndicatorStatus.label}"/>
</af:column>
But it doesn't seem to be performing as expected, it just remains unchecked always.
If i check the box and do a save, i can see the values change in my outputText value column , but the checkbox remains unchecked on a page refresh....
2) i tried using EL in the selected tag value of teh boolean checkbox , but this just turned the whole darn thing to a read only...
any light would be greatly appreciated....
Thanks

http://blogs.oracle.com/Didier/Samples#3 may help
Regards,
Didier.

Similar Messages

  • Saving h:selectBooleanCheckbox   value to databse

    Hi All,
    I want to save "Y" if my checkbox selected on my JSP page & "N" if my check box is not selected in JSP.
    How to do this with,
    <h:selectBooleanCheckbox>
    I am doing in JSP as,
    <h:selectBooleanCheckbox value="#{managedRoleBean.isUserManager}"
    in my backing bean i defined isUserManager variable as,
    public class ManagedRolebean
    private String isUserManager;
    // corresponding getters & setters.
    but still that value is not saving to Databse
    Thanks in advance
    Sandip

    Hi,
    Thanks a lot.
    Now if I select checkbox "Y" is saving to databse.
    If not select checkbox then "N" is selecting to DB.
    but while editing record I want to show checkbox to be selected or not selected as it is while saving to DB.
    Means while saving if I have checked the checkbox then while editing record that checkbox should remain in checked mode.
    How to do this ?
    Thanks in advance
    Sandip Patil

  • Restoring af:selectBooleanCheckbox value after setting visible=true

    Using JDev 11.1; I have a table that displays data from a model object, and one of the columns contains true/false values which we render in the table using an af:selectBooleanCheckbox. All works fine except that user is able to hide the table by expanding other components which sets visible=false on the bounding component for the table. If user elects to redisplay the table by reducing the other component zoom, then the table displays again but the selected check-marks/tags do not return.
    Thought initially it might've been because the query was being reissued on the table, but not so. More about the selected attribute on the af:selectBooleanCheckbox, which I have set to the default (false). So the value property is set to the table collection attribute as required to interface with the model, but I need to know what to set the selected attribute to. I can see that when the table is redisplayed, this default value of false is being sent through to the model which is discarding the values I want to retain.
    I've tried some EL in the selected property to set it to true/false based on what's in the table, but the problem with that is that it becomes essentially a read-only control. I need to find some way to disable the value assignment when making the table visible again. Any suggestions?
    Thanks,

    Andrefs,
    In ADF BC, one way we deal with this is by adding a transient Boolean attribute to the View Object with getters (translate 0/1 to false/true) and setters (vice-versa). Then, we bind the UI to the transient attribute. It's been so long since I've done EJB's, but could you take a similar approach?
    John

  • Af:selectBooleanCheckbox | value setting and auto submitting

    Hi
    Could somebody please guide me on the following issue?
    I have a table based out of a view object alone. I added the table an additional column which contains a selectBooleanCheckbox.
    I want this check box be selected depending on a value of another column when the page is loaded. Once it is loaded, I should be able to check/uncheck and get the complete row details so that I can able to process then add/remove it to the DB.
    Any help would be much appreciated.
    Regards
    Praveen

    But i am not able to set the checkBox once it is loadedIf your transitent attribute has a Groovy expression-based default value, then this attribute could not be updated anymore. I faced similar problem some time ago. Such attributes are considered "calculated" and their values are calculated always based on the specified expression. As a workaround you could define the "boolean" attribute as an SQL-derived attribute instead of transient one (by including in the SQL query an expression that corresponds to the initial value you need).
    You may have a look at this thread for some other hints:
    {thread:id=2128888}
    Dimitar

  • SelectBooleanCheckBox value

    Hi, I have af:selectBooleanCheckBox on my page it is binded to a RichSelectBooleanCheckbox property in a bean . How can I programmaticaly set checkbox
    selected property to true (checked)?

    This is my use case: value property of af:selectBooleanCheckbox is point to an expression but I can't checked or uncheked it it from the web page. Can you tell me why? http://groundside.com/blog/DuncanMills.php?title=multi_select_in_af_table&more=1&c=1&tb=1&pb=1
    This is what I would like to achieve.
    <af:table value="#{bindings.People1.collectionModel}" var="row"
    rows="#{bindings.People1.rangeSize}"
    first="#{bindings.People1.rangeStart}"
    emptyText="#{bindings.People1.viewable ? 'No rows yet.' : 'Access Denied.'}"
    fetchSize="#{bindings.People1.rangeSize}"
    selectedRowKeys="#{bindings.People1.collectionModel.selectedRow}"
    selectionListener="#{bindings.People1.collectionModel.makeCurrent}"
    rowSelection="single" partialTriggers="selectAllBtnID">
    <af:column sortProperty="PersonSelect" sortable="true"
    headerText="#{bindings.People1.hints.PersonSelect.label}"
    headerNoWrap="true">
    <af:selectBooleanCheckbox
    id="selectOneCheckBoxID"
    autoSubmit="true"
    value="row.PersonSelect == 1"/>
    </af:column>

  • Value change listener method on h:selectBooleanCheckbox in h:dataTable

    Hello,
    Does JSF handle value change listeners as expected when they are attached to h:selectBooleanCheckbox components within an h:dataTable?
    In the following example, I have a JSP that has some h:selectBooleanCheckbox components nested in an h:dataTable, and some that aren't. When I bulid and deploy the example to Tomcat 5.5, I can see (using the log4j output) that the value change listener methods for the checkboxes that are NOT in the dataTable are fired, but the ones that are in the dataTable do not get fired.
    I am using Sun's RI of JSF, version 1.1.0.1.
    Thanks,
    Scott
    ----------------------------- JSP:
    <%@ page language="java" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <f:view>
    <h:form>
    <h:dataTable value="#{checkboxBean.beans}" var="thisBean">
         <h:column>
              <h:outputText  value="#{thisBean.id}: " />
         </h:column>
         <h:column>
              <h:selectBooleanCheckbox value="#{thisBean.checked}" valueChangeListener="#{checkboxBean.somethingChanged}" />
         </h:column>
    </h:dataTable>
         <h:panelGrid columns="2">
              <h:outputText value="One:"/>
              <h:selectBooleanCheckbox id="firstOne" valueChangeListener="#{checkboxBean.somethingChanged}" />
              <h:outputText value="Two:"/>
              <h:selectBooleanCheckbox id="secondOne" valueChangeListener="#{checkboxBean.somethingChanged}" />
              <h:panelGroup/>
              <h:commandButton value="Do Stuff" action="#{checkboxBean.doStuff}" />
         </h:panelGrid>
    </h:form>
    </f:view>----------------------------- Beans:
    package workshop;
    import javax.faces.event.ValueChangeEvent;
    import org.apache.log4j.Logger;
    * Test attaching value change listener methods to checkboxes.
    public class CheckboxBean {
        private static final Logger logger = Logger.getLogger(CheckboxBean.class);
        private SomeBean[] beans = null;
        public CheckboxBean() {
            logger.debug("CheckboxBean()");
        public String load() {
            SomeBean[] someBeans = new SomeBean[3];
            someBeans[0] = new SomeBean("firstGuy", false);
            someBeans[1] = new SomeBean("2ndGuy", false);
            someBeans[2] = new SomeBean("third", false);
            this.setBeans(someBeans);
            return null;
        public String doStuff() {
            logger.debug("doStuff()");
            return this.load();
        public void somethingChanged(ValueChangeEvent e) {
            logger.debug("somethingChanged() in component with id " + e.getComponent().getId() );
        public SomeBean[] getBeans() {
            logger.debug("getBeans()");
            return this.beans;
        public void setBeans(SomeBean[] beans) {
            logger.debug("setBeans()");
            this.beans = beans;
    package workshop;
    public class SomeBean {
        private boolean checked = false;
        private String id = null;
        public SomeBean() {
        public SomeBean(String anId, boolean bool) {
            super();
            this.id = anId;
            this.checked = bool;
        public String getId() {
            return this.id;
        public void setId(String id) {
            this.id = id;
        public boolean isChecked() {
            return this.checked;
        public boolean getChecked() {
            return this.checked;
        public void setChecked(boolean checked) {
            this.checked = checked;
    }----------------------------- 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>
        <description>Checkbox bean.</description>
        <managed-bean-name>checkboxBean</managed-bean-name>
        <managed-bean-class>workshop.CheckboxBean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>
    </faces-config>----------------------------- log4j config:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
        <appender  name="RollingFile" class="org.apache.log4j.RollingFileAppender" >
              <param name="File" value="/Users/scott/workshop/logs/workshop.log"/>
            <param name="Append" value="false"/>
            <param name="MaxFileSize" value="4096KB" />
            <param name="MaxBackupIndex" value="4" />
            <layout class="org.apache.log4j.PatternLayout">
              <param name="ConversionPattern" value="%d{DATE} %-5p %-15c{1} : %m%n"/>
            </layout>
        </appender>
        <category name="workshop" >
          <priority value="debug" />
        </category>
        <root>
            <priority  value="warn" />
            <appender-ref  ref="RollingFile" />
        </root>
    </log4j:configuration>

    I have Just run into the same problem. When using the following code inside a data table the valueChangeListener event is not fired when the checkbox has it's value changed. Is this a bug?
    I created a simple page with just a form and the selectBooleanCheckbox. This time the valueChangeListener event fired OK. It seems the problem only occurs when the check box is inside the dataTable
    here is the code snippet
    <h:form >
    <h:column>
    <f:facet name="header">
         <h:outputText value="Add to Basket"/>
    </f:facet>
    <h:selectBooleanCheckbox immediate="true" valueChangeListener="#{reportsResultHandler.addToBasket}" value="#{reportsResultHandler.addbasketChecked}" onchange="this.form.submit
    ();"/>                              
    </h:column>
    </h:form>

  • Can't select value in af:selectBooleanCheckbox

    I have a query where i bring a column from this part of my query:
    DECODE((SELECT GR.GESDOPCCOD FROM GESDROL GR
    WHERE GR.GESDOPCCOD=GO.GESDOPCCOD
    AND(:PV_CODROL IS NOT NULL AND GR.GESDROLCOD=:PV_CODROL)),NULL,'NoRegistrado','Registrado')REGISTRADO
    I drag and drop it from the data control as a selectBooleanCheckbox. So if the query returns "Registrado" then the selectBooleanCheckBox has to be selected. I do it like this:
    <af:selectBooleanCheckbox selected="#{row.Registrado=='Registrado'}"
    id="sbcReg"/>
    The results are ok, the problem is that i can`t not select or deselect, even though in the ViewObjec the attribute has the property : IsUpdatable="true"

    I modify the query to return true or false as string and i can select the value of <af:selectOneBooleanCheckbox>
    SELECT GO.GESDOPCCOD
    ,GO.GESDOPCACH
    ,GO.GESDOPCNVL
    ,GO.GESDOPCRUT
    ,DECODE((SELECT GR.GESDOPCCOD FROM GESDROL GR
    WHERE GR.GESDOPCCOD=GO.GESDOPCCOD
    AND(:PV_CODROL IS NOT NULL AND GR.GESDROLCOD=:PV_CODROL)),NULL,'false','true')REGISTRADO
    FROM GESDCOPC GO
    WHERE GO.GESDOPCTIP='C'
    and in my view:
    <af:selectBooleanCheckbox value="#{row.Registrado}"/>
    The problem i have know is that when i chek the value of my selectOneBooleanCheckBox, i update my model with this:
    CollectionModel model = (CollectionModel) tcarp.getValue();
    JUCtrlHierBinding bind = (JUCtrlHierBinding) model.getWrappedData();
    Row[] rows = bind.getAllRowsInRange();
    if((Boolean)valor){
    rows[pos].setAttribute("Registrado", "true");
    }else{
    rows[pos].setAttribute("Regitrado, "false");
    But when i click in my commandButton to save it, when i do: row[pos].getAttribute("Registrado") to get the value of the selectOneBooleanChekBox, it returns null. It is like the column has been deleted.

  • ADF selectBooleanCheckbox lost values

    I created a simple page with selectBooleanCheckbox in a table:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1">
          <af:messages id="m1"/>
          <af:form id="f1">
            <af:panelStretchLayout id="psl1">
              <f:facet name="center">
                <af:panelGroupLayout id="pgl1">
                  <af:panelGroupLayout id="pgl2"  styleClass="AFStretchWidth"
                                       binding="#{backingBeanScope.DeptBean.tablePGL}">
                    <af:table value="#{bindings.DeptWithFlagView1.collectionModel}"
                              var="row" styleClass="AFStretchWidth"
                              rows="#{bindings.DeptWithFlagView1.rangeSize}"
                              emptyText="#{bindings.DeptWithFlagView1.viewable ? 'No data to display.' : 'Access Denied.'}"
                              fetchSize="#{bindings.DeptWithFlagView1.rangeSize}"
                              rowBandingInterval="0"
                              selectedRowKeys="#{bindings.DeptWithFlagView1.collectionModel.selectedRow}"
                              selectionListener="#{bindings.DeptWithFlagView1.collectionModel.makeCurrent}"
                              rowSelection="single" id="t1">
                      <af:column sortProperty="Deptno" sortable="false"
                                 headerText="#{bindings.DeptWithFlagView1.hints.Deptno.label}"
                                 id="c2">
                        <af:inputText value="#{row.bindings.Deptno.inputValue}"
                                      label="#{bindings.DeptWithFlagView1.hints.Deptno.label}"
                                      required="#{bindings.DeptWithFlagView1.hints.Deptno.mandatory}"
                                      columns="#{bindings.DeptWithFlagView1.hints.Deptno.displayWidth}"
                                      maximumLength="#{bindings.DeptWithFlagView1.hints.Deptno.precision}"
                                      shortDesc="#{bindings.DeptWithFlagView1.hints.Deptno.tooltip}"
                                      id="it2">
                          <f:validator binding="#{row.bindings.Deptno.validator}"/>
                          <af:convertNumber groupingUsed="false"
                                            pattern="#{bindings.DeptWithFlagView1.hints.Deptno.format}"/>
                        </af:inputText>
                      </af:column>
                      <af:column sortProperty="Dname" sortable="false"
                                 headerText="#{bindings.DeptWithFlagView1.hints.Dname.label}"
                                 id="c4">
                        <af:inputText value="#{row.bindings.Dname.inputValue}"
                                      label="#{bindings.DeptWithFlagView1.hints.Dname.label}"
                                      required="#{bindings.DeptWithFlagView1.hints.Dname.mandatory}"
                                      columns="#{bindings.DeptWithFlagView1.hints.Dname.displayWidth}"
                                      maximumLength="#{bindings.DeptWithFlagView1.hints.Dname.precision}"
                                      shortDesc="#{bindings.DeptWithFlagView1.hints.Dname.tooltip}"
                                      id="it4">
                          <f:validator binding="#{row.bindings.Dname.validator}"/>
                        </af:inputText>
                      </af:column>
                      <af:column sortProperty="Loc" sortable="false"
                                 headerText="#{bindings.DeptWithFlagView1.hints.Loc.label}"
                                 id="c3">
                        <af:inputText value="#{row.bindings.Loc.inputValue}"
                                      label="#{bindings.DeptWithFlagView1.hints.Loc.label}"
                                      required="#{bindings.DeptWithFlagView1.hints.Loc.mandatory}"
                                      columns="#{bindings.DeptWithFlagView1.hints.Loc.displayWidth}"
                                      maximumLength="#{bindings.DeptWithFlagView1.hints.Loc.precision}"
                                      shortDesc="#{bindings.DeptWithFlagView1.hints.Loc.tooltip}"
                                      id="it5">
                          <f:validator binding="#{row.bindings.Loc.validator}"/>
                        </af:inputText>
                      </af:column>
                      <af:column sortProperty="Flag" sortable="false"
                                 headerText="#{bindings.DeptWithFlagView1.hints.Flag.label}"
                                 id="c1">
                        <af:selectBooleanCheckbox value="#{row.bindings.Flag.inputValue}"
                                                  required="#{bindings.DeptWithFlagView1.hints.Flag.mandatory}"
                                                  shortDesc="#{bindings.DeptWithFlagView1.hints.Flag.tooltip}"
                                                  id="it1">
                        </af:selectBooleanCheckbox>
                      </af:column>
                      <af:column sortProperty="Flag" sortable="false"
                                 headerText="#{bindings.DeptWithFlagView1.hints.Flag.label}"
                                 id="c6">
                        <af:outputText value="#{row.bindings.Flag.inputValue}"
                                       shortDesc="#{bindings.DeptWithFlagView1.hints.Flag.tooltip}"
                                       id="ot1"/>
                      </af:column>
                      <af:column sortProperty="TranFlag" sortable="false"
                                 headerText="#{bindings.DeptWithFlagView1.hints.TranFlag.label}"
                                 id="c5">
                        <af:selectBooleanCheckbox value="#{row.bindings.TranFlag.inputValue}"
                                                  required="#{bindings.DeptWithFlagView1.hints.TranFlag.mandatory}"
                                                  shortDesc="#{bindings.DeptWithFlagView1.hints.TranFlag.tooltip}"
                                                  id="it3">
                        </af:selectBooleanCheckbox>
                      </af:column>
                      <af:column sortProperty="TranFlag" sortable="false"
                                 headerText="#{bindings.DeptWithFlagView1.hints.TranFlag.label}"
                                 id="c7">
                        <af:outputText value="#{row.bindings.TranFlag.inputValue}"
                                       shortDesc="#{bindings.DeptWithFlagView1.hints.TranFlag.tooltip}"
                                       id="ot3"/>
                      </af:column>
                    </af:table>
                  </af:panelGroupLayout>
                  <af:panelGroupLayout id="pgl3" visible="false"  styleClass="AFStretchWidth"
                                       binding="#{backingBeanScope.DeptBean.hidePGL}">
                    <af:outputText value="Hidden" id="ot2"/>
                  </af:panelGroupLayout>
                </af:panelGroupLayout>
                <!-- id="af_one_column_stretched"   -->
              </f:facet>
              <f:facet name="top">
                <af:commandButton text="Show/Hide" id="cb1"
                                  action="#{backingBeanScope.DeptBean.onSHowHideClicked}"/>
              </f:facet>
            </af:panelStretchLayout>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>
    I have Show/Hide button to show / hide the table, the action method is below:
        public void onSHowHideClicked() {
            if(tablePGL.isVisible()){
                tablePGL.setVisible(false);
                hidePGL.setVisible(true);
            } else {
                tablePGL.setVisible(true);
                hidePGL.setVisible(false);
            refreshComponent(tablePGL);
            refreshComponent(hidePGL);
        private RichPanelGroupLayout tablePGL;
        private RichPanelGroupLayout hidePGL;
    After hide -> show, all checked checkbox lost their value (unchecked).
    This is constantly reproducable issue for adf selectBooleanCheckbox.
    Can anyone please provide solution for this issue? If this is a known issue, any workaround? I can provide this simple code for analysis if needed.
    Thanks

    tried with
    <af:selectBooleanCheckbox value="#{row.TranFlag}" 
    </af:selectBooleanCheckbox>
    Also, take a look at pageDef, you should to have something like this:
    <tree...>
    <Item Value="TranFlag" Binds="TranFlag"/>
    </tree>
    <buttonid="TranFlag"
    >
    <AttrNames>
    <Item Value="TranFlag"/>
    </AttrNames>
    <ValueList>
    <Item Value="true"/>
    <Item Value="false"/>
    </ValueList>
    </button>
    this code formater driving me crazy, I am unable to handle it at all :-(

  • How to use h:selectBooleanCheckbox in a datatable to select multiple rows

    One way here is set a Boolean property like "isSelected" in the javaBean, and binding it with EL in jsp page which like this:
    *<h:selectBooleanCheckbox value="#{var.isSelected}"/>*
    but this break the a well EntityBean construction cause there is a null-meaning property in this bean just for getting data easily. So, if there is any other solutions for this? i use to think use EL like this:
    *<h:selectBooleanCheckbox value="#{backBean.isSelected}">*
    which bind the value to a Boolean type in the backBean ? but the problem here is there is only one boolean, how can it represent all those rows selected?
    the second way is to get the whole view tree from FacesContext, and find all the checkbox component with findComponent() method,but i don't know how connect this to the rows in datatable,which means how to get a object from the checkbox componentID?
    thanks,sorry for my english.

    Here is a copy:
    JSF<h:form>
        <h:dataTable value="#{myBean.dataList}" var="dataItem">
            <h:column>
                <f:facet name="header">
                    <h:outputText value="Select" />
                </f:facet>
                <h:selectBooleanCheckbox value="#{myBean.selectedIds[dataItem.id]}" />
            </h:column>
        </h:dataTable>
        <h:commandButton value="Get selected items" action="#{myBean.getSelectedItems}" />
    </h:form>MyBeanpackage mypackage;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Map;
    public class MyBean {
        // Init --------------------------------------------------------------------------------------
        private Map<Long, Boolean> selectedIds = new HashMap<Long, Boolean>();
        private List<MyData> selectedDataList;
        // Actions -----------------------------------------------------------------------------------
        public String getSelectedItems() {
            // Get selected items.
            selectedDataList = new ArrayList<MyData>();
            for (MyData dataItem : dataList) {
                if (selectedIds.get(dataItem.getId()).booleanValue()) {
                    selectedDataList.add(dataItem);
                    selectedIds.remove(dataItem.getId()); // Reset.
            // Do your thing with the MyData items in List selectedDataList.
            return "selected"; // Navigation case.
        // Getters -----------------------------------------------------------------------------------
        public Map<Long, Boolean> getSelectedIds() {
            return selectedIds;
        public List<MyData> getSelectedDataList() {
            return selectedDataList;
    }Where each MyData item (dataItem) has an unique 'id' property.

  • How to get the value of a checkbox in the backing bean

    How to get the valaue of a checkbox in the backing bean?

    Hi this may help you for selecting single check box
    <h:outputText value="Enabled : "/>
                              <h:selectBooleanCheckbox value="#{Bean.isEnabled}"/>                    
                              <h:commandButton value="Submit" action="#{Bean.submit}"/>
    private Boolean isEnabled;
        public Boolean getIsEnabled() {
            return isEnabled;
        public void setIsEnabled(Boolean isEnabled) {
            this.isEnabled = isEnabled;
        public String submit(){
         System.out.println(isEnabled);
            return isEnabled;
        }for selecting multiple check box
                              <h:selectManyCheckbox value="#{Bean.items}">
                                  <f:selectItem itemLabel="one" itemValue="one" />
                                  <f:selectItem itemLabel="two" itemValue="two" />
                                  <f:selectItem itemLabel="three" itemValue="three" />
                               </h:selectManyCheckbox>
                   <h:commandButton value="Submit" action="#{Bean.submit}"/>
    private List<String> items;
        public List<String> getItems() {
            return items;
        public void setItems(List<String> items) {
            this.items = items;
        public String submit(){
            System.out.println("List : " + this.items);
            return "done";
        }Hope this helps you

  • Issue with value of  transient attribute after filtering or sorting a table

    Hi guys,
      i'm using jdev 11.1.1.4.0 .
      i've the use case :
             - a table with a column containing a checkbox to mark the selection of  a row
    <af:column align="center" sortProperty="TemIsChosen" filterable="true"
    sortable="true" id="c6">
    <af:selectBooleanCheckbox value="#{row.bindings.TemIsChosen.inputValue}" autoSubmit="true"
    shortDesc="#{bindings.ServersIndicTempVVO.hints.TemIsChosen.tooltip}"
    id="sbc1"
    valueChangeListener="#{backing_initIndicatorsTemp.onSelectTemp}"/>
    </af:column>
             - i select one or more rows with checkboxes
             - if i filter  or sort the table, the selection of the checkboxes reset to not selected (value false by default).
         I understand that for the framework, it's a normal behavior because for filtering or sorting , it re-executes the query from database. And transient attribute is not persistent, so it goes back to the default initial value "false".
         What i would appreciate, it's that filtering or sorting has no effect on the value of the transient attribute, ie end user selection remains.
          I tried to modify query mode of the ViewObject to filter with in-memory data. It works fine but if you reset filter inputs you can't retrieve correct RowSet. Only new RowSet is stored, old is lost.
           So  now it's the filtering feature that doesn't work as expected.
       How can i implement  my use case withouth the troubles i've described.
    Best regards,
    David

    Hi Frank,
       no it's a view object level attribute inside a read-only view object.
      The view object doesn't use any entity.
      Here is the definition of the attribute in the xml file of the VO, if can help you :
    <ViewAttribute
        Name="TemIsChosen"
        IsSelected="false"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.lang.Boolean"
        ColumnType="BIT"
        AliasName="VIEW_ATTR"
        SQLType="BIT"
        Passivate="true">
        <Properties>
          <SchemaBasedProperties>
            <TOOLTIP
              ResId="ADD"/>
            <DISPLAYWIDTH
              Value="50"/>
          </SchemaBasedProperties>
        </Properties>
      </ViewAttribute>
    David

  • I need a simple Converter for a selectBooleanCheckbox.

    Hi,
    Can someone tell me how to build a simple converter to go from a selectBooleanCheckbox value to a String and back.
    I save a String ("Y" or "N") in my table but the checkbox returns a boolean. I need a Converter to do the conversion from TRUE to "Y" and FALSE to "N". Should be easy to do but as of now, mine won't even execute properly.
    I get a
    javax.servlet.ServletException: javax.servlet.jsp.JspException: Can't instantiate class: 'ca.sshrc.web.common.converters.BooleanConverterYn'.
    I don't understand how getAsObject and getAsString work I guess.
    Thanks

    Hi,
    Has anyone been able to make the converter for "<h:selectBooleanCheckBox>" work??
    seems like the converter method itself is not getting invoked.
    this is what i am trying to do..
    Code in jsp is
    <h:selectBooleanCheckbox id="testCheckBox" value="#{myBean.testCheckBox}" >
         <f:converter converterId="booleanConverter" />     
    </h:selectBooleanCheckbox>entry in faces-config is
    <converter>          
           <converter-id>booleanConverter</converter-id>                  <converter-class>package.MyBooleanConverter</converter-class>
      </converter>class MyBooleanConverter looks like this at the moment
    public class MyBooleanConverter implements Converter {
         public Object getAsObject(FacesContext context, UIComponent component, String value) {
              myBooleanClass myBoolean = new myBooleanClass(value);
              return myBoolean;
         public String getAsString(FacesContext context, UIComponent component, Object value) {
              return value.toString();
    }     Have kept myBooleanClass as a simple wrapper for the Boolean class.
    Same is working for string and integer but not in this case..
    Am i going wrong somewhere... kindly help

  • Problem with getting actual value in Row row=iter.getCurrentRow();

    hi,
    the use case is as follows:
    in master-details, on detail table there are 2 columns with checkbox and username.
    when user clicks checks, the username text item is populated with current user value in respective row.
    <af:column sortProperty="#{bindings.DcaRegisterLinesV1.hints.Selected.name}" filterable="true"
    sortable="true" headerText="#{bindings.DcaRegisterLinesV1.hints.Selected.label}" id="c1"
    width="30">
    <af:selectBooleanCheckbox value="#{row.bindings.Selected.inputValue}"
    label="#{row.bindings.Selected.label}" autoSubmit="true"
    valueChangeListener="#{registerBean.socSelectedChangeListener}"
    shortDesc="#{bindings.DcaRegisterLinesV1.hints.Selected.tooltip}" id="sbc1">
    <!--af:setPropertyListener from="#{securityContext.userName}"
    to="#{bindings.ProcessedUser.inputValue}"
    type="attributeChange"/-->
    </af:selectBooleanCheckbox>
    </af:column>
    <af:column headerText="#{bindings.DcaRegisterLinesV1.hints.ProcessedUser.label}" id="c17" width="80"
    sortProperty="#{bindings.DcaRegisterLinesV1.hints.ProcessedUser.name}" filterable="true"
    sortable="true">
    <af:outputText value="#{row.ProcessedUser}" id="ot17"/>
    </af:column>
    the bean's code is below:
    public void socSelectedChangeListener(ValueChangeEvent valueChangeEvent) {
    BindingContainer dcbindings = getBindings();
    AttributeBinding at;
    DCBindingContainer dc=(DCBindingContainer) dcbindings;
    DCIteratorBinding iter=dc.findIteratorBinding("DcaRegisterLinesV1Iterator");
    BindingContext bindingctx = BindingContext.getCurrent();
    BindingContainer bindings = (BindingContainer)bindingctx.getCurrentBindingsEntry();
    Row row=iter.getCurrentRow();
    String AgreementId=row.getAttribute("AgreementId").toString();
    System.out.println(" AgreementId="+AgreementId);
    it always prints the first row's values.
    even though i click on different rows on the table prior clicking checkbox.
    what's wrong? seems like the model is not refreshed because what? autosubmit=true ?..
    how can i get the actual row values?
    please help
    the

    Hi,
    lets clean up your code first:
    public void socSelectedChangeListener(ValueChangeEvent valueChangeEvent) {
    BindingContainer dcbindings = getBindings();
    //AttributeBinding at;
    DCBindingContainer dc=(DCBindingContainer) dcbindings;
    DCIteratorBinding iter=dc.findIteratorBinding("DcaRegisterLinesV1Iterator");
    //BindingContext bindingctx = BindingContext.getCurrent();
    //BindingContainer bindings = (BindingContainer)bindingctx.getCurrentBindingsEntry();
    Row row=iter.getCurrentRow();
    String AgreementId=row.getAttribute("AgreementId").toString();
    System.out.println(" AgreementId="+AgreementId);No to the possible problem. Check if the table SelectListener is set. It should have an EL string that ends with ".makeCurrent". This however makes only sense for single row select cases.
    Frank

  • H:selectBooleanCheckbox Question!

    Hi all!
    Just wondering if it's possible to reload a page when the h:selectBooleanCheckbox is checked. I know there's an onclick attribute but I'm not all that sure what to put in it!
    Thanks!
    Illu

    In case anyone was wondering!
    JSP:
    <script language="JavaScript">
         function sendForm()
              document.getElementById("maintainForm").submit();
    </script>
    And the checkbox:
    <h:selectBooleanCheckbox value="#{res.editMode}" onclick="sendForm()"/>
    Cheers

  • h:selectBooleanCheckbox :: params

    i have a requirment where i need to send corresponding value when a particular checkbox is selected in a row from a table..i am using plain html table to render muliple rows with jsf components against datatable..
    below is the checkbox i am using..each checkbox will have somethings like templateid..when a particular row is selected, i need that template id in bean. only 1 checkbox can be selected so i have small javascript for making checkbox as radio button..f:param does not work if i have as below..
    <h:selectBooleanCheckbox  styleClass="selectBooleanCheckbox" value="#{pc_TemplateMgmtLandingView.templateBean.templateId}" valueChangeListener="#{pc_TemplateMgmtLandingView.handleSelectBooleanCheckboxValueChange}">
    <f:param name="tid" value="#{data.templateId}"></f:param>
    </h:selectBooleanCheckbox>

    f:param is not intented for this use. Use f:attribute instead.
    Also see http://balusc.xs4all.nl/srv/dev-jep-com.html

Maybe you are looking for

  • 500 Internal Server Error in BI Publisher

    Hi Guys, Just started to use BI publisher. When I tried to export report from BI Answer in Data Model >> General Setting >> Type: BI Answer In the DETAILS I clicked on the flash light icon. A new window popped up with the following Error Message: 500

  • Please enter the expiry date in dd.mm.yyyy format

    Dear All, I have configured SAP AA in Dev. Now I want to craete asset master. But it is showing the following error, when I am going to save: Please enter the expiry date in dd.mm.yyyy format Can anyone tell me the solution? Thanks Azimul

  • 5800: How can I select access points manually in a...

    The access point management of the 5800 is somewhat different: using Web you can select the access point every time you start it, but other applications using network (e.g. Opera Mini) start connecting Wifi or 3G whatever comes first which means when

  • I have an old dell computer that my itunes is currently on, can i some how switch my itunes to a different computer?

    i have an old dell computer that my itunes is currently on, can i some how switch my itunes to a different computer? im planning on getting rid of this computer and getting a macbook, i still want to keeo all my songs in my library, what could i do?

  • Extreme slowdown with long articles

    Hi, We're working on a DPS catalog, a very LARGE catalog, in which some of the articles contain many page, each with a set of interactive overlays (mostly 2-5 MSOs). The longest up to now is a 44MB article with 230 pages. Yes, we know that V swipe of