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

Similar Messages

  • How do i pass parameters in selectBooleanCheckbox with f:param...

    I try to pass, for a selectBooleanCheckbox, a parameter.Can i do that?? I try to do it, but the value it isn�t transfered to the JavaBean.
    i put that, but the JavaBean don�t received the "txeka" parameter.
    <h:selectBooleanCheckbox value="#{backing_form_del.markedForDeletion}">
    <f:param name="txeka" value="#{id.usu}" />
    </h:selectBooleanCheckbox>
    Other cuestion, If i achieve that, do i pass all the String parameters to a array of Strings(in the JavaBean)??
    My program consists doing a multiple delete with a database datatable.
    I�ve got a selectBooleanCheckbox, for a each row, and when the selectBooleanCheckbox(s), is(are) checked, i want to do a masive delete when i click a button. Can I do that???
    thanks in advance.
    I�m interesting in JSF aplications, because i�m doing the project final of the informatic ingeniering carrier.
    i appreciatte your help soo much.

    You could use somethings like this:
    <script>
    function setupInventoryReportURL(anchor) {
         var choice = document.getElementById('supplierCenter:inventory:categoryChooser');
         if (choice) {
              var url ='inventoryRPT.jsf' + '?currentCategoryName=' + choice.options[choice.selectedIndex].text;
              anchor.href = url;
         return true;
    </script>
    <h:form id="inventory">
         <h:panelGrid columns="1" border="1" cellpadding="5">
              <f:facet name="header">
                   <h:panelGrid columns="2" width="100%">
                        <h:outputText value="Inventory"/>
                        <h:outputLink value="inventoryRPT.jsf" onclick="setupInventoryReportURL(this)">
                             <h:outputText value="Report" styleClass="commandLink"/>
                        </h:outputLink>
                   </h:panelGrid>
              </f:facet>
    <h:panelGrid columns="2" width="100%">
         <h:panelGroup>
              <h:outputText value="Supply Category"/>
              <h:selectOneMenu id="categoryChooser" value="#{inventory.categoryId}" onchange="submit()"
              valueChangeListener="#{inventoryView.categoryChanged}" immediate="true">
              <f:selectItems value="#{inventory.categories}"/>
         </h:selectOneMenu>
             ..............................................Vladimir Perlov

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

  • Using a variable as a value in jsp:param

    I was wondering, I have a String variable, vid_1, and want to use a jsp:include and pass that in as one of the parameters. How can I do this? I have to do some testing to make sure vid_1 is valid and set a default if not. It contains a number referring to which video needs to be displayed.
    Is there anyway I can get this value to be used in jsp:param value?
    John

    RahulSharna wrote:
    Well,First thing you haven't pharsed your question properly.
    Anyways as per my understading.
    The first thing is make use of in this case as your defined requirement states you need to make use of variables of both the JSP's which need compile time include not at the runtime.use of
    <%@ include file="url" %>would be more appropriate as you want to use the variable of parent jsp to the child one.
    Anyways if you are thinking to apply a solution using <jsp:include/>
    <jsp:include page="url">
    <jsp:param name="paramName" value="<%=stringVariable>"/>
    </jsp:include>and extract the paramName's corresponding value as a request parameter in other JSP.
    Hope that might answer your question :)
    REGARDS,
    RaHuLRaHul,
    Thanks for the reply. The second example you gave is what I was trying to do. I thought I did exactly what you have there and it was not working. I will check it over again and post back on here when I have a chance.
    For now I was trying to use c:set to save the variable in the request and then using the EL expression ${requestScope.variable} to put it in the <jsp:param> element. I had some things working and others not when I quit. Hopefully tomorrow I can give you a full report and we can get this worked out.
    Maybe my problem is something else? Look at this post of mine:
    http://forum.java.sun.com/thread.jspa?threadID=5236252&tstart=10
    Thanks so much for the help.
    John

  • How to generate param-prefix in web-services.xml

    Hello I am using source2wsdd to generate my WSDL and my web-services.xml. For sake
    of interoperability I would like to have the type param-prefix in the web-services.xml
    file. From my Bean class what kind of javadoc comments would help me generate
    the type param-prefix ?
    I also would like the location="header" in the param list.
    Thanks,
    Aswin.
    <param xmlns:param-prefix="http://tempuri.org/"
    type="param-prefix:SOAPCredentials"
    location="header"
    class-name="com.xyz.webservices.SOAPCredentials"
    name="SOAPCredentials"
    style="in">
    </param>
    <return-param xmlns:param-prefix="http://tempuri.org/"
    type="param-prefix:GetFileProfileInformationResponse"
    class-name="com.xyz.webservices.GetFileProfileInformationResponse"
    name="parameters">
    </return-param>
    </params>

    Please try this:
    * @wlws:part p_SOAPAuthToken location="header"
    * type="typeNS:p_SOAPAuthToken"
    * class-name="com.xyz.webservices.SOAPAuthToken"
    * style="inout"
    * xmlns:typeNS=http://namespace/of/the/type
    * @wlws:part p_SOAPCredentials location="header"
    * type="typeNS:p_SOAPCredentials"
    * class-name="com.xyz.webservices.SOAPCredentials"
    * style="in"
    * xmlns:typeNS=http://namespace/of/the/type
    * @ejbgen:remote-method
    public void login(SOAPAuthToken p_SOAPAuthToken,
    SOAPCredentials p_SOAPCredentials)
    I did not try this one out. So i can only hope that it works.
    Regards,
    -manoj
    http://manojc.com
    "Aswin Dinakar" <[email protected]> wrote in message
    news:40aeeb5d$1@mktnews1...
    >
    I tried this
    * @wlws:part p_SOAPAuthToken location="header"
    * @wlws:part p_SOAPAuthToken type="param-prefix:p_SOAPAuthToken"
    * @wlws:part p_SOAPAuthTokenclass-name="com.xyz.webservices.SOAPAuthToken"
    * @wlws:part p_SOAPAuthToken style="inout"
    * @wlws:part p_SOAPCredentials location="header"
    * @wlws:part p_SOAPCredentials type="param-prefix:p_SOAPCredentials"
    * @wlws:part p_SOAPCredentialsclass-name="com.xyz.webservices.SOAPCredentials"
    * @wlws:part p_SOAPCredentials style="in"
    * @ejbgen:remote-method
    public void login(SOAPAuthToken p_SOAPAuthToken,
    SOAPCredentials p_SOAPCredentials)
    and I got the following error -
    [source2wsdd] source2wsdd: In doclet classweblogic.webservice.tools.ddgen.Servi
    ceGen, method start has thrown an exceptionjava.lang.reflect.InvocationTargetE
    xception
    [source2wsdd] weblogic.xml.stream.XMLStreamException: Attribute QNamevalue "par
    am-prefix:p_SOAPAuthToken" does not map to a prefix that is in scope
    [source2wsdd] atweblogic.webservice.dd.NSAttribute.getValueAsXMLName(NSAttrib
    ute.java:45)
    [source2wsdd] atweblogic.webservice.dd.DDLoader.processParamElement(DDLoader.
    java:1252)
    "manoj cheenath" <[email protected]> wrote:
    Check out this example:
    http://manojc.com/?sample3
    You can find more details regarding the tags here:
    http://manojc.com/tutorial/sample3/source2wsdd.html
    Regards,
    -manoj
    http://manojc.com
    "Aswin D" <[email protected]> wrote in message
    news:[email protected]...
    Hello I am using source2wsdd to generate my WSDL and my
    web-services.xml.
    For sake
    of interoperability I would like to have the type param-prefix inthe
    web-services.xml
    file. From my Bean class what kind of javadoc comments would help megenerate
    the type param-prefix ?
    I also would like the location="header" in the param list.
    Thanks,
    Aswin.
    <param xmlns:param-prefix="http://tempuri.org/"
    type="param-prefix:SOAPCredentials"
    location="header"
    class-name="com.xyz.webservices.SOAPCredentials"
    name="SOAPCredentials"
    style="in">
    </param>
    <return-param xmlns:param-prefix="http://tempuri.org/"
    type="param-prefix:GetFileProfileInformationResponse"
    class-name="com.xyz.webservices.GetFileProfileInformationResponse"
    name="parameters">
    </return-param>
    </params>

  • Using jsp:param

    hi,
    i am new to java and jsp programming and i am trying to use jsp:param nested in my
    jsp:forward statement.
    if i specify a value in jsp:param my page would display properly. however when i passed a variable in my jsp:param i get the error:
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\star\jsp\Meeting_CreateMinutes_jsp.java:135: cannot resolve symbol
    symbol : method encode (long)
    location: class java.net.URLEncoder
    pageContext.forward("Meeting_ActionItems.jsp" + "?" + "docno=" + java.net.URLEncoder.encode( carno ) + "&" + "formmode=" + "Add");
    ^
    1 error
    this is the snippet in my jsp page that (i suspect) caused the error:
    <% long carno = newcar.getDocno(); %>
    <jsp:forward page="Meeting_ActionItems.jsp">
    <jsp:param name="docno" value="<%= carno %>"/>
         <jsp:param name="formmode" value="Add"/>
    </jsp:forward>
    my question is : does jsp:param do not accept variables as values?
    thanks in advance.
    best regards,
    noynoy

    <% long carno = newcar.getDocno(); %>Change this part as
    <% String carno = ""+newcar.getDocno(); %>
    Hafizur Rahman
    SCJPhi Hafizur,
    Thanks a lot. It solved my problem on the jsp:param error
    More power!!!
    rgds,
    noynoy

  • How do I supress the encoding of UTF-8 characters in a f:param element

    Hello,
    I have a keyboard displayed on my page, which won't work properly because of the used german characters.
    I have an icon for every button embedded in a link, which adds the selected character to the searchstring.
    For example adding an a works like this:
    from keyboard.xhtml:
    <s:link><f:param name="#{keyname}" value="#{keyword}a"/><h:graphicImage value="key_a.png"/></s:link>keyname and keyword are parameters submitted by the including form:
    from myform.xhtml:
    <ui:param name="keyword" value="#{end}"/>
    <ui:param name="keyname" value="end"/>This works great as long as the character is a standard one, but on as soon as I have a german umlaut in the string, the umlaut gets encoded/escaped with every single character that i add to the searchstring:
    The string makes it's way correctly to the keyboard-template, I can use a h:outputText to show it on the page and it doesn't get escaped.
    So, how can I prevent the escaping of my characters in the f:params elements?
    I really need to get this to work. so any hint or even solution would be fabulous.
    Thanks in advance, Peter
    PS: maybe my web server is doing something nasty, so it would be nice, if someone can check this code:
    <s:link><f:param name="test" value="�"/>INIT</s:link><br/>
    <s:link><f:param name="test" value="#{test}"/>REPEAT</s:link><br/>
    INFO: <h:outputText value="#{test}" /><br/>here is the same one with h:outputLink
    <h:outputLink><f:param name="test" value="�"/>INIT</h:outputLink><br/>
    <h:outputLink><f:param name="test" value="#{test}"/>REPEAT</h:outputLink><br/>
    INFO: <h:outputText value="#{test}" /><br/>EDIT: I found the solution, it was my beloved jboss application server, after adding a parameter to the server.xml, everything worked as expected:
    use page settings:
    <Connector port="8080" .....
    useBodyEncodingForURI="true" ..../>hardcoded:
    <Connector port="8080" .....
    URIEncoding="UTF-8" ..../> Edited by: pete007 on Mar 12, 2008 1:47 PM

    "Encoding" refers to the charset used to convert the Unicode data into bytes. But since you're writing to a String, you aren't converting the data to bytes and therefore UTF-16 is the appropriate encoding. It doesn't make sense to ask for your data to be encoded in UTF-8 when you aren't producing bytes.
    You could read this tutorial about XML and Unicode and encodings for more information:
    http://skew.org/xml/tutorial/

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

  • Handling quotes with ${param.CurrentName}

    I've read many posts on this topic, but cannot find a solution that works for my problem. I have 2 JSP pages. JSP 1 has text field CurrentName. JSP2 tries to capture that value and store it:<input type="hidden" name="CurrentName" id="CurrentName" value="${param.CurrentName}"> This of course works great, unless the user types in double quotes, like Joe "Cool" Johnson. If that happens, JSP2 contains <input type="hidden" name="CurrentName" id="CurrentName" value="Joe "Cool" Johnson"> Of course, the real data is cut off after Joe<space> because of the quote around "Cool." If I use single ticks like value='${param.CurrentName}', it works great with double quotes but not with single quotes, like Suzie's Kitchen, as we get the same data cutoff error after Suzie.
    So, of course the answer is to encode the value, replacing \" with ". But when I'm using default param and not a bean, I can't do this in a Java POJO. If I try calling a JavaScript method like fixquote(${param.CurrentName}); the result thows an error as fixquote(Joe "Cool" Johnson); If I try to capture the param in a variable first, it also throws an error.String paramname1 = ${param.CurrentName};results in String paramname1 = Joe "Cool" Johnson; and I can't pass paramname1 on the next line because it's already errored. I tried ${fn:replace(${param.CurrentName}, "a", "b")}; and that failed too.
    I'm not sure how I can actually pass that data to any method, Java, JSTL or JavaScript, because it translates the real value causing an error before I can pass it. I thought about using a bean from JSP1 to JSP2, but in this application I inherited, there are about 100 parameters on this page I'd need to add, so am hoping to avoid that work.
    Thanks.

    That last one was the closest to what you need to do. You just had some nested ${ expr } braces which doesn't work so well.
    // fixed example
    ${fn:replace(param.CurrentName, "a", "b")};
    // I think it should look something like this
    ${fn:replace(param.CurrentName, "\"", "\\\"")};Alternatively you could create a class wraps the parameter map, and escapes values for you.
    You could then replace all instances of "param" with references to this bean instead.
    cheers,
    evnafets

  • How can i pass more than 1 param to servlet to show blob image

    Hi
    my servlet expects 2 param to SELECt an image from a blob column
    public class ImageBlobServlet extends HttpServlet {
    private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    public void doGet(HttpServletRequest request,
    HttpServletResponse response) throws ServletException,
    IOException {
    response.setContentType(CONTENT_TYPE);
    String ImageId = request.getParameter("id");
    String TipImg = request.getParameter("tip");
    OutputStream os = response.getOutputStream();
    Connection conn = null;
    try {
    Context ctx;
    ctx = new InitialContext();
    DataSource ds = (DataSource)ctx.lookup("java:/comp/env/jdbc/rhDS");
    conn = ds.getConnection();
    PreparedStatement statement = conn.prepareStatement("select FIT from " +
    "RHH_FOTOS IMG " +
    "where IMG.IDASSO = ? and IMG.TIM_COA = ?");
    statement.setInt(1, new Integer(ImageId));
    statement.setString(2, TipImg);
    To display the image i tried to use:
    <af:image id="ot1"
    *source="/imageblobservlet?id=#{bindings.Con.inputValue}?tip=#{"EMP"}"*
    shortDesc="Foto"/>
    but i receive all content in the get of first param.
    String ImageId = request.getParameter("id");
    How can i pass one more then 1 param in EL.
    Thanks in advance

    Hello,
    seems to me you're using wrong separator for the second param into your URL:
    <af:image id="ot1" source="/imageblobservlet?id=#{bindings.Con.inputValue}
    tip=#{"EMP"}" shortDesc="Foto"/>
    I think it should be:
    <af:image id="ot1" source="/imageblobservlet?id=#{bindings.Con.inputValue}
    tip=#{"EMP"}" shortDesc="Foto"/>
    Jack

  • 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 read the param in an URL with an applet???

    I will like to read the in an URL with an applet param (after the ?)
    I need the equivalent of: String parm1 = request.getParameter("param"); but for applet
    I think the HttpServletResponse doesn't work in an applet ???
    Tell me if I'am right
    Thanks for your help
    Benoit

    Hi
    What you can do is, just get that URL in the web page. Like as we can get in the ASP. Store the required information in the variables and pass this information as parameters to the applet.
    Hope this helps!

  • 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

  • How to get two out param which is used in Procedure

    hi experts,
    Am keep on thinking, but not yet answer myself.. so am here
    Using Jdev11.1.1.5.0-adfbc.
    I had in db, procedure like this
    PROCEDURE proc_find_x_cal_year_period
         p_bu                    VARCHAR2,
         p_date                    DATE,
         p_year           OUT          NUMBER,
         p_period             OUT           NUMBER
    ).................i wrote like this in My AM, Procedure is execution and printing out param values Perfect
        public void ProcFindxCalYearPeriod(String pbu,
                                        oracle.jbo.domain.Date pdate)
                CallableStatement st = null;
                try{
                String sql = "begin proc_find_x_cal_year_period" +
                    "(:pbu," +
                    ":pdate," +
                    ":pyear," +
                    ":pperiod)" +
                    ";" +
                    "end;";
                st=getDBTransaction().createCallableStatement(sql,this.getDBTransaction().DEFAULT);
                st.setObject("p_bu",pbu);
                st.setObject("pdate",pdate);
                st.registerOutParameter("pyear",Types.VARCHAR);
                st.registerOutParameter("pperiod",Types.VARCHAR);
                st.execute();
                System.out.println("pyear" +(String)st.getObject("pyear"));
                System.out.println("pperiod" +(String)st.getObject("pperiod"));
                catch(SQLException e)
                throw new JboException(e);
                finally
                if(st!=null)
                try{
                st.close();
                catch(SQLException e){}
                }what i did/my need:
    i paste this ProcFindxCalYearPeriod in my one of the Eo and while am validating one of the field,this procedure should call at the time of calling, two out parameters set into two of the corresponding setter methods.
    (String)st.getObject("pyear")
    (String)st.getObject("pperiod")value is here i want to set into setAttributeInternal("x",(String)st.getObject("pyear") );
    setAttributeInternal("x1",(String)st.getObject("pperiod") );
    i hope you all understood.

    In your procedure you should create an object to hold the outputs and return this object
    public ProcResult ProcFindxCalYearPeriod(String pbu, oracle.jbo.domain.Date pdate)
                CallableStatement st = null;
                try{
                String sql = "begin proc_find_x_cal_year_period" +
                    "(:pbu," +
                    ":pdate," +
                    ":pyear," +
                    ":pperiod)" +
                    ";" +
                    "end;";
                st=getDBTransaction().createCallableStatement(sql,this.getDBTransaction().DEFAULT);
                st.setObject("p_bu",pbu);
                st.setObject("pdate",pdate);
                st.registerOutParameter("pyear",Types.VARCHAR);
                st.registerOutParameter("pperiod",Types.VARCHAR);
                st.execute();
                System.out.println("pyear" +(String)st.getObject("pyear"));
                System.out.println("pperiod" +(String)st.getObject("pperiod"));
                //assuming that you are getting the desired outputs
                *ProcResult outputs=new ProcResult();*
                *outputs.setOutParam1((String)st.getObject("pyear"));*
                *outputs.setOutParam2((String)st.getObject("pperiod"));*
                *return outputs;*
                catch(SQLException e)
                throw new JboException(e);
                finally
                if(st!=null)
                try{
                st.close();
                catch(SQLException e){}
                }Now you call this procedure like this
    ProcResult execProc= ProcFindxCalYearPeriod(paramValue1, paramValue2);
    //you can get the proc outputs by calling
    String firstOutput = execProc.getOutParam1();
    String second = execProc.getOutParam2();But the question is why you are calling setAttributeInternal() while you are validating an attribute?
    I think this is not correct.

  • Using LoaderInfo to get params from HTML

    Hi All
    Working my way throught the new things in AS3. One problem is
    getting <params> passed to the .swf from the HTML file. I can
    make it work if the code is embedded via Actions on frame 1, but
    not when the code is in an external .as file! The example I'm
    playing with is the 'Dynamic video playlist'...
    http://www.adobe.com/devnet/flash/articles/video_playlist.html
    and the amendments I've made in the VideoPlaylist.as file are
    as <=====ADDED below...
    ALL HELP/COMMENTS MUCH APPRECIATED, thank you
    ROBERT
    package {
    import flash.display.MovieClip;
    import flash.display.LoaderInfo; <=====ADDED
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import fl.controls.listClasses.CellRenderer;
    import fl.controls.ScrollBarDirection;
    public function VideoPlaylist():void {
    // Load the playlist file, then initialize the media player.
    xmlLoader = new URLLoader();
    xmlLoader.addEventListener(Event.COMPLETE, initMediaPlayer);
    //xmlLoader.load(new URLRequest("playlist.xml"));
    <=====ADDED commented out
    var playlist = this.loaderInfo.parameters.xmlfile;
    <=====ADDED
    xmlLoader.load(new URLRequest(playlist)); <=====ADDED
    argument change
    etc etc...
    The error report is...
    TypeError: Error #2007: Parameter url must be non-null.
    at flash.net::URLStream/load()
    at flash.net::URLLoader/load()
    at VideoPlaylist()
    And the HTML code is this for the xmlfile parameter I'm
    trying to read in...
    <object
    classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
    width="538" height="290" id="VideoPlaylist" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="true" />
    <param name="movie" value="VideoPlaylist.swf" />
    <param name="loop" value="false" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#ffffff" />
    <param name="xmlfile" value="playlist.xml">
    <embed src="VideoPlaylist.swf" width="538" height="290"
    loop="false" align="middle" quality="high" bgcolor="#ffffff"
    name="VideoPlaylist" allowscriptaccess="sameDomain"
    allowfullscreen="true" type="application/x-shockwave-flash"
    pluginspage="
    http://www.macromedia.com/go/getflashplayer"
    xmlfile="playlist.xml" />
    </object>

    Many thanks for both your replies. I used Dreamweaver's
    Parameters 'helper' to put the params in, and they were placed in
    AC_FL_RunContent() correctly. I also tried the FlashVars variations
    with the same result. As said I have made it work when the
    retreival code is in the main swf file, but it just won't work for
    me when the coding is in an external .as file.
    Thanks again
    ROBERT

Maybe you are looking for

  • Set Context From Event Handler in Web Dynpro ABAP

    Hi, I am passing some parameters when navigating from one view to another. Now I would like to set the context of the second view. How can I achieve that in Web Dynpro ABAP? Thanks. / Elvez

  • Web Services - WSDL doubt.

    Hi all, I’m sorry to repeat this subject again, but I continue with some doubts… I read almost SDN web logs about web services. All they teach, how to configure and develop a simple web services… but the steps to create a web service connection betwe

  • Business content not found for  CRM5.0 Datasources

    Hello, I cannot find the business content for the following datasources of CRM 5.0. We are on BW 3.5 version and i am unable to find the business content for the below.Did anyone face this problem and is there any solution or we need to build custom

  • How to get component path in java code

    Hi everybody, I have my custom component with custom folders with pictures. My custom component works with pictures. I need to know PATH to this custom component in my java code. Thank you Martin

  • User cannot access shared folder on a single PC.

    This one has got me thoroughly confused. Over the weekend I'm moved a shared folder from an old file server to a new one. Move went well. Added share and security permissions. Changed user scripts. Check ever users system to insure they had the new s