Dynamically generate javascript in jsp

i really need sm ideas...
i have got image url in my table in database.. for eg:---------> /img/img.jpg(this is there in my table)
in the jsp page i have got the urls in an arraylist..now i have to put it on roll...for eg there are10 images, when the page loads i have to display the first image and then on mouseover it will keep rolling to the next image and it goes on..
the roll is done in javascript..
i have to dynamically generate the javascript...what do i do?...how do i do that?

which JavaScript you want to generate?
Can you post your jsp and explain what kind of javascript you want to generate in that jsp?

Similar Messages

  • Including dynamically generated pages in jsp

              Hello All, Scenario is like this, i am creating the dynamic htmls pages, in the
              servlets and after creating the htmls pages in the servlets , the control passes
              to the jsp page, where i am including the html page that is created at the servlets,
              its works fine, but some time it shows me null exception at the jsp page, i.e
              it won't find the htmls pages, even they are created b'fore. I am using weblogic
              server 6.1 with sp3. Can anybody know what is the reason.
              

    After you have generated checkbox by jsp, you have to generate JavaScript for the checkboxes.
    <%
    // assume I have found I need to generate 5 checkboxes with jsp
    int chkboxCount = 5;
    String user = request.getParameter("user");
    boolean showUser = false;
    if (user!=null && user.trim().length()>0){
      showUser = true;
    %>
    <script lang="JavaScript">
    var chkcount = <%=chkboxCount%>;
    for (int i=0; i<chkcount; i++)
         alert(i);
    <%
    if (showUser)
    %>
        alert("hello <%=user%>");
    <%
    %>
    </script>It is difficult to trace though.
    Edited by: evilknighthk on Nov 25, 2007 11:55 PM

  • Dynamic generate JNLP from JSP ?

    Hello,
    I tried to generate JNLP from JSP, but it just show the Opem/Save diakog and cannot startup the Web Start.
    I am using Tomcat-5.5.12 in WinXP + JDK1.5
    How can I dynamically generate JNLP ?
    Eric

    It will range from easy to rather difficult, depending on how hard you try...
    If you want to do the bare minimum it will require you to code up some JSPs with scriptlets, declarations, expressions, and <jsp:xxx ...> tags, have some server turn them into a servlet for you, and then determine how things like
    <%@ page isELIgnored="false" %> are handled. Things like:
    <jsp:useBean ...> <jsp:setProperty ... > should be rather easy to translate using introspection on the beans they refer to. But <jsp:import ...> and the likes may be more difficult.
    Any normal html code is just wrapped inside a out.println(...) statement. Scriptlets should have the <% %> stripped and coppied to the output. Expressions should have their <%= %> stripped and be added to the surrounding out.println...
    for example:
    <a href="<%=thePage%>">
    should become:
    out.println("<a href=\""+thePage+"\">");
    All the content should be added to a _jspservice method.  Then, things between <%! %> should be coppied to source file as methods.
    Complications come when people start to use custom tags. You will have to learn how to create a PageContext that will be available to the jsp service method.
    You should also look up the JSP/Servlet spec to see how this stuff should be done.
    It is a whole nuther can o worms if the resulting JSP is expected to compile without a server...</a>

  • Dynamically generate JSF Source code in a JSP

    Hi,
    I have a JSP and instead of writing the JSF source Code like:
    <h:inputText
    styleClass="entryInput"
    id="textNumberOfServerMachinesInput"
    value="#{DataAccess.value}"
    valueChangeListener="#{InputValueChanged.processValueChange}">
    </h:inputText>
    manually in the jsp I want the JSF source code to be added dynamically to the jsp.
    So what I want is including a tag in the jsp and this tag generates JSF source code like seen above.
    This source code should then be treated just the way it would be if I had written it manually in the JSP. This means that the dynamically generated JSF code must be interpreted and all Listeners and Beans work just fine.
    How can I make this???

    Hi,
    I have a smiliar problem:
    JSP:
    <h:panelGrid binding="#{fileUploadGrid.panelGrid}">
       <%-- emty in jsp --%>
    </h:panelGrid>The panel should be populated with items the backing bean creates in source code:
    FileUploadGrid.java
    public void setUploadFieldNumber(int uploadFieldNumber) {
        this.uploadFieldNumber = uploadFieldNumber;
        this.refresh();
    private void refresh() {
        if (this.panelGrid == null)
          this.createPanelGrid();
        List children = this.panelGrid.getChildren();
        children.clear();
        for (int i = 0; i < this.uploadFieldNumber; i++) {
          HtmlOutputText out = new HtmlOutputText();
          out.setTitle("Image " + i);
          out.setRendered(true);
          HtmlInputText in = new HtmlInputText();
          children.add(out);
          children.add(in);   
    private void createPanelGrid() {
        this.panelGrid = new HtmlPanelGrid();
        this.panelGrid.setColumns(2);
        this.panelGrid.setCellpadding("1");
        this.panelGrid.setBorder(1);
        this.panelGrid.setWidth("50%");
        this.panelGrid.setRendered(this.isRendered());
    public void setPanelGrid(HtmlPanelGrid panelGrid) {
        this.panelGrid = panelGrid;
      public HtmlPanelGrid getPanelGrid() {
        return this.panelGrid;
    }The backing bean is initialized in faces-config.xml:
    <managed-bean>
      <managed-bean-name>fileUploadGrid</managed-bean-name>
      <managed-bean-class>org.smi.pte.isf.FileUploadGrid</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
      <managed-property>
        <property-name>rendered</property-name>
        <value>true</value>
      </managed-property>
      <managed-property>
         <property-name>uploadFieldNumber</property-name>
         <value>6</value>
      </managed-property>
    </managed-bean>The problem is: although the debug output of the faces framework (I use it along with Tomcat) shows that the in- and output fields are added correctly to the panel, the page remains empty at display.
    Thanks in advance for any help.
    F. Eckhardt

  • Problem in Setting Focus, on a dynamically generated field

    Hi all,
    I am having a jsp page, in which I have dynamically generated n number of input text fields, and with the function onchange="chk();", and i am passing the current text field value, and 2 more parameters min and max.
    In function chk(), i am validating the input value by condition it should be within min and max..
    my problem is i want to[b] get back the focus to the input text box, where the input is entered and not satisfied my condtion
    function chk(a,b,c)  / /a is my i/p, b and c are min and max values
    if( (parseInt(a)>=parseInt(b)) && (parseInt(a)<=parseInt(c)) )
    document.form1.submit;
    return true
    else
    alert("Invalid Output");
    var element=event.srcElement.name;
    alert(element); // I am able to get the name of input text box
    alert(event.srcElement.tagName);  // this gives INPUT
    if(event.srcElement.tagName=='INPUT')
    alert("yes"); // i can get this alert
    event.srcElement.focus();  // the focus can't be set back to that input field or element
    return false
    }

    try this and say me if it works fine!!!
    <html>
    <head>
    <script>
    function fileds() {
         var myParent = document.getElementById('myDiv');
         var text = document.createElement('input');
         text.setAttribute('id', 'myText');
         myParent.appendChild(text);
         document.all.myText.focus();
    </script>
    </head>
    <body>
    <input type="button" onClick="javascript:fileds()" value="Create And Give Focus">
    <br>
    <div id="myDiv"></div>
    </body>
    </html>
    bye

  • Dynamically generating input grid

    I am trying to figure out a way to let users dynamically generate rows of input text boxes using a button in an HTML page e.g. user will enter text in say 10 columns and then hit enter, which will create another row of text boxes with same number of columns. Also all the text boxes should automatically generate their names e.g. if the column name is "Address" then the name of the first address text box in the first row should be e.g. "address_1" and then name of the second address text box should be e.g. "address_2".
    I want to do this on the client side, so that I can gather all the information and then only pass it on to the server.
    Any help would be greatly appreciated.
    Thx

    Depends on how you have build your JSP page. Assuming:
    1. You have built your .JSP with one or more .java files. Then the previous example that our friend answered you is write but converted into java code and not in javascript. In case you dont understand how you can build a JSP file with .java file i explain:
    you write Java code in a .java file but it has HTML tags. When your code is executed the tags are "created" because your code says so. And this is the way your .JSP is being built. In there you can create a sequence with for or anything else you figure out to build more and more lines. For the names figure out a generator method.
    2. You have built your code with another tool (Dreamweaver) and you dont want or know to use java code to create more lines. Then i suggest you a middle way:
    Figure out how many lines will be created from your users more or less. Let's say that more or less users create from 4-6 lines. Create your lines already, put names on them with a generator but have them disabled (type="textfield" ....... disabled>). Then use javascript so when the user wants to have more lines or rows allow with javascript the second row to be enabled and so on. When you reach your final line or row but the user still wants more lines, have a button saying "More" or sth like that and reload the page but be sure to store the previous entered values. I hope i helped.
    P.S. Maybe also try to change that by putting a textarea unless it doesnt help. Let me know what you think.

  • Dynamic Themes in mapinit.jsp

    Hi ,
    How can I pass dynamic themes using mapinit.jsp ,
    For example alongwith all the parameters like map size , basemap etc..
    I want to give a new date parameter . based on the given date I need to put a where clause in my themes like where date=parameter.date.
    I have salesperson whose location changes on daily basis and user need to see their location on date basis , for example where all the salesman were on 28-10-2006 and where all the sales man were on 25-10-2006 and so on ..
    Please help

    Thanks a lot that worked out.But still as I have my complete requirement is I need to display set of radio buttons when I click on this link.
    Can this be possible by javascript.Can anyone give me an idea of how to do this. The actual scenario is like I get the a list of 30 dates and their corresponding radio buttons from a webservice. What I do is I read all the values from that webservice and convert them into text( actually I get the codes) and need to display that as a calendar to the user and when they click on a particular date { I copied a calender from the net and placed that code in my jsp to display the calender)
    the set of radio buttons should be displayed underneath the calender.That is both the calender and the list of radio buttons should be on the same page.
    Thanks in advance.
    Pavan.

  • Help me!! How to use JavaScript with JSP ??

    I am using JDeveloper and I created a screen in JSP which uses a bean for database connectivity and retriving info onto the page.
    The page has a ListBox where list items are populated from the database.My requirement is
    whenever the list is changed the page shuold be refreshed with the selected item info.
    I tried to use 'JavaScript' for triggering the event with 'onChange' event of the ListBox.But the event is not getting invoked. I think JavaScript is not working with JSP.
    Please help me with how to Use javaScript with JSP or any other alternative where I can meet my requirement.
    I have one more question...I have gone through the JSP samples in OTN and I am trying do download the sample 'Travel servlet' which show list of countries...etc
    I have also gone through the 'readme' but I don't know how to extract .jar file.
    I would be great if you could help me in this.
    Thanks!!
    Geeta
    null

    We have a similar need. We have used Cold Fusion to display data from Our Oracle Database. We have a simple SElect Box in HTML populated with the oracle data. When someone selects say the State of Pennsylvania. then we have an On change event that runs a Javascript to go get all the cities in Pennsylvania.
    Proble we are having is that inorder for the Javascript to work , we currently have to send all the valid data.
    Do you know of any way to dynamically query the the Oracle database in Javascript

  • Cross column radio group solution using dynamically generated HTML

    I am tasked with creating a screen in Apex matching look and feel of an existing application screen; tabular form, multiple column radio buttons to update a single column value (radio group needs to be row oriented, across multiple columns). I could not find a way to use HTMLDB_ITEM.RADIO_GROUP () function for this due to the radio group being column based, great as a row selector but not for use across columns (each button being a column).
    My first thought was to comprise and use checkboxes via HTMLDB_ITEM.CHECKBOX () for the multiple choices (in each column) and HTMLDB_ITEM.HIDDEN() to hold the chosen value, a JavaScript function for “onClick” event to make the checkboxes in one row act like radio buttons in a radio group. I created a simple application to show the concepts of my solutions …
    SQL looks like this:
    select pk_id, -- f01
    object_to_color, -- f02
    HTMLDB_ITEM.CHECKBOX(11, color_choice,
    'onClick="chkboxAction('||pk_id||', document.wwv_flow.f11, ''RED'')"', 'RED') red,
    HTMLDB_ITEM.CHECKBOX(12, color_choice,
    'onClick="chkboxAction('||pk_id||', document.wwv_flow.f12, ''BLUE'')"', 'BLUE') blue,
    HTMLDB_ITEM.CHECKBOX(13, color_choice,
    'onClick="chkboxAction('||pk_id||', document.wwv_flow.f13, ''GREEN'')"', 'GREEN') green,
    color_choice -- f03
    from objects_to_color
    Columns pk_id and color_choice are set as Show off and Display As Hidden. Note that my HTMLDB_ITEM.CHECKBOX items start with id number 11 (f11 – f13) so as not to conflict with the item id’s Apex will generate on it’s own. I could have used HTMLDB_ITEM functions to create all items and had my own PL/Sql update process.
    This creates a tabular presentation with a column for each color choice as a checkbox, shown checked if that color is initially set.
    The JavaScript function chkboxAction() clears the other checkboxes if a color is selected and stores the color in the hidden item db column for use in Apex Submit processing. Sorry the identation get's lost in the post!
    function chkboxAction (id, ckbx, color) {
    // f01 is pk_id (hidden)
    // f11 is RED checkbox
    // f12 is BLUE checkbox
    // f13 is GREEN checkbox
    // f03 db column color_choice for update (hidden)
    var idx;
    // Find row index using pk_id passed in as id argument.
    for (var i=0; i < document.wwv_flow.f01.length; i++) {
    if (document.wwv_flow.f01.value == id) {
    idx = i;
    i = document.wwv_flow.f01.length;
    if (ckbx(idx).checked == true) {
    // Set hidden color_choice column value to be used in update.
    document.wwv_flow.f03(idx).value = color;
    // Uncheck them all, then reset the one chosen.
    document.wwv_flow.f11(idx).checked = false;
    document.wwv_flow.f12(idx).checked = false;
    document.wwv_flow.f13(idx).checked = false;
    ckbx(idx).checked = true;
    } else {
    // Unchecked so clear color_choice column value to be used in update.
    document.wwv_flow.f03(idx).value = '';
    This works well and, as an aside, has an added feature that the color can be “unchosen” by unchecking a checked checkbox and leaving all checkboxes unchecked. This cannot be done with radio buttons unless a radio button is added as “no color”.
    But what if radio buttons must be used, as in my situation? Here is another solution using custom code to dynamically generate radio buttons for a row based radio group rather than using HTMLDB_ITEM.RADIO_GROUP ().
    select pk_id, -- f01
    object_to_color, -- f02
    '<input type="radio" name="rb'||pk_id||'" id="rb'||pk_id||'_1" value="RED" '||
    decode(color_choice, 'RED', 'CHECKED', '')||
    ' onClick="rbAction('||pk_id||', ''RED'')">' red,
    '<input type="radio" name="rb'||pk_id||'" id="rb'||pk_id||'_2" value="BLUE" '||
    decode(color_choice, 'BLUE', 'CHECKED', '')||
    ' onClick="rbAction('||pk_id||', ''BLUE'')">' blue,
    '<input type="radio" name="rb'||pk_id||'" id="rb'||pk_id||'_3" value="GREEN" '||
    decode(color_choice, 'GREEN', 'CHECKED', '')||
    ' onClick="rbAction('||pk_id||', ''GREEN'')">' green,
    color_choice -- f03
    from objects_to_color
    The pk_id column is used here to ensure a unique name and unique id for the items. In practice a custom api should be used to generate items in this way.
    The JavaScript function is actually simpler for radio buttons because the radio group handles the mutually exclusive logic for choosing a color.
    function rbAction (id, color) {
    // f01 is pk_id (hidden)
    // f03 db column color_choice for update (hidden)
    var idx;
    // Find row index using evaluation_question_id.
    for (var i=0; i < document.wwv_flow.f01.length; i++) {
    if (document.wwv_flow.f01.value == id) {
    idx = i;
    i = document.wwv_flow.f01.length;
    // Set hidden result column referenced in update.
    document.wwv_flow.f03(idx).value = color;
    Now the problem is that on update, Apex will be confused by the custom items and try to post updated values to it’s own internal items – which don’t exist. The result is the very frustrating HTTP 404 - File not found error when apex/wwv_flow.accept executes on Submit. So, the trick is to clear the custom items prior to the update with a simple JavaScript function, then the values show again when the page is rerendered, if you are not branching from the page. The Submit button is changed to call the following function:
    function submit () {
    var items = document.getElementsByTagName("INPUT");
    for (i=0; i< items.length; i++) {
    if (items(i).type == "radio") {
    if (items(i).checked == true)
    items(i).checked = false;
    doSubmit('SUBMIT');
    This technique might have general use when using custom items. Comments or improvements on this?
    See Oracle Apex site: workspace SISK01, app OBJECTS_TO_COLOR

    Just the code for formatting.
    Checkboxes to behave like radio group ...
    SQL ...
    select pk_id,              -- f01
           object_to_color,    -- f02
              HTMLDB_ITEM.CHECKBOX(11, color_choice,
                  'onClick="chkboxAction('||pk_id||', document.wwv_flow.f11, ''RED'')"', 'RED') red,
              HTMLDB_ITEM.CHECKBOX(12, color_choice,
                  'onClick="chkboxAction('||pk_id||', document.wwv_flow.f12, ''BLUE'')"', 'BLUE') blue,
              HTMLDB_ITEM.CHECKBOX(13, color_choice,
                  'onClick="chkboxAction('||pk_id||', document.wwv_flow.f13, ''GREEN'')"', 'GREEN') green,
           color_choice  -- f03
    from objects_to_colorJavaScript ...
    function chkboxAction (id, ckbx, color) {
        // f01 is pk_id (hidden)
        // f11 is RED checkbox
        // f12 is BLUE checkbox
        // f13 is GREEN checkbox
        // f03 db column color_choice for update (hidden)
        var idx;
        // Find row index using pk_id passed in as id argument.
        for (var i=0; i < document.wwv_flow.f01.length; i++) {
           if (document.wwv_flow.f01(i).value == id) {
              idx = i;
              i = document.wwv_flow.f01.length;
        if (ckbx(idx).checked == true) {
          //  Set hidden color_choice column value to be used in update.
          document.wwv_flow.f03(idx).value = color;
          // Uncheck them all, then reset the one chosen.
          document.wwv_flow.f11(idx).checked = false;
          document.wwv_flow.f12(idx).checked = false;
          document.wwv_flow.f13(idx).checked = false;
          ckbx(idx).checked = true;
        } else {
          //  Unchecked so clear color_choice column value to be used in update.
          document.wwv_flow.f03(idx).value = '';
    }Radio button solution ...
    SQL ...
    select pk_id,              -- f01
           object_to_color,    -- f02
           '<input type="radio" name="rb'||pk_id||'" id="rb'||pk_id||'_1" value="RED" '||
                decode(color_choice, 'RED', 'CHECKED', '')||
                ' onClick="rbAction('||pk_id||', ''RED'')">' red,
           '<input type="radio" name="rb'||pk_id||'" id="rb'||pk_id||'_2" value="BLUE" '||
               decode(color_choice, 'BLUE', 'CHECKED', '')||
               ' onClick="rbAction('||pk_id||', ''BLUE'')">' blue,
           '<input type="radio" name="rb'||pk_id||'" id="rb'||pk_id||'_3" value="GREEN" '||
               decode(color_choice, 'GREEN', 'CHECKED', '')||
               ' onClick="rbAction('||pk_id||', ''GREEN'')">' green,
           color_choice  -- f03
    from objects_to_colorJavaScript ...
    function rbAction (id, color) {
        // f01 is pk_id (hidden)
        // f03 db column color_choice for update (hidden)
         var idx;
         // Find row index using evaluation_question_id.
        for (var i=0; i < document.wwv_flow.f01.length; i++) {
           if (document.wwv_flow.f01(i).value == id) {
              idx = i;
              i = document.wwv_flow.f01.length;
        //  Set hidden result column referenced in update.
        document.wwv_flow.f03(idx).value = color;
    function submit () {
      // Clears radio buttons to prevent Apex trying to post and causing page error.
      var items = document.getElementsByTagName("INPUT");
      for (i=0; i< items.length; i++) {
        if (items(i).type == "radio") {
          if (items(i).checked == true)
            items(i).checked = false;
      doSubmit('SUBMIT');
    }

  • How to display  servlet dynamically generated image ?

    Hi,
    How to display servlet dynamically generated image ?
    I have a servlet generating a buffered image in the doGet. I want to display the image in a jsp page with other information. I'm not able to get it properly displayed.
    **Try n# 1 **************************************************************
    This displays my image but nothing elle :
    ServletOutputStream sos = pResponse.getOutputStream();
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(sos);
    encoder.encode(img);
    **Try n# 2 ****************************************************************
    I tried also :
    In the servlet :
         request.setAttribute("renderedImage", img);
    and in the jsp page :
         BufferedImage image = (BufferedImage) request.getAttribute("renderedImage");
         <img src="<%=ImageIO.write(image,"jpeg",response.getOutputStream())%>" width="300" height="280"/>
    This last try draws big crap in the jsp page, thank you in advance.
    Nelson

    Call another servlet from the IMG tag. Have the servlet stream out the image using ImageIO (instead of writing HTML).

  • Validate Dynamically Generated Form Fields

    Hello, I am having difficulty in validating some text boxes I dynamically generated using javascript.
    I have done the below which is not working..... giving errors of undefined or is null
    var i=rowNum;//value of the integer giving the form field a unique name
    var thefield =(eval(document.getElementById('xxxx_'+i).value));
    if (thefield =="")
    alert("xxxxxxxxxxxxx");
    This is not working. Any one has example of validating dynamically generated form fields?

    Check out jquery and the validation plug-in by Jörn Zaefferer: http://plugins.jquery.com/project/validate
    It'll simplify your life!

  • Dynamically generating the jnlp file

    Hi Experts,
    Im working on a project in which we launch the Eclipse RCP from the web UI (thin client).
    I want to dynamically generate the jnlp file cause I want to pass the session of the user from the web client to RCP.
    So for this i have thought of having a variable let say sessionID ,which will take value of the session
    sum thing like this...
    <application-desc main-class="com.rcp.core.HelloWorld">
    <property name="sessionID" value="$$userSessionId"/>
    </application-desc>
    But im not able to figure out how i will populate the sessionID variable.
    which class should be responsible for doing this?
    whether that class will be in the RCP code or in the Web code...i guess it is in the web code?
    Please if u can clarify these doubts then it will be great.
    Thanks
    ved

    usually you would use jsp or a servlet to generate the jnlp file.
    If you extend the JnlpDownloadServlet (found in the sample directory in the JDK) you can generate the session id.
    /Andy

  • Problem viewing images from FTP server from HTMLs generated from a JSP

    Hello,
    We are developing an web application. The htmls will be dynamically generated based on user request. These htmls will contain images using urls like this "<img src="ftp://xyz/test.jpg">". We are having some strange problem. When we view the jsp generated html then it can not retreive the images fromthe FTP server. But when I copy the texts of this html and make a static html with this text then the image is shown...:-((
    Ahmed

    I don't know for sure,
    but if you use a server like resin you need to place the port after the server (e.g. intranet:8080/index.html) so maybe you should type ftp://xyz:23/image.jpg.

  • BUG:? "permission denied" error in generated javascript of af:table!

    Hi,
    In a JSF page with frames, the generated javascript event handlers (_tableSort and _navSubmit) of a af:table component raise a "permission denied" error in Internet Explorer.
    After this error is raised, nothing work... links, command, etc. do not respond.
    For example:
    1.- Frameset page:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:afh="http://xmlns.oracle.com/adf/faces/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces">
      <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
                  doctype-system="http://www.w3.org/TR/html4/loose.dtd"
                  doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
      <jsp:directive.page contentType="text/html;charset=windows-1252"/>
      <f:view>
        <afh:html>
          <afh:frameBorderLayout id="ttt">
            <f:facet name="center">
              <afh:frame source="http://myserver/myapp/faces/Welcome.jspx" height="500" width="500"
                         id="xxx" name="xxx"/>
            </f:facet>
          </afh:frameBorderLayout>
        </afh:html>
      </f:view>
    </jsp:root>2.- And this is the http://myserver/myapp/faces/Welcome.jspx page (with af:table component):
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:afh="http://xmlns.oracle.com/adf/faces/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces">
      <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
                  doctype-system="http://www.w3.org/TR/html4/loose.dtd"
                  doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
      <jsp:directive.page contentType="text/html;charset=windows-1252"/>
      <f:view>
        <afh:html>
          <afh:head title="Resultado Operacion">
            <meta http-equiv="Content-Type"
                  content="text/html; charset=windows-1252"/>
          </afh:head>
          <afh:body>
            <h:form>
              <af:table emptyText="No items were found"
                        value="#{MBDummy.listaPolizas}" var="row" rows="25">
                <af:column sortable="false" headerText="Pol Prefijo"
                           formatType="text">
                  <af:outputText value="#{row.polPrefijo}"/>
                </af:column>
                <af:column sortable="false" headerText="Pol Secuencia"
                           formatType="text">
                  <af:outputText value="#{row.polSecuencia}"/>
                </af:column>
              </af:table>
            </h:form>
          </afh:body>
        </afh:html>
      </f:view>
    </jsp:root>When I try to navigate through table pages, Interner Explorer raise the "Permission Denied" error

    Hi,
    Did you ever get any reply to this? I'm now running into the exact same problem, for the exact same reason (app works fine--unless a containing window is being served off another host--then we get Permission Denied). Changing the hosting configuration is, unsurprisingly, not an option. Is there a way around this problem? This is a really critical piece for us.
    Best,
    Avrom
    [edit: I have more information. This Javascript error is raised by a Javascript security feature and is intended to prevent cross-site scripting. If a frame's contents are served by a different server than the surrounding window, the contents of the frame are not allowed access to the other contents of the surrounding window.
    Apparently, a number of ADF Faces components (including the table) have Javascript that attempts to access the top-level window...which means that you *cannot* run ADF faces in a situation like the one you described. Personally, I think that's an ADF Faces bug.
    Our workaround is to abandon the idea of putting the app in a frame...we're going with either a popup or allowing the app to take over the window.]
    Message was edited by:
    Avrom

  • How can I sort a dynamically generated table

    I am dynamically populating the columns in a table every time my page is loaded. (see code below)
    This is all working fine, and I am also able to use the built in pagination.
    However, I run into problems as soon as I click on a column header to try sort the table.
    I assume that because the columns are not defined in the JSP (because they are added dynamically), the sort criteria is referring to non-existant columns once the page reloads.
    I get an exception as follows
    Exception Details:  org.apache.jasper.JasperException
      #{currentRow.value['categories.category_id']}Can anyone suggest a solution so that I can sort the data for my dynamically generated table?
    Cheers,
    Ian
    //NOTE: I call populateTable(tableRowGroup1,dynamicRowSetDataProvider) in my prerender code.
    //tableRowGroup1 is defined as an empty (ie no children) row group in the JSP
    private void populateTable(TableRowGroup rowGroup, DataProvider dp) {
        rowGroup.setSourceVar("currentRow");
        try {
            FieldKey[] columnNames = dp.getFieldKeys();    
            for(int i=0; i < columnNames.length; i++) {
                String columnName = columnNames.getFieldId();
    info(i+": columnName");
    rowGroup.getChildren().add(
    createStaticTextColumn(columnName, "#{currentRow.value['"+columnName+"']}")
    } catch (Exception ex) {
    log("Error Description", ex);
    info("Error Description : " + ex);
    return;
    private TableColumn createStaticTextColumn(String heading, String dataField) {
    TableColumn tableColumn = new TableColumn();
    tableColumn.setHeaderText(heading);
    tableColumn.setSort(dataField);
    TextField staticText = new TextField();
    ValueBinding vb = getApplication().createValueBinding(dataField);
    staticText.setValueBinding("text", vb);
    tableColumn.getChildren().add(staticText);
    return tableColumn;

    I'm also having this problem, and I'm sure many more are too. It seems that no one has a solution, but perhaps that makes it even more value able for a sun dev to figure it out. It's surprising that it's so difficult to make dynamically generated tables with JSC.

Maybe you are looking for