h:selectBooleanCheckbox

Hello,
I have a field in the db - Use for Forecast. This field is of char(1) datatype. Ie it returns a 'Y' or an 'N'.
This field in the UI is represented as a checkbox.
When this field returns 'Y', in the UI , i want the corresponding checkbox to be checked. How do I render this? Any ideas? I am using the DAO pattern along with JSF for the front end with WSAD 5.1.2 as IDE and websphere 5.1 as app server.

hey,
your solution did work. But I have a problem.
As suggested, I have a set and get method in the bean for conversion from string to boolean and vice versa. However, when i say
<h:panelGroup rendered="#{parmHandler.renderParm.useForForecastRendered}">          <h:selectBooleanCheckbox styleClass="selectManyCheckbox" id="useForForecast"
     value="#{parmHandler.model.useForForecastBoolean}">          </h:selectBooleanCheckbox>               
</h:panelGroup>
it gets rendered properly when i load the form with data retrieved from db. If I render the same page for creating a new record, it gives me the foll exception as follows:
Caused by: javax.faces.el.EvaluationException: Error getting property 'useForForecastBoolean' from bean of type com.nwa.dymond.parm.holidayFcst.HolidayFcstParmModel: java.lang.NullPointerException
at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java(Compiled Code))
at com.ibm.faces.databind.SelectItemsPropResolver.getValue(SelectItemsPropResolver.java(Compiled Code))
at com.ibm.faces.sdo.SdoPropertyResolver.getValue(SdoPropertyResolver.java(Compiled Code))
at com.ibm.faces.application.SuperPropertyResolver.getValue(SuperPropertyResolver.java(Compiled Code))
at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java(Compiled Code))
at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java(Compiled Code))
at com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:238)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:155)
... 58 more
Caused by: java.lang.NullPointerException
     at com.nwa.dymond.parm.holidayFcst.HolidayFcstParmModel.getUseForForecastBoolean(HolidayFcstParmModel.java:166)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
     at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
     ... 66 more
My bean definitions are as follows:
private String useForForecast;
private boolean useForForecastBoolean = true;
public void setUseForForecast(String newUseForForecast) {
          useForForecast = newUseForForecast ;
     public String getUseForForecast() {
          return useForForecast ;
     public boolean getUseForForecastBoolean() {          
          if(!useForForecast.equalsIgnoreCase(null) && useForForecast.equalsIgnoreCase("Y")) {
               useForForecastBoolean = true;
          else if(!useForForecast.equalsIgnoreCase(null) && useForForecast.equalsIgnoreCase("N")) {
               useForForecastBoolean = false;
          else if(useForForecast.equalsIgnoreCase(null)) {
               useForForecastBoolean = true;          
          return useForForecastBoolean;
     public void setUseForForecastBoolean(boolean parmUseForForecast) {
          useForForecastBoolean = parmUseForForecast;
          if(useForForecastBoolean){
               setUseForForecast("Y");
          else {
               setUseForForecast("N");
Could it be bcos i am using a boolean instead of wrapper 'Boolean'.

Similar Messages

  • Problem in  set and get values in h:selectBooleanCheckbox with h:datatabel

    hello friends,
    Please help me any one...i need urgent.........................
    My jsf page:
    <h:panelGroup>
                                  <h:panelGrid columns="6">
                                  <h:dataTable border="2" value="#{planGroup.screenFlowValues}" var="result" bgcolor="#F1F1F1" cellpadding="2" cellspacing="1">
                                  <h:column id="col1">
                                       <f:facet name="header">
                                       <h:outputLabel id="lblchange" value="Select" />
                                       </f:facet>
                                       <h:selectBooleanCheckbox id="chkid" value="#{planGroup.chkValue}">
                                       </h:selectBooleanCheckbox>
                                       </h:column>
                                            <h:column id="column1">
                                                 <f:facet name="header">
                                                      <h:outputText value="Plan Group ID"></h:outputText>
                                                 </f:facet>
                                                 <h:outputText value="#{result.planGroupId}"></h:outputText>
                                                 <h:inputHidden id="planGroupList" value="#{result.planGroupId}" />
                                            </h:column>
                                            <h:column id="column2">
                                                 <f:facet name="header">
                                                      <h:outputText value="Plan ID"></h:outputText>
                                                 </f:facet>
                                                 <h:outputText value="#{result.planId}" converter="plantext"></h:outputText>
                                            </h:column>
                                            <h:column id="column3">
                                                 <f:facet name="header">
                                                      <h:outputText value="Group Description"></h:outputText>
                                                 </f:facet>
                                                 <h:outputText value="#{result.groupDesc}"></h:outputText>
                                            </h:column>
                                            <h:column id="column4">
                                                 <f:facet name="header">
                                                      <h:outputText value="Row Status"></h:outputText>
                                                 </f:facet>
                                                 <h:outputText value="#{result.rowStatus}"></h:outputText>
                                            </h:column>
                                            <h:column id="column5">
                                            <f:facet name="header">
                                                 <h:outputText value="Modifiy"></h:outputText>
                                                 </f:facet>
                                                 <h:commandLink id="link1" value="Edit" action="#{planGroup.ModifiyMemberrecord}" immediate="true"/>
                                                 </h:column>
                                                 </h:dataTable>
                                            </h:panelGrid>
                                            </h:panelGroup>
    Here in this jsf page.......
    1.value="#{planGroup.screenFlowValues}"--is Datamodel
    2.For me page is displaying.How to set value to the check box and multiple selection of checkbox..when i click delete button ,
    i have to delete selected rows from datamodel.how to do that what are all the changes i have to.Because boolean checkbox return only true false value.
    3.by using h:datatabel i can do that ya..
    My bean:
    public class PlanGroupBean {
         private String planGroupID;
         private String planID;
         private String groupDesc;
         private String rowStatus;
         private static Log log = LogFactory.getLog(PlanGroup.class);
         private static DataModel screenFlowValues;
         private String hideWindows;
         private String hiddenValue;
         private boolean chkValue;
         public List getProdlis() {
                   return prodlis;
              public void setProdlis(List prodlis) {
                   this.prodlis = prodlis;
         public List getData() {
              return data;
         public void setData(List data) {
              this.data = data;
         public boolean isChkValue() {
              //System.out.println("CHECKED--CHK-value:"+chkValue);
              return chkValue;
         public void setChkValue(boolean chkValue) {
              this.chkValue = chkValue;
         public void setPlanGroupID(String planGroupID) {
              this.planGroupID = planGroupID;
         public String getPlanGroupID() {
              return this.planGroupID;
         public void setPlanID(String planID) {
              this.planID = planID;
         public String getPlanID() {
              return this.planID;
         public void setGroupDesc(String groupDesc) {
              this.groupDesc = groupDesc;
         public String getGroupDesc() {
              return this.groupDesc;
         public void setRowStatus(String rowStatus) {
              this.rowStatus = rowStatus;
         public String getRowStatus() {
              return this.rowStatus;
         public String getHiddenValue() {
              screenFlowValues = new ListDataModel(ServiceDao.execute().fetchPlanGroupDisp());
              return hiddenValue;
         public void setHiddenValue(String hiddenValue) {
              this.hiddenValue = hiddenValue;
         public void setHideWindows(String hideWindows) {
              this.hideWindows = hideWindows;
         public String getHideWindows() {
              return this.hideWindows;
         public DataModel getScreenFlowValues() {
              return screenFlowValues;
         public void setScreenFlowValues(DataModel screenFlowValues) {
              PlanGroupBean.screenFlowValues = screenFlowValues;
    public String deleteMemberrecord()
    please help me how to set value to the check box and while clicking delete button i have to know what are all the checkbox selected..........
    regards,
    siva

    Attach the boolean property to the row object. If it is true, then the row object was selected. You can also attach it to a Map<RowObjectId, Boolean> and then delete rows by RowObjectId which are true. You may find this article useful, it contains code examples: [http://balusc.blogspot.com/2006/06/using-datatables.html#SelectMultipleRows].

  • 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.

  • Clicking on a t:selectBooleanCheckBox gives exception

    hi ,
    I need some help with the jsf h:selectBooleanCheckBox. My scenario is i have a link in my t:dataTable header . so whenever i click on that link a popup shows up with a list of checkboxes . whenever i click on any of those checkboxes in the popup and click submit button the user should be navigated to the main page generating a new column for that checkbox value. I get a null pointer exception when i click on those checkboxes and hit submit. This is how i am implementing the logic. This logic works for me when the checkboxes and on the jsp instead of a popup. Please help.
    code in my jsp
    <h:outputLink styleClass="tips" value="#AGselectPopup" rel="#AGselectPopup" title="Select Access Groups For This View"><t:outputText value="Access Groups..." />
    My popup div
    <h2 class="accessibility">Show only: Access Groups</h2>
    <div class="noDisplay" id="AGselectPopup">
              <h:form styleClass="radioCheckGroup" >     
               <h:panelGroup>
                            <fieldset id="popupAGs">
                   <legend class="accessibility">All Access Groups for this company</legend>
                      <t:dataList id="row" var="ag" layout="unorderedList"
                                 value="#{manageuserscontroller.popupAGList}" >
                              <t:selectBooleanCheckbox id="checkbox3" value="#{manageuserscontroller.selectedAGIds[ag.accessGroupID]}" rendered="#{ag.accessGroupID!= manageuserscontroller.accessGroupID}"/>
                              <t:outputText style="font-weight:bold;" id="text2" value="#{ag.name}" /><t:outputText value="(default)" rendered="#{ag.accessGroupID== manageuserscontroller.accessGroupID}" />
                             </t:dataList>
                  </fieldset>
              <div class="clr"><!-- --></div>
          </h:panelGroup>     
           <f:verbatim> <br /> </f:verbatim>
    <t:saveState value="#{manageuserscontroller.accessGroupID}" />Backing bean code
    private Map<Integer, Boolean> selectedAGIds = new HashMap<Integer, Boolean>();
       public void getSelectedAGItems(ActionEvent event) {
            // Get selected items.
          System.out.println("Inside selected AG Items method");
          System.out.println("Access group ID in selected AGItems method" + accessGroupID);     
         System.out.println("Selected AG list" + popupAGList);     
         selectedAGList = new ArrayList<AccessGroup>();
          for (AccessGroup accgrp : popupAGList) {
                System.out.println("inside for loop");
                int x = accgrp.getAccessGroupID();
                System.out.println("accessgroupid" + x);
         *if (selectedAGIds.get(x).booleanValue()) {*
                    selectedAGList.add(accgrp);
                    System.out.println("OK-user added to selected AG list");
                    System.out.println("Accessgroup id" + accgrp.getAccessGroupID());
                    System.out.println("Accessgroup name" + accgrp.getName());
               else
                    System.out.println("Accessgroup not selected");
          }I get the nullpointer exception at this line if (selectedAGIds.get(x).booleanValue())
    Please someone help when since i am struck with this and cann't go ahead with my task
    Thank You so much in advance

    You can try these steps in case of issues with web pages:
    You can reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Clear the cache and remove cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > "Use custom settings for history" > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Is it possible to make a newline in SelectBooleanCheckbox text?

    Is it possible to make a newline in the text in an af:SelectBooleanCheckbox component?
    I have tried br in tags (cant write the syntax here :)) which don´t seem to work.

    Hi,
    what is it that you are trying to achieve ?
    Frank

  • 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

  • SelectBooleanCheckbox read-only after setting selection

    Hello!
    I'm trying to set the selection of an adf selectBooleanCheckbox!
    When I set it by the pull-down menu (true, false) in the Property Inspector, everything is ok!
    But when I set the selection depending on an ADF binding, the value is set correct,
    but the checkbox is read-only and a change of the selection is impossible!
    Here's the very simpel code of the Box:
    <af:selectBooleanCheckbox
    label="myLabel"
    value="#{bindings.SomeValue.inputValue != null}"/>
    Can anyone help me, how to enable the checkbox for selection?
    Thank you very much!
    Sebastian
    PS: I'm using JDeveloper 10.1.3.3!

    hi..
    the previous error is ok now..
    below is the script, the status is when click on 'Add new row' button, it will pass status = 'ADD_ROW' and set the startdate read only = False.
    my question now is...
    e.g i've a multiple rows (can display up to 10 rows) display in table form in the page....i query 3 rows of records, then i click 'Add new row' button,
    how to make sure the 3 rows queried early is having startdate read only = Yes and for the new row startdate read only = False?
    with the below codes it will set all rows startdate read only = False (including those queried data)... pls help...
    public void setReadonly(String status)
    OAViewObjectImpl vo = (OAViewObjectImpl)findViewObject("SeaoeAutoMosPVO1");
    OARow row = (OARow)vo.first();
    OAViewObject SeaoeAutoMosSummaryVO = (OAViewObject)findViewObject("SeaoeAutoMosSummaryVO1");
    OARow SeaoeAutoMosSummaryRow = (OARow)SeaoeAutoMosSummaryVO.getCurrentRow();
    if (status=="ADD_ROW")
    row.setAttribute("StartDateRender", Boolean.FALSE);
    else
    row.setAttribute("StartDateRender", Boolean.TRUE);
    }

  • H:selectBooleanCheckbox onclick

    Hello,
    Is it possible to use the onclick property of selectBooleanCheckbox to uncheck two other checkboxes?
    Thanks

    JANATKash wrote:
    I have a tag
    <h:inputTextArea id="area" ... />
    when It is converted to html, the id of of <textarea> is not always same. Sometimes, it is
    j_id_jsp_1414060743_1:area
    sometimes it is
    j_id_jsp_1414060743_2:areaJust assign the parent form/datatable/subview an unique ID.

  • SelectBooleanCheckbox in RIch:datatable

    Hello All,
    I have data table with some actions(column 1, column 2, column 3 , delete, update)..
    And selectBooleanCheckbox for checking before start delete, its must mandatory before any actions.
    I added validator vor selectBooleanCheckbox to make it mandatory, but if I have 4 rows, I must select 4 checkboxes for continue actions...
    But each row must have his own checkbox:)
    How can I improve it...
    public void validateCheckbox(FacesContext context, UIComponent component, Object value) {
        if (value instanceof Boolean && ((Boolean) value).equals(Boolean.FALSE)) {
          String clientId = component.getClientId(context);
          bundle = context.getApplication().getResourceBundle(context, "confirm");
          FacesMessage message = new FacesMessage(bundle.getString("warning"));
          throw new ValidatorException(message);
    <rich:column>
                          <f:facet name="header">
                            <h:outputText value="#{regForms.action}"/>
                          </f:facet>
                          <h:panelGroup id="actions_panel">
                            <a4j:commandLink                        
                              action="#{EDIT}" value="#{edit}"
                              reRender="name_panel">
                              <a4j:actionparam name="ID" value="#{item.id}" assignTo="#{bean.editTpStatusId}"/>
                            </a4j:commandLink>
                            <a4j:commandLink                        
                              action="#{EDIT}" value="#{deletet}"
                              reRender="name_panel">
                              <a4j:actionparam name="ID" value="#{item.id}" assignTo="#{bean.deleteId}"/>
                            </a4j:commandLink>
                          </h:panelGroup>
                        </rich:column>
                        <rich:column>
                          <f:facet name="header">
                            <h:outputText value=""/>
                          </f:facet>                                            
                          <h:selectBooleanCheckbox style="border:none" id="check"  required="true" value="#{item.checked}"
                                                   validator="#{bean.validateCheckbox}"/>               
                          <h:message for ="check" styleClass="validate"/>                                 
                        </rich:column>               I do not know behavior selectBooleanCheckbox in the datatable, I try to reRender checkbox after clicking in action link, but no result.

    Check the "Select multiple rows" part of this article for two ways of doing it.
    [http://balusc.blogspot.com/2006/06/using-datatables.html]
    Although it uses h:dataTable, the idea is just the same.

  • 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

  • SelectBooleanCheckbox in Map or Array?

    Hi guys,
    Anybody has example on putting selectBooleanCheckbox in a Map/Array in backing bean so that in JSP page we don't need to put it like 1 by 1. For example, if I got a list of 5 facilities for selectBooleanCheckbox, I don't need to do it like the following in JSP page:
    <h:selectBooleanCheckbox id="facility1" value="#{backingBean.facility1}"/>
    <h:selectBooleanCheckbox id="facility2" value="#{backingBean.facility2}"/>
    <h:selectBooleanCheckbox id="facility3" value="#{backingBean.facility3}"/>
    <h:selectBooleanCheckbox id="facility4" value="#{backingBean.facility4}"/>
    <h:selectBooleanCheckbox id="facility5" value="#{backingBean.facility5}"/>
    where I can just loop thru the boolean[] facility in backing bean will do.
    thanks !

    Try h:dataTable.
    <h:dataTable value="#{backingBean.facilities}" var="item">
    <h:column>
    <h:selectBooleanCheckbox id="check" value="#{item.facility}"/>
    </h:column>
    <h:column>
    <h:outputLabel for="check">
    <h:outputText value="#{item.name}"/>
    </h:outputLabel>
    </h:column>
    </h:dataTable>

  • SelectBooleanCheckbox in adf did not display

    Hi all,
    I am have a problem in af:selectBooleanCheckbox with selected state value : 1 and unselected : 0.
    And the attribute in database, data type is Number(1,0), Nullable : No, Data Default : 0.
    But if i create new row, af:selectBooleanCheckbox didn't display "rectangle" like select boolean checkbox normally,
    only display "strip".
    I can't use af:selectBooleanCheckbox, so error in data is required.
    I am using jdev 11.1.2.2.0
    Thanks in advance

    1. Make sure that your attribute is updatable.
    2. This thread should get you the answer issue with Boolean Check box valueChangeListener

  • 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

  • H:selectBooleanCheckbox converter issue

    HI,
    I want to override the default behaviour of h:selectBooleanCheckbox .
    <h:selectBooleanCheckbox id="value" value="#{bean.value}"
    immediate="false" >
    <f:converter converterId="BinaryStringConverter"/>
    </h:selectBooleanCheckbox>
    I have binded the h:selectBooleanCheckbox to property of string type in bean.
    String value;
    public String getValue(){
    return value;
    public void setValue(String s){
    value = s;
    What I want to do is when the checkbox is checked , bean's value should be set as 1 and when unchecked i should be set as 0 and vice versa.
    I have implemented converter BinaryStringConverter for this purpose.
    Still I am getting conversion error.
    What i have found is
    But getAsObject() method is never called.
    Only getAsString() method is called.
    When I use the same converter on h:inputText it works fine.
    What I feel h:selectBooleanCheckbox calls its standatd BooleanConverter to convert the String value to boolean and vice versa.
    Is it possible to override this so that this converter is not called.
    Best regards,
    Ankur Mittal

    You can't. It is a SelectBooleanCheckbox. Not a SelectStringCheckbox ;)
    Try to do a feature request against the JSF spec. http://javaserverfaces.dev.java.net

  • SelectBooleanCheckbox and component instance backing bean problem

    Hi
    I have a selectBooleanCheckbox with the binding property pointing to a CoreSelectBooleanCheckbox but if the user changes the checkbox value CoreSelectBooleanCheckbox remains unchanged.
    Any idea ?

    try this:
    private CoreCommandButton cmd;
    private CoreSelectBooleanCheckbox chb;
    private boolean boo = false;
    public String cmd_action() {
    // Add event code here...
    if (getChb().isSelected() == true) {
    setBoo(false);
    } else {
    setBoo(true);
    return null;
    in the page:
    <af:selectBooleanCheckbox text="selectBooleanCheckbox 1"
    label="Label 1" binding="#{prub.chb}"
    partialTriggers="cmd" value="#{prub.boo}"/>
    <af:commandButton text="commandButton 1" binding="#{prub.cmd}"
    id="cmd" action="#{prub.cmd_action}"/>
    is it???

Maybe you are looking for

  • Are you guys Pirates or an actual company?

    Dear All, I am doing my best to remain calm.  I will jump right to the point.  Please dont tell me to call assurion either.  You sold the crap, you call Assurion.  Ive been on hold long enough.  Plus, I dont deal with assurion, ATT does.  I did busin

  • How do I put a white stroke on EVERYTHING in my design?

    I am fairly new to Illustrator, although since I'm pretty good at Photoshop (I have used it exclusively for graphic design for 10 years) I have been picking up Illustrator fairly quickly. I created a design but would like to put a white stroke on eve

  • Vertical Photos are cropped

    I am trying to prepare my first digital presentation using Keynote and I have sized the photos to 1000 pixels on the long side. When reviewing my slides, the horizontal images look great, but the vertical are cropped at the top and bottom (almost a s

  • How do I convert the ASCII output of a Maxtek TM-350 QCM Deposition monitor to a normal string I can read?

    Hi! I'm working wiht a Maxtek TM-350 QCM Thickness Monitor, and I am having some trouble deciphering the output from the monitor.  I am using an RS232 interface to communicate with the monitor.  I wrote a little VI to try to just query for the versio

  • How will the applications gets translated using Globalization

    Hi, By using the Apex user guide, I have done with the multilingual process but not able to view the translated application in the application builder list, How can I get the arabic language gets effected in my applications(Apex). What are the steps