Unique id to html:multibox

Hi All,
I was trying to give unique id to html:multibox for 508 purpose, tried using
<%=item.toString()%>
<%=item%>
<c:out value='${item.}'/>
<bean:write property='item' />
Each time I see the following code in my HTML generated source :
<input type="checkbox" name="ind" value="1" checked="checked" id="ind<%= item.toString() %>">
Thanks in advance.

So basically this is a JSP question and not a generic Java question. You also mention a html:multibox (I can only quess that this is a select box which allows multiple selections), but your example contains a checkbox in stead :s
In any case what seems to happen is that the scriptlet stuff is dumped to the browser without being interpreted; in other words the JSP page is not being processed as a JSP page. Are other scriptlets being interpreted ("transformed to HTML") or is the HTML source basically just the JSP source?
Btw if you post code, do so using \ tags.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Problem using pdk-html:multibox and pdk-html:checkbox

    Hi all,
    I am developing a PDK struts application using OC4J 10.1.2. I have to create some form pages which are going to have some checkboxes. I have tried to follow the following code in order to use the pdk version of the checkbox in my form:
    in jsp file
    <logic:iterate id="item" property="items">
    <pdk-html:multibox property="selectedItems">
    <bean:write name="item"/>
    </pdk-html:multibox>
    <bean:write name="item"/>
    </logic:iterate>
    Given an ActionForm setup like this
    private String[] selectedItems = {};
    private String[] items = {"UPS","FedEx","Airborne"};
    public String[] getSelectedItems() {
    return this.selectedItems;
    public void setSelectedItems(String[] selectedItems) {
    this.selectedItems = selectedItems;
    ....... //getters and setters of items//
    In the reset method I also reinitialize the selectedItems array like :
    selectedItems=new String[]{};
    But the value of the multibox is not reflected in the action class. To my surprise, the html code generated by the server is similar to ordinary checkbox which ideally should carry some portlet specific information like pdk-html:text
    Same is the case with single checkbox. I have created a boolean variable for the single checkbox in the actionForm class. But same problem frustrates me again. The value is not passed simply.
    Can anybody comment. Is this some kind of a bug or may be there is no support for checkbox and multibox in pdkstruts.jar (10.1.2.0.2).
    Best regards,
    Omer

    following below the code that generate the XML. I still need help.
    I hope someone can help me in this issue
    The servlet that generate the XML.
    response.setContentType("text/xml");
    String Xml = "";
    Xml = Xml + "<?xml version=\"1.0\"?>";
    Xml = Xml + "<?xml-stylesheet href=\"/XslGravaCrit.xsl\" type=\"text/xsl\"?>";
    Xml = Xml + "<!-- Here is a sample XML file -->";
    Xml = Xml + "<page>";
    Xml = Xml + "<title>Test Page</title>";
    Xml = Xml + "<content>";
    Xml = Xml + "<paragraph>What you see is what you get!</paragraph>";
    Xml = Xml + "</content>";
    Xml = Xml + "</page>";
    try{
    TransformerFactory tFactory = TransformerFactory.newInstance();
    byte[] arr=Xml.getBytes();
    ByteArrayInputStream bytes=new ByteArrayInputStream(arr);
    Source xsl=new StreamSource("../XslGravaCrit.xsl");
    Templates template=tFactory.newTemplates(xsl);
    Transformer transformer = template.newTransformer();
    transformer.transform(new StreamSource(bytes), new StreamResult(response.getWriter()));
    }catch(Exception e){
    System.out.println("Excecao 100: " + e.getMessage() + e.getLocalizedMessage());
    The XSL XslGravaCrit.xsl
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java"
    version="1.0">
    <xsl:strip-space elements="*"/>
    <xsl:output method="html" indent="yes" version="4.0"/>
    <xsl:template match="page">
    <html>
    <body><b>
    <xsl:value-of select="java:java.util.Date.new()"/>
         </b>
    <xsl:for-each select="/page">
    <xsl:sort select="paragraph"/>
    <xsl:value-of select="paragraph"/>
    </xsl:for-each>
    <i>Hello World</i>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>

  • Urgent help reqd : DynaValidatorForm with html:multibox

    Hi,
    I've an urgent issue. I'm using a DynaValidatorForm to retreive data from struts <html:multibox> . But when the checkboxes are disabled, even if the boxes are checked, the form fails to retreive the data in the action page. But if I make it enable, it works. Just wondering,if DynaValidatorForm doesn't support disabled checkboxes.
    Also, I tried using hidden parameters instead, but I can't find a way to track the values for which the checke boxes are checked.
    Here's the code I'm using in jsp :
    <logic:notEmpty name="promotionComponentsList">
    <bean:define id="promotionComponentsList" name="promotionComponentsList"/>
    <logic:iterate id="option" name="promotionComponentsList" indexId="pIdx" type="com.jun.esales.epromo.model.referencedata.Option">
    <%if((pIdx.intValue()%2)==0){%>
    <td><html:multibox property="promotionComponent" disabled="<%=!isCreatorEditable%>" onclick="javascript:chgPromotionComponents(this);" value="<%=option.getCode()%>"/>     <bean:write property="name" name="option"/><br>
    <%} else {%>
                                       <html:multibox property="promotionComponent" disabled="<%=!isCreatorEditable%>" onclick="javascript:chgPromotionComponents(this);" value="<%=option.getCode()%>"/>     <bean:write property="name" name="option"/></td>
                                       <%}%>
                                       </logic:iterate>
                             </logic:notEmpty>
    Any pointer on this will be highly appreciated as I'm stuck in this for a while now.
    Thanks,

    If a checkbox (or any html form component for that matter) is disabled, it won't submit a value.
    This is a feature of html - NOT of struts. Struts can't do anything to change this functionality.
    Maybe you could include a hidden field for the value "isCreatorEditable" and only run the validation IF the editable flag is there.
    Good luck,
    evnafets

  • How to handle html:multibox in jsp with ADF Data Binding

    Hi,
    I like to use html:multibox feature in my jsp with ADF Data Binding. I am able to retrieve checked values in the DataForwardAction form. However, when the page is refreshed, the checkboxes are not persistent and yet an error showing
    "JBO-25009: unable to create object type ....oracle.jbo.domain.Array" appears.
    Here is my jsp code:
    <c:forEach var="type" items="${bindings.SystemTypeView1.rangeSet}">
    <c:if test="${Row['SystemGroup'] == type['SystemGroup']}">
    <br>
    <html:multibox property="selectedSystemType">
    <c:out value="${type.SystemType}"/>
    </html:multibox>
    <c:out value="${type.TypeDesc}"/>
    </c:if>
    </c:forEach>
    Can anyone tell me how to handle html:multibox with ADF Data Binding and make the checkboxes persistent.

    Generally this can be done.
    I see a problem with your use case, which has nothing to do with jdev or java:
    How do you identify the user when he comes back to finish the form?
    For this you can't use information like session cookie or IP address because they change.
    So you have to save some information about the user which lets you identify him when he comes back. All other requirements can be implemented by ADF.
    Timo

  • html:checkbox driving me crazy

    Hey frnds
    Can u plz provide me some code for managing a group of checkboxes in struts.
    I m using DynActionForms

    i m having a dyna form like this........\
    <form-bean name="addQuestionForm"
    type="org.apache.struts.validator.DynaValidatorForm">
    <form-property name="answertext" type="java.lang.String[]" />
    <form-property name="correct" type="java.lang.String[]" />
    </form-bean>
    and in my jsp i m using
    <html:multibox property="correct">
    <html:textarea property="answertext" cols="40"></html:textarea>
    </html:multibox>
    but wht i want is tht answertext[] shoulds be dipalyed along with the
    selected checkbox .
    So for this i m using this code in view.jsp
    <logic:iterate name="addQuestionForm" property="answertext" id="answertextt">
    <tr>
    <td width="80%" ></td>
    <html:textarea property="answertext" value="<%=answertextt.toString()%>" cols="40" rows="2" size="40" />
    </td>
    <td width="10%" >
    <html:multibox property="correct" >
    <bean:write name="answertextt" />
    </html:multibox>
    </td>
    </tr>
    </logic:iterate>
    Now in my view.jsp , i m getting all the options and checkboxes , but no option is checked marked.
    Can anyone why is this so ?
    Plz help....

  • Using htlm:multibox in JSP...

    Hi All,
    I had a problem in using html:multibox.
    I'm using this code:
    <html:multibox name="Shipment" property="selectedBox" onclick="selectAllVal(this,<bean:write name ="Shipment" property="commonJourneyKeyCD" />')'">
    inside a display tag. I'm getting syntax error on my page. Also how could i send the jsp value in the javascript fuction inside the html:multibox?
    Thanks in Advance,
    Zia

    Hi Antony,
    do you use the "forward()" method or the "redirect()" method???
    rgds
    Howy

  • Is There a Bug in pdk-html:checkbox  .... ?

    I am attempting to use the <pdk-html:checkbox ....> tag and cannot get it to work.
    When the user presses the Submit button and my code processes the checkbox the checkbox does not reflect that the user checked it.
    The code I wrote in the .jsp is:
    <pdk-html:checkbox value="yes" name="facListBean" property="check_box"></pdk-html:checkbox>
    When the page gets rendered the code gets translated to :
    <input type="checkbox" name="check_box" value="yes">
    Notice the name is not qualified in any way. In the other pdk-html tags I have used the name gets prepended with qualifying data.
    Is this a bug in the pdk-html:checkbox tag? Has anyone else use the pdk-html:checkbox successfully?

    Thanks Don,
    I was unaware of the multibox tag so I looked into it after reading your response. I tried to implement the following example code I found on the Husted web site:
    JSP:
    <logic:iterate id="item" property="items">
    <html:multibox value="val" property="selectedItems">
    <bean:write name="item"/>
    </html:multibox>
    <bean:write name="item"/>
    </logic:iterate>
    Action Form
    private String[] selectedItems = {};
    private String[] items = {"UPS","FedEx","Airborne"};
    public String[] getSelectedItems() {
    return this.selectedItems;
    public void setSelectedItems(String[] selectedItems) {
    this.selectedItems = selectedItems;
    I get the error:
    "You must specify the value attribute or nested tag content"
    I added a value attribute to the multibox tag but that didn't change the error. Any idea what what I need to do here? What am I missing?
    Thanks,

  • Parseing html in java

    I want to remove style attibute and replace it with unique class in html in java.
    Input html:
    <div style="A">
    <div style="B">
    </div>
    <div style="C">
    </div>
    </div>
    Output updated html:
    <div class="class01">
    <div class="class02">
    </div>
    <div class="class03">
    </div>
    </div>
    Please tell me how can I do it easly in java!
    I am trying to get using code available on:
    http://www.java2s.com/Tutorial/Java/0120__Development/ParseHTML.htm
    If you know any other good way, then please tell me! I don't have rnd time and have to done soon.

    Have your tried by yourself with any code yet? I don't beleive you even tried once.
    It will not be a tough job to find and replace some string in java even within HTML. But first you need to write an algorithm for this that how you will search that particular style and replace it and it totally depends on the formatting of your HTML as mentioned above.
    You need to make an algorithm and try to implement it and during the implementation if you get problems then come back here.

  • Struts html:form how to use autocomplete  = "off"

    Hi... I am having a problem when I try to use Autocomplete = "OFF" on my jsp page using struts...
    my question is how to use autocmplete on html:form / text tag? to disable autocomplete!

    The "value" for the checkbox comes from nested content inside the <html:multibox> tag - in this case you are using "item"
    "items" is the complete list of items
    "selectedItems" should be a String[] of all the selected values.
    Each time it adds a checkbox, it compares "item" with its array of "selectedItems".
    If "item" is in there, then the box is populated as "selected" otherwise not.
    Does that explain it?
    Cheers,
    evnafets

  • How to add an if statement in jsp?

    Hi all,
    I have a displayTag table and wonder how to have a condition on the following code:
      <display:column title="Accept?">
                <html:multibox property="select" value = "<%=bean.toString() %>" />
               </display:column>Basically, I would like to have this code (checkBox) appear only if a bean property is true (otherwise don't show it)
    if (bean.userApprove)
    // don't show checkBox
    else
    //show the checkBoxthanks for any pointers

    <%
    if (bean.userApprove)
    %>
    // don't show checkBox
    <%
    else
    %>
    <input type=checkbox name=chk value=chk />
    //show the checkBox
    <%
    %>

  • Problem with apex_item.date_popup in APEX 3.1

    Hi,
    I encountered a problem with the date_popup item after installing APEX3.1, probably someone can tell me if I am doing something wrong or if it is a sequel bug of 3.0.
    I have a form with a manually generated region displaying a row with different kinds of input fields for every entry in a look up table. So there may be 5 rows to enter values or 30.
    There are two date_popup fields in each row (id x and y), therefore it is not possible to give each of these popup-fields a unique id as it would exceed the limit of 50.
    The problem is the same as in version 3.0 and before: when I select a date, let's say in the popup with id x row 6, it will allways show up in the first date_popup-field with id ix. The same for the fields with id y.
    I solved the problem in 3.0 by adding an id-attribute with a unique name in html and replacing some values in the html-output. This helped distinguishing the different fields.
    But with 3.1 there ist already an id-attribute (apex_date_11, 11 representing the column)
    <input type="text" name="f11" size="15" maxlength="10" value="" id="P4_foo_2" style="margin-right:5px;" id="apex_date_11" />
    which is referenced by the javascript-function of the popup.
    Every popup either has the value apex_date_11 or apex_date_12.
    This disrupts my work around from version 3.0.
    The only solution that I see to get it working again is to replace or add a unique identifier to the input-id as well as to the function call, like apex_date_11_i.
    Maybe there is another solution to distinguish the different date-fields, like setting the row attribute, which does not work.
    Thanks in advance,
    Alex

    Hello,
    Can you put an example on apex.oracle.com , see if we can help you out.
    What has happened is we have tried to make items and their outputs more consistent across the product. This includes things like auto generation of ID's based on item names, fieldset's around compound items etc, looks like the auto generation of ID's is getting you here.
    Sorry for the trouble.
    Regards,
    Carl
    blog : http://carlback.blogspot.com//
    apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

  • Search hover panel not showing up in Internet Explorer with custom master page

    The hover panel is not showing up in internet explorer.  I am using a custom master page and it works no problem in the other browsers.  When I fire up the debugger there is an error message when i hover over a search result item:
    I tried debugging the JavaScript but i am not sure what is going on with it.  
    Am I missing reference or something done like that?  It has to be something simple because I have been scratching my head for a while on this.  
    Any ideas?  
    Brad Wight

    Have you tried rendering the site in IE Compatability Mode?  Compatability Mode solves a lot of problems in this area because older versions of IE had a unique interpretation of HTML code.
    Start here: 
    http://windows.microsoft.com/en-us/internet-explorer/use-compatibility-view#ie=ie-8
    I trust that answers your question...
    Thanks
    C
    |
    RSS |
    http://crayveon.com/blog |
    SharePoint Scripts | Twitter |
    Google+ | LinkedIn |
    Facebook | Quix Utilities for SharePoint

  • How to assign a name to the combobox in a report

    Hey guys! I hope you're fine and still have some energy left for another question!?
    I have a report with several columns. Column f03 is displayed as a text based on an LOV and linked to the database. Now I need to give that combobox in column f03 a name so I can use it in a Javascript query in order to deactivate the combobox conditionally.
    Do you have an idea how this can be achieved?
    Many thanks,
    Sebastian

    If it returns the same ID for each row then there might be a way to use it in further coding! Great!!!
    ID is unique. Every item and tag should have unique ID in HTML document.Elements may have a [valid ID|http://www.w3.org/TR/html401/types.html#type-name] [that +must+ be unique within a document|http://www.w3.org/TR/html401/struct/global.html#adef-id].
    An attribute that "returns the same&hellip;for each row" would be *class*. This can be specified in APEX_ITEM calls using the p_attributes parameter:
    apex_item.select_list_from_lov(
        3
      , null
      , 'EMP_LOV'
      , 'class="combobox"')

  • Narrative Report-Change Title

    hi
    How to change the title in narrative report(title displayed in ie),it took the saved name of the report. but i want to customize that title instead of using saved name.Can i use html title tag in my narrative area.Is that possible?
    Any suggesstions?
    regards
    sowm

    hi
    i didin't meant the report's title..i mean the title appear in internet explorer title bar.i want to customize ie title bar which display one unique id field value for that particular report, so that the user can download and save it with a unique name.
    (in html we use <title> tag for ie title) similar way can we use <title> tag in narrative text area for the report..Is that possible?
    Hope you understand..
    regards
    sowm

  • Reg dynamically displaying records from database into a jsp page

    I am working in a project which is using struts and hibernate.In a class I gave code for retrieving data from a table and I put it in a list.
    List retrieveList;
    public List getRetrieveList() {
    String SQL_QUERY ="from student s";
    Query query = session.createQuery(SQL_QUERY);
    retrieveList = query.list();
    return retrieveList;
    public void setRetrieveList(List retrieveList) {
    this.retrieveList = retrieveList;
    And this list value I want to be displayed in a jsp page.What I have given is :
    <jsp:useBean id="records" class="StudentImpl" scope="session" />
    <bean:define id="list" name="records" property="retrieveList" />
    <table align="center" bordercolor="black" cellpadding="10" cellspacing="10">
    <logic:iterate id="data" name="list" type="pojo.student" indexId="index">
    <tr>
    <td><html:multibox property="checked" value=""></html:multibox></td>
    <td><bean:write name="data" property="studentname" /></td>
    <td><bean:write name="data" property="age" /></td>
    </tr>
    </logic:iterate>
    </table>
    When I run my jsp page its showing an error
    org.apache.jasper.JasperException: [Ljava.lang.Object; cannot be cast to pojo.Student
    can anyone resolve this problem?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    ya i got through criteria query.
    Transaction tx = session.beginTransaction();
              try{
                   Criteria query = session.createCriteria(Student.class);
                   list = (ArrayList)query.list();
                   tx.commit();
                   setRetrieveList(list);
                   session.close();
              catch(Exception e){
                   System.out.println(e);
              }

Maybe you are looking for