Dynamic page contentType

Good afternoon...
I'm developing an application using Struts and I need to be able to change either the JSP being used depending on the content-type (either HTML or XML) that I have to generate
-or-
use the same JSP but change the contentType of the JSP and execute only the part of the JSP that pertains to that type.
Thanks,
Eric Schultz.

Oh, how.... well, hmmmm. You might need to be more specific then that, because I don't really know what level you are at, on a technical level, or where you are at with what you have already written. I mean, do you know how to create a JSP file to write out the HTML and just aren't sure how to use XML instead? Or you know how to make either or... in that case...
Well, I guess that all depends. You could have separate JSP files and Struts can forward from the actions to the specific JSP page. Of course, the how here depends partly on how you need to decide whether to use HTML or XML.
Or you could write one JSP page, and write out the relevant code...:
<% if(useXml) { %>
<?xml version="1.0"?>
<% } else { %>
<html>
<% } %>

Similar Messages

  • Dynamic Pages

    Hello to all! Please help me somebody ((. If it's not hard to
    explane me how to script dynamic pages. So i made flash menu then I
    have php page named index.php(with inserted flash menu at the top
    ). When I click on button at the menu all page reloads. But i need
    only to change content that goes under menu. I tried to do it in
    different ways but server side always needs reload. Please help me
    maybe it possible to create something like that using XML. If you
    have some topics or tutorials how to do it. (
    With XML i tried this:
    var my_str = "blabla";
    var my_xml:XML = new XML(my_str);
    my_xml.contentType = "text/xml";
    var receive_xml:XML = new XML();
    recrive_xml.onLoad = function(success){ if(success){
    trace(this.toString()); } else {
    trace("no dat recived"); }}
    my_xml.sendAndLoad("phpscript.php", receive_xml);
    And the server side:
    <?php
    $input = file_get_contents("php://input");
    echo $input;
    ?>
    but nothing....
    Please i need some basic tutorial

    You can have htp calls only within a pl/sql block ie in dynamic pages you do
    <oracle>
    begin
    your pl/sql statement 1;
    your pl/sql statement n;
    end;
    </oracle>
    Eg . This is possible.
    <ORACLE>
    begin
    htp.p('Sunil');
    end;
    </ORACLE>
    You can not call htp.p in a select statement.
    Hope that helps.
    Sunil.
    null

  • Database Driven Dynamic pages

    Hi all,
    I am new to jsp/servlets but I know java. I have been teaching myself jsp for a few weeks now, but i am unclear about a few things. I figure a good exercise would be to make a ecom. website for someone i know, which would help me learn and they would get a site for free. I am just unclear on creating the dynamic pages. Say i have 6 categories. I would like to click on the link and select all the products from that category and display them in a table on the page. I know you need to create a servelet that will query the db then you can create the table adding in the data from the DB and send it back to the client side. Im just not sure what its the best way to do this. I have seen code the looks like product?productCode=123131. and i believe this calls a servelet and passes in the 123131 as a parameter. I have a pretty good idea of how to do this but i am looking for an example or some kind of tutorial to help me along. I have been searching for a while and came up with nothing. I have been using this book while teaching myself.
    Murach's Java Servlets and JSP
    They have a pretty good example of an entire site but i am just getting stuck in this spot.
    TIA
    John

    Sorry i was in rich text mode
    web.xml
    <servlet>
            <servlet-name>DisplayProducts</servlet-name>
            <servlet-class>category.DisplayProducts</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>DisplayProducts</servlet-name>
            <url-pattern>/product</url-pattern>
        </servlet-mapping>Product.java
    package ecom;
         import java.text.NumberFormat;
         import java.io.Serializable;
         public class Product implements Serializable
              private int code;
              private String style;
              private String description;
              private double price;
              private String color;
              private String size;
              private String thumb;
              private String full;
              public Product()
                   code = 0;
                   style = "";
                   description = "";
                   price = 0;
                   color = "";
                   size = "";
                   thumb = "";
                   full = "";
              public void setCode(int code)
                   this.code = code;
              public int getCode()
                   return code;
              public String getStyle() {
                   return style;
              public void setStyle(String style) {
                   this.style = style;
              public void setDescription(String description)
                   this.description = description;
              public String getDescription()
                   return description;
              public void setPrice(double price)
                   this.price = price;
              public double getPrice()
                   return price;
              public String getColor() {
                   return color;
              public void setColor(String color) {
                   this.color = color;
              public String getSize() {
                   return size;
              public void setSize(String size) {
                   this.size = size;
              public String getThumb() {
                   String imageURL = "/images/" + thumb;
                   return imageURL;
              public void setThumb(String thumb) {
                   this.thumb = thumb;
              public String getFull() {
                   String imageURL = "/images/" + full;
                   return imageURL;
              public void setFull(String full) {
                   this.full = full;
              public String getPriceCurrencyFormat()
                   NumberFormat currency = NumberFormat.getCurrencyInstance();
                   return currency.format(price);
         }ProductDB.java
    package data;
    import java.sql.*;
    import java.util.*;
    import ecom.Product;
    public class ProductDB {
        //This method returns null if a product isn't found.
        public static Product selectProduct(int productID)
            ConnectionPool pool = ConnectionPool.getInstance();
            Connection connection = pool.getConnection();
            PreparedStatement ps = null;
            ResultSet rs = null;
            String query = "SELECT A.PROD_SKU_ID, B.STYLE, B.DESCRIPTION, B.PRICE, A.COLOR, A.SIZE, C.THUMB_IMAGE, C.FULL_IMAGE "+
            "FROM TB_PRODUCT_SKU A "+
            "JOIN TB_PRODUCT B ON(A.PRODUCT_ID = B.PRODUCT_ID) "+
            "JOIN TB_WEB_IMAGE C ON(C.WEB_IMAGE_ID = B.WEB_IMAGE_ID) "+
            "WHERE A.PROD_SKU_ID = ? AND A.QUANTITY > 0";
            try
                ps = connection.prepareStatement(query);
                ps.setInt(1, productID);
                rs = ps.executeQuery();
                if (rs.next())
                    Product p = new Product();
                     p.setCode(rs.getInt("PROD_SKU_ID"));
                       p.setStyle(rs.getString("STYLE"));
                       p.setDescription(rs.getString("DESCRIPTION"));
                       p.setPrice(rs.getDouble("PRICE"));
                       p.setColor(rs.getString("COLOR"));
                       p.setSize(rs.getString("SIZE"));
                       p.setThumb(rs.getString("THUMB_IMAGE"));
                       p.setFull(rs.getString("FULL_IMAGE"));
                    return p;
                else
                    return null;
            catch(SQLException e)
                e.printStackTrace();
                return null;
            finally
                 UtilDB.closeResultSet(rs);
                 UtilDB.closePreparedStatement(ps);
                pool.freeConnection(connection);
        //This method returns null if a product isn't found.
        public static ArrayList<Product> selectProducts(String cat_id)
             ConnectionPool pool = ConnectionPool.getInstance();
             Connection connection = pool.getConnection();
             PreparedStatement ps = null;
             ResultSet rs = null;
             String query = "SELECT A.PROD_SKU_ID, B.STYLE, B.DESCRIPTION, B.PRICE, A.COLOR, A.SIZE, C.THUMB_IMAGE, C.FULL_IMAGE "+
                            "FROM TB_PRODUCT_SKU A "+
                            "JOIN TB_PRODUCT B ON(A.PRODUCT_ID = B.PRODUCT_ID) "+
                            "JOIN TB_WEB_IMAGE C ON(C.WEB_IMAGE_ID = B.WEB_IMAGE_ID) "+
                            "WHERE CATEGORY_ID = " +cat_id+ "AND A.QUANTITY > 0";
             try
                  ps = connection.prepareStatement(query);
                  rs = ps.executeQuery();
                  ArrayList<Product> products = new ArrayList<Product>();
                  while (rs.next())
                       Product p = new Product();
                       p.setCode(rs.getInt("PROD_SKU_ID"));
                       p.setStyle(rs.getString("STYLE"));
                       p.setDescription(rs.getString("DESCRIPTION"));
                       p.setPrice(rs.getDouble("PRICE"));
                       p.setColor(rs.getString("COLOR"));
                       p.setSize(rs.getString("SIZE"));
                       p.setThumb(rs.getString("THUMB_IMAGE"));
                       p.setFull(rs.getString("FULL_IMAGE"));
                       products.add(p);
                  return products;
             catch(SQLException e)
                  e.printStackTrace();
                  return null;
             finally
                  UtilDB.closeResultSet(rs);
                  UtilDB.closePreparedStatement(ps);
                  pool.freeConnection(connection);
        public static ArrayList<Product> selectProducts()
             ConnectionPool pool = ConnectionPool.getInstance();
             Connection connection = pool.getConnection();
             PreparedStatement ps = null;
             ResultSet rs = null;
             String query = "SELECT A.PROD_SKU_ID, B.STYLE, B.DESCRIPTION, B.PRICE, A.COLOR, A.SIZE, C.THUMB_IMAGE, C.FULL_IMAGE "+
                            "FROM TB_PRODUCT_SKU A "+
                            "JOIN TB_PRODUCT B ON(A.PRODUCT_ID = B.PRODUCT_ID) "+
                            "JOIN TB_WEB_IMAGE C ON(C.WEB_IMAGE_ID = B.WEB_IMAGE_ID) "+
                            "WHERE A.QUANTITY > 0";
             try
                  ps = connection.prepareStatement(query);
                  rs = ps.executeQuery();
                  ArrayList<Product> products = new ArrayList<Product>();
                  while (rs.next())
                       Product p = new Product();
                       p.setCode(rs.getInt("PROD_SKU_ID"));
                       p.setStyle(rs.getString("STYLE"));
                       p.setDescription(rs.getString("DESCRIPTION"));
                       p.setPrice(rs.getDouble("PRICE"));
                       p.setColor(rs.getString("COLOR"));
                       p.setSize(rs.getString("SIZE"));
                       p.setThumb(rs.getString("THUMB_IMAGE"));
                       p.setFull(rs.getString("FULL_IMAGE"));
                       products.add(p);
                  return products;
             catch(SQLException e)
                  e.printStackTrace();
                  return null;
             finally
                  UtilDB.closeResultSet(rs);
                  UtilDB.closePreparedStatement(ps);
                  pool.freeConnection(connection);
    }Display products.java
    package category;
    import java.io.IOException;
    import java.sql.Connection;
    import java.util.List;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import data.ConnectionPool;
    import data.ProductDB;
    import ecom.Product;
    public class DisplayProducts extends HttpServlet{
         protected void doGet(HttpServletRequest request,
                   HttpServletResponse response)
                 throws ServletException, IOException
              List<Product> products = ProductDB.selectProducts();
              HttpSession session = request.getSession();
              session.setAttribute("products", products);
              String url = "/bracelets.jsp";
              RequestDispatcher dispatcher =
                   getServletContext().getRequestDispatcher(url);
              dispatcher.forward(request, response);
    }bracelets.jsp
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    <table>
      <thead>
        <tr><th>ID</th><th>Product Name</th><th>Price<th></tr>
      </thead>
      <tbody>
        <c:forEach var="products" items="${products}">
          <!-- formatting probably required for price -->
          <tr>
          <td>${product.code}</td>
          <td>${product.style}</td>
          <td>${product.description}</td>
          <td>${product.price}</td>
          <td>${product.color}</td>
          <td>${product.size}</td>
          <td>${product.thumb}</td>
          <td>${product.full}</td>
          </tr>
        </c:forEach>
      </tbody>
    </table>
    </body>
    </html>index.jsp
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    <p><a href="product">Bracelets</a></p>
    </body>
    </html>Edited by: jonnyd9191 on Jul 14, 2008 1:49 PM

  • Dynamic Page Layout - Opportunity Product Revenue

    Hi gurus,
    I am trying to setup a dynamic template for "Opportunity Product Revenues"
    I set it up successfully in the object. However, this data is exposed only as a related list of Opportunity and not directly. Now, when I go into the "Opportunity" customization, it only allows me to set up static page layouts, with no option to setup the Dynamic page layouts through the Related list.
    Please help..

    Hi Jonathan,
    Many thanks for your response.
    Our CTE is already on R19. We want to experiment and be ready when our PROD is upgraded to R19.
    Can you help me with the requirement, if you have an idea please? I would really appreciate the help.
    Thanks

  • In a dynamic page how to share variable between PL/SQL and javascript

    For example, my dynamic page contains such PL/SQL codes:
    <ORACLE>
    DECLARE
    info varchar(100);
    rowid urowid;
    procedure doDelete(
    row_id in urowid
    ) IS
    begin
    Delete From xxx
    WHERE rowid = row_id;
    end doDelete;
    BEGIN
    Select name, rowid INTO info, rowid
    From xxx Where xxx;
    HTP.PRN(' <INPUT TYPE="button" VALUE="show value" onClick="alert(info);">');
    HTP.PRN(' <INPUT TYPE="button" VALUE="delete" onClick="doDelete(_row_id);">');
    END;
    </ORACLE>
    The variable 'info' and '_row_id' are correct, however the two HTP. sentence do not work. What's the problem?
    What I want to do is to show all the records in TABLE A in a page. And at the end of each line (record), there' re a 'delete' and a 'update' button to let user operate on this record. Is this possible? I know form can do delete an update, but it can not show all the records in a page like what report does. Besides dynamic page, is there any other better choice? Report can do it?
    One more question. In a report, I employed link on one field to a second report. It works well. But I want to open the second report in a new window when the link is click. Is this possible?
    I was almost driven crazy by these :( I so appreciate if anyone can help.

    The code written by you is insufficient for the funtionality you are trying to achieve. Below is a method to achieve the same.
    Note: Used standard scott.emp table for the example which is located in my db provider schema.
    Do the below modifications as per your local configuration
    xxxxx -> Replace it with your Portal schema
    yyyyy -> Replace it with your db provider schema
    <<module_id_of_form>> -> Replace with the module id of form created in step 1 & 2.
    First and foremost... oracle does not allows variables starting with '_'. So if you want to use it you have to place it in double quotes ("")
    rowid -> illegal
    "_row_id" -> legal.
    However, I will advice you not to use variable names starting with "_".
    Now lets get started...
    1. Create a form on the table you are using in the dynamic page. Just have the update button. Remove the other buttons.
    2. Get the module id of this form. Instruction for getting the module id:
    a) Right-click on the form's run link and copy the shortcut
    b) Get the value of p_moduleid parameter. This is your module id.
    3. Create a procedure "save_action_details" in your db provider schema. This procedure will accomplish the delete operation on the record.
         CREATE OR REPLACE Procedure save_action_details(
         p_rowid IN VARCHAR2,
         p_action IN VARCHAR2,
         p_dyn_ref_path IN VARCHAR2,
         p_dyn_page_url IN VARCHAR2)
         is
         l_sto_session xxxxx.wwsto_api_session;
         begin
         l_sto_session := xxxxx.wwsto_api_session.load_session(
         p_domain => 'DynStore',
         p_sub_domain => 'DynStore_' || p_dyn_ref_path
         l_sto_session.set_attribute(
         p_name => 'rowid',
         p_value => p_rowid
         l_sto_session.set_attribute(
         p_name => 'action',
         p_value => p_action
         l_sto_session.save_session;
         htp.init;
         owa_util.redirect_url(p_dyn_page_url);
         end save_action_details;
    Explaination: The above procedure creates a session and keeps the rowid and action in the session. This information is used by the below dynamic form to perform the necessary action. In our exampl, the action is always going to be delete so you may go ahead and hard code it, else leave it as it is.
    4. Grant execute privilege on the procedure "save_action_details" to public.
    sql> grant execute on save_action_details to public;
    5. Create your Dynamic page.
    a) In HTML code section have the below code. This code shows some columns from the table and "update" and "delete" buttons to perform the respective action.
         <ORACLE>select empno,ename,rowid,
         '<input type="button" value="Update" onClick="doAction(this.form,''UPD'',''xxx'','''
         || xxxxx.wwv_standard_util.url_encode(rowid) || '''); tWin();">
         <input type="button" value="delete" onclick="doAction(this.form,''DEL'',''' || rowid || ''',''xxx'');">' Action
         from yyyyy.emp</ORACLE>
    b) In additional pl/sql code section of dynamic page, have the below pl/sql block "in after displaying the header" section.
         declare
         l_sto_session xxxxx.wwsto_api_session;
         l_del_rowid varchar2(20);
         l_action varchar2(10);
         begin
         htp.comment('User code starts here ...');
         htp.p('<script>');
         htp.p('var winHandle;');
         htp.p('
         function doAction(formObj, action, rowid, erowid)
              if (action == "UPD")
              var formURL = "' || xxxxx.wwctx_api.get_proc_path('wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=<<module_id_of_form>>&p_arg_names=_rowid&p_arg_values=') || '" + erowid;
              winHandle = window.open(formURL, "winDynUpd", "width=750,height=500,resizable=yes");
              else
              formObj.p_rowid.value = rowid;
              formObj.p_action.value = action;
              formObj.submit();
         function tWin() {
              if (winHandle.closed) {
              document.location = document.location;
              else {
              setTimeout("tWin()", 500);
         htp.p('</script>');
         htp.p('<form name="dynRowProcess" method="POST" action="'
         || xxxxx.wwctx_api.get_proc_path('save_action_details','yyyyy')
         || '">');
         htp.p('<input type="hidden" name="p_rowid">');
         htp.p('<input type="hidden" name="p_action">');
         htp.p('<input type="hidden" name="p_dyn_ref_path" value="' || p_reference_path || '">');
         htp.p('<input type="hidden" name="p_dyn_page_url" value="' || p_page_url || '">');
         l_sto_session := xxxxx.wwsto_api_session.load_session(
         p_domain => 'DynStore',
         p_sub_domain => 'DynStore_' || p_reference_path
         l_del_rowid := l_sto_session.get_attribute_as_varchar2('rowid');
         l_action := l_sto_session.get_attribute_as_varchar2('action');
         if l_action = 'DEL' then
         delete from yyyyy.emp
         where rowid = l_del_rowid;
         end if;
         end;
    Explaination: The session information (rowid and action) stored by "save_action_details" procedure is retrieved by the dynamic page and is used to delete the record.
    6. Once you are through with the above steps, test it by placing the above "dynamic page" portlet on a page.
    a) When you click on delete button the record gets deleted and the automatically refreshed page will not show the deleted record.
    b) On clicking update button, a form will appear. do the necessary modifications in data and click update. the data in the form gets updated. Once you close the form the dynamic page gets refreshed automatically and it will show you the updated information.

  • Need to display column names in a dynamic page

    Hi
    I am displaying some rows returned from an sql querry in a dynamic page ...I hv written the sql querry between <ORACLE> AND </ORACLE> TAGS...The problem is ,i am not able to display the column names ...Why ? pl help....
    ram

    You must to use the htp package. Example:
    <ORACLE>
    begin
    htp.tableopen('1','CENTER',null,null,'BORDER="1"');
    htp.tableheader('NParte','CENTER');
    htp.tableheader('Descripcisn','CENTER');
    htp.tableheader('Precio/Unit','CENTER');
    htp.tableheader('Servicio','CENTER');
    htp.tableheader('IVA','CENTER');
    htp.tableheader('Total','CENTER');
    for cursor_cotiza in (select
    r.Nparte as Nparte, r.Descripcion as Descripcion,
    r.preciounit as preciounit,
    NVL(f.servicio,0) as servicio,
    round((0.145)*r.preciounit,3) as IVA,
    round((0.145)*r.preciounit,3) + r.preciounit +
    NVL(f.servicio,0) as PrecioTotal
    from
    carryin.repuestos r,
    carryin.casos c, carryin.facturacion f
    where r.NCaso =:NCaso
    and r.Ncaso=c.NCaso
    and c.Ncaso=f.Ncaso(+)
    and f.servicio(+)<>0
    union
    select
    r.Nparte as Nparte, r.Descripcion as Descripcion,
    r.preciounit as preciounit,
    NVL(f.servicio,0) as servicio,
    round((0.145)*r.preciounit,3) as IVA,
    round((0.145)*r.preciounit,3) + r.preciounit +
    NVL(f.servicio,0) as PrecioTotal
    from
    carryin.casosneq r,
    carryin.facturacion f
    where r.NCaso =:NCaso
    and r.Ncaso=f.Ncaso(+)
    and f.servicio(+)<>0
    ) loop
    htp.tableRowOpen('CENTER','CENTER');
    htp.tableData(cursor_cotiza.Nparte,'CENTER');
    htp.tableData(cursor_cotiza.Descripcion,'CENTER');
    htp.tableData(cursor_cotiza.preciounit,'CENTER');
    htp.tableData(cursor_cotiza.servicio,'CENTER');
    htp.tableData(cursor_cotiza.IVA,'CENTER');
    htp.tableData(cursor_cotiza.PrecioTotal,'CENTER');
    htp.tableRowClose;
    end loop;
    htp.tableclose;
    end;
    </ORACLE>
    This example show a table with header and borders. You must to see this package for more information.

  • How to create a form based on table using dynamic page?

    Hi,
    I need to create a form using dynamic page. How do you pass values from the html form to a oracle procedure that will get executed on submission of the form ? I could not find any documents which shows how to do that. Can anyone please help me out with an example ?
    thanks,
    Mainak

    Hi,
    Something seems to get added to the form action because of "http". Hence I am removing it.
    You need to write a procedure with the values in the as parameters. Say for example you want to insert a record into dept
    table then
    Dynamic page code
    <html>
    <body>
    <form action="portalschema.insert_dept">
    <input type="text" name="p_deptno">
    <input type="text" name="p_dname">
    <input type="submit" name="p_action" value="save">
    </form>
    </body>
    </html>
    Procedure code.
    create or replace procedure insert_dept
    (p_deptno in number,
    p_dname in varchar2,
    p_action in varchar2)
    is begin
    if p_action = 'save' then
    insert into scott.dept(deptno,dname) values(p_deptno,p_dname);
    commit;
    end if;
    end;
    grant execute on insert_dept to public;
    Hope this helps.
    Thanks,
    Sharmila

  • How to get page URL in a dynamic page in 10.1.4?

    Does anyone know how to get the page URL in a Dynamic Page in 10.1.4 without using javascript.
    I know that you can use a PL/SQL portlet and the portlet_record, but this is specifically for a Dynamic Page.
    Regards
    Jenny

    Hi,
    I am trying the suggested approach in 10.1.4 but unfortunatley I get the following error:
    PLS-00302: component 'SHOW_INTERNAL' must be declared
    In my Dynamic Page I have the following code
    htp.p(cms_context.urlpage);
    In the '... before displaying the page' I have the following
    schema_name.cms_context.urlpage := schema_name.dynamic_page_name.show_internal.p_page_url;
    Can anyone help?
    Cheers
    Chris

  • How to get form fields in a dynamic page as a portlet

    I have a dynamic page(publish as portlet and added to a portal page) with a html form that has many radio button created dynamically (query a table and create as many radio button as records I found) and the name of each radio button is the id of the record from the table it represents.
    When I click the submit button of my form it will recall the same portal page and then I have to check which radio buttons where selected to update the database depending on it.
    The problem is that I can't get the radio buttons inside the dynamic page because they are created dynamically so I can't make them portlet parameters to be associated with page parameters.
    So How can I tell which radio buttons have been selected?
    Please help me.

    Hi,
    Write a procedure which will be called as the form action. This procedure should take an array of parameters like p_arg_names and p_arg_values. For example
    <html>
    <form>
    <input type="checkbox" name="p_radio">
    <input type="checkbox" name="p_radio">
    </form>
    procedure submit_form(p_radio in wwv_utl_api_types.vc_arr)
    begin
    for i in 1..p_radio.count
    loop
    htp.p(p_radio(i));
    end loop;
    wwv_redirect.url(<page_url>);
    end;
    Hope that helps.
    Thanks,
    Sharmila

  • Retrieve data from a dynamic page via loadURL

    Hello.
    I would like to ask you how it is possible to retrieve data
    from a dynamic page (asp classic in my case) using the loadURL
    method.
    I would like to create an html authentication form (with
    username and password fields). The loadURL method should call an
    asp page and then pass to the usual function 'DoIfSucceded' the
    results of the elaboration.
    Of course I'm going to have a switch in the function in order
    to make different actions depending from the results of the asp
    page (authentication succeded or failed).
    I had a look to the examples at this page:
    Adobe
    samples
    Is there anyone who can explain clearly how the results data
    must be written by the asp page and how the success function can
    retrieve them ?
    I thank you in advance for your help.

    loadURL() uses the the XMLHttpRequest Object so if the
    content you return is XML, you have 2 choices for accessing your
    data. You can either access it as a text string via the
    XMLHttpRequest object's responseText property, or as a DOM document
    via the XMLHttpRequest object's responseXML property:
    function MySuccessCallback(req)
    // If my data is XML, I can access the data that was sent
    from the server
    // as DOM elements via the XMLHttpRequest's responseXML
    property.
    var xmlDOM = req.xhRequest.responseXML;
    // OR, you can access the data sent back from the server as
    text via
    // the XMLHttpRequest object's responseText property.
    var xmlAsAString = req.xhRequest.responseText;
    var req = Spry.Utils.loadURL("GET",
    "/app/book.php?id=1&code=54321", true, MySuccessCallback);
    If your serverside script wants to use some other format as a
    response like JSON or plain text, then you can only access the data
    as text via the responseText property.
    --== Kin ==--

  • Error creating dynamic page in an application with a schema other than portal30

    Running 9iAS 1.0.2.2 on Solaris.
    Database 8.1.7.1
    I cannot seem to create a default dynamic page (select 'x' from dual) in an application that has a schema (e.g. test) other
    than portal30. The error seems to be when portal tries to compile the dynamic-page package, it references itself from
    within the package but prefixing the call with the other (test) schema. It never seems to compile? What seems to be the
    problem? Any ideas?

    If you are using any database object other than the applcation owned,then it has to be prefixed with the schema owner.
    For example,
    if the application schema is based on the schema "schema1" (say)
    and your query is based on one of the object on "schema2"
    and if you have necessary privilegves to access that object from schema2, then the compiler wont throw any error.
    Can u explain, what u problem you are experiencing in detail?
    (Also, if u give me the portal version, I can cross-verify that).

  • Calling a procedure from Dynamic Page

    I am trying to call a procedure from a dynamic page. The procedure displays multi records from a table. I have created a procedure:
    PROCEDURE process_student_request( p_primary_request in wwv_utl_api_types.vc_arr,
    p_alternate_request in wwv_utl_api_types.vc_arr,
    p_action in varchar2,
    l_status in out varchar2);
    When I hit the submit button on the dynamic page it does not execute the procedure and tries to open a new page. How do I get this to work?
    Here is the text of the page:
    <HTML>
    <HEAD>
    <TITLE>Example</TITLE>
    </HEAD>
    <BODY>
    <FORM action="portal30.star_portal.process_student_requests" method="post">
    <TABLE BORDER="0" WIDTH="100%" CELLPADDING="2" CELLSPACING="0" class="RegionBorder">
    <TR>
    <TD valign="top" align="left" width="40%"><FONT class="PortletText1">
    <ORACLE>declare
    row_num number := 1;
    hold_row_num number;
    hold_class_cd stars3.req.class_cd%TYPE;
    begin
    for c1 in (select A.start_yy, A.school, A.student_id, A.class_cd, B.name from stars3.course B, stars3.req A
    where A.student_id = portal30.star_portal.get_session_variable('STUDENT_ID') and A.start_yy = '01' and
    A.alternate_no = '0' and
    B.start_yy = A.start_yy and
    B.school = A.school and
    B.class_cd = A.class_cd)
    loop
    hold_class_cd := c1.class_cd;
    htp.p(lpad(to_char(row_num),2,'0'));
    htp.p('<select name="p_primary_request">');
    htp.p('<option value="' || c1.class_cd|| '">' || c1.name || '</option>');
    row_num := row_num + 1;
    htp.p('<BR>');
    end loop;
    htp.p('<input type="submit" name="p_action">');
    end;
    </ORACLE>
    </BODY>
    </FORM>
    </TD>
    </TR>
    </TABLE>
    </HTML>

    Bob,
    You have variables in your procedure like l_status, p_alternate_status which you do not have in the form. Are these IN or OUT variables ?
    If these are IN variables, this proc will not work because you do not have any variable in the form. So from where does it get the values? There is not any default declared too. You have to explicitly define IN or OUT variables.
    Have you also given execute permission to public ?

  • Issue in Customizing ESS dynamic page(Bizcard view)

    Hi experts,
    I am working on Customization of ESS portal.
    I am able to build and deploy application successfully .We are able to customize Detail View.
    Problem Here is , I am Supposed to modify in BIzcard Iview which is a dynamic page.
    Can any body help in understanding  how data is fetched in bizcard iview and  where the logic is to  be added to modify the page (in which method).
    Any pointer related to dynamic Customization of ESS portal is appreciated.

    Hi,
    I have tried alot for the same, but i didn't get any thing, so we built our own application.
    I copied one of the sap delivered DC and done my customizations.
    if that is small chnage in the IView side you can do the portal personalization.
    Cheers,
    Apparao

  • Issue in customizing ESS Dynamic Page

    Hi All,
    I am working on Customization of ESS portal.
    I am able to build and deploy application successfully .We are able to customize Detail View.
    Problem Here is , I am Supposed to modify in BIzcard Iview which is a dynamic page.
    Can any body help in understanding  how data is fetched in bizcard iview and  where the logic is to  be added to modify the page (in which method).
    Any pointer related to dynamic Customization of ESS portal is appreciated.

    Thank You staurt.
    I also got the SdnTechEd Documnet now. Was going through that.
    It Tells about the creation of Std Package.
    I need quick help  on my first Change . I.e
         for (int i = 0; i < wdContext.nodeSelectedInfotype().size(); i++)
    if(wdContext.nodeSelectedInfotype().getSelectedInfotypeElementAt(i).getBanka()== "1")
    wdContext.nodeSelectedInfotype().getSelectedInfotypeElementAt(i).setZlsch("T");
    wdContext.currentContextElement().setVa_Payment_Enable(false);
    I have requirement.
    If the Bank type is other bank (banka=1) then payment method should be of type T and non editable.
    I have wrote the above logic in Detail view init method of Controller and tried in View init too.It is making Payment method non editable in both the pages.
    Any pointer for above details.

  • How do I branch to a dynamic page on the App Server

    I have a dynamic page that is a menu that is dynamically generated based on what choice was selected from a higher level menu that is a portlet on the front page of our site (Application Server based). This menu calls up application code, currently app server portal forms. I want to convert over to HTML DB. I can not get a branch to work to branch back to my application menu. When I use function returning URL, it is appending anything that I return after the /htmldb and not replacing the URL. The hard coded URL works, but I have something that I need to look up from a database record to append to the URL. When I try using portal's portal.wwa_app_module.set_target procedure to do it, nothing happens and I get the error stating that I have no default branch to process. Thanks for the help

    Dwayne,
    I would suggest that you focus on only the HTML DB pieces here, given that the Portal components are just part of the "outside world". If you are having trouble with a branch to a function returning URL, show us the exact code and what it returns vs. what you are expecting it to return. The Apache request log might show useful inormation as well if the redirect seems to be broken.
    Scott

Maybe you are looking for