How to display contents automatically ?

Hi, all
I have a html form. It has a dropdown list and a text box in it. User will be allowed to select a employee id from the drop down list. (which is coming from DB.)
Then as soon as id is selected, that particular employee name should be displayed in the text box automatically�..immediately. again (again from DB).
Sql query as follows :
select distinct (emp#) from eaddress.-----for the id drop down list.
select distinct eid,ename from emp where eid=emp#---------for text box to display the name���.( from another table)
Can anyone suggest me how to do this ????
Regards,
Thank u.
Ash

Thank u ram,
but, i couldn't understand following lines.
especiallly
the statement within if -condition.
==============================================
if(id != null && (id ==
String.valueOf(code.get(i)))){
%>
selected <!-- set this option as selected -->
<% } %>
<!-- close option begin tag --><%=code.get(i)%></OPTION>
<% } %>
</SELECT></td>
</tr>
=================================
could u pls. clarify my doubt ? what should be done
within if condition ?Hmmm....everything's done actually :), i put in the comments so that you could understand the code better.
1. The first time this page is accessed, there would no code chosen by the user, hence the first code would be selected by default. You had coded only for this..
2. Now, the user selects a code, you have a form submit, the code selected by the user goes to the server. In the server, you get the name corresponding to the code and populate that in a textfield. However this is not enough. The user had entered a code and when you show the form back to the user, the code should be what the user selected and the textfield should have the corresponding name, right ?
1. first check if this is the first time user views the form or if he has already selected a code. To do this, check for the request parameter called 'code'.
<%
String id = request.getParameter("code")
//here if id is null, it means user is viewing the form first time, else he has selected a code and form's submitted to server to get the corresponding name
%>Next if id is not null, as you iterate through each option element, you should check if the code matches the one the user selected and if so set that code as the default value. This is how you set a default value for a select field
<option name = "foo" value = "bar" selected>foo</option>
<%
for(int i=0;i<code.size();i++){                       
%>
<OPTION NAME = "<%=code.get(i)%>"  Value = "<%=code.get(i)%>"
<!-- note this option tag has not yet been closed.-->
<!-- it can be closed only after checking for selected option -->
<!-- check to see if this option should be the 'selected' option -->
<%
  if(id != null && (id == String.valueOf(code.get(i)))){
  // the request params 'code' matches with this value of code
  //so set this option as selected and close the option tag
%>
   selected>
<%} //close if loop
<%=code.get(i)%></OPTION>
<% } //close for loop%>
</SELECT></td>
ram.

Similar Messages

  • How to display texts automatic. besides entered value for a field in Trans.

    How to display texts automatically besides the entered value for a field in a standard transaction screen. For example you have a value table and a text table associated to it. Then on entering the value field and pressing enter the text associated should get displayed immediately besides the value. Like if you have 'LOC' as the value and 'Location' as the text associated to it, on entering this value 'LOC', you automatically get the text 'Location' printed besides it automatically in a transaction screen ?
    Message was edited by: Sarika Kedia

    Hi sarika,
    Welcome to SDN.
    1. first of all, such display of text,
       is not automatic.
       (it appears to be automatic)
    2. At design time,
       a) take one extra field for text
         and mark it as OUTPUT ONLY
    3. Then in PBO coding,
        call some module, and in that module
        write code
    4. The code should be to
       select from TEXT Table
       into the work area.
    EG. THE SCREEN TEXT FIELD NAME IS
    T510A-FIELDNAME.
    CLEAR t510a.
      SELECT SINGLE * FROM t510a INTO t510a
      WHERE trfar = FIELVALUE.
    5. This will take care of
       displaying the text value of that field.
    regards,
    amit m.

  • How to display content with dynamic folder path

    Hi Experts,
    I have a folder with subfolders. This subfolders are named as weeknumbers. What we want is: depending on the weeknumber, the right folder with content is showing automatically. In week 1 we see the content of week 1 , in week 2 we see the content of week 2 etc.
    How to achive this, what is the best way?
    Thanks in advance,
    Joeri

    Hi Joeri,
    I would follow the below procedure...
    1. create a the KM navigation iViews for each of the folders in KM (Week1, Week2 etc).
    2. Create a JSP(PAR) or an HTML to access these iViews (as [Link1], [Link2] etc on a JSP or an HTML)
    3. Create an iView from PAR (if JSP-PAR)
        OR Create a KM Document iView for the HTML Page (Store the HTML Page in KM again)
    I hope this would help you.
    Cheers!!!
    Biroj Patro.

  • How to display content items in two columns?

    I have a simple content area set up, that I am adding items in
    (items that happen to be uploaded documentation files). I have a
    page created that displays the Content Area, with my own
    headers/banners etc.
    I want to display the item(s) under each folder in the content
    are, in two columns, but I can't figure out how?
    Thanks.

    Dave,
    Edit the Folder Style. Select the Folder Layout tab. Select
    the Region Properties you want to modify (e.g. Regular Items).
    Near the bottom of the page you can specify the number of
    columns.
    Regards,
    Jerry

  • How to display content without using webcenter services - task flows?

    Good day!
    I wanted to create a portlet where I can display and update an xml content retrieved from UCM Content Server. How can I do this without using taskflows (webcenter services)?
    Thanks in advance!
    Keith

    Hey Keith,
    Since you are already using the getResponseAsString() method you have your GET_FILE call working. To get the xml file as the file itself you need to instead call the getResponseStream() method. This will get you an InputStream representing the response.
    Once you have the stream you can do the following (I assume you are on a jsp page or somewhere you have access to the HttpServletResponse):
    String contentType = serviceResponse.getHeader("Content-Type");
    InputStream xmlInputStream = serviceResponse.getResponseStream();
    OutputStream outStream = response.getOutputStream();
    response.addHeader("Content-Disposition", "attachment;filename=myXmlFile.xml");
    response.setContentType(contentType);
    StreamUtil.copyStream(xmlInputStream,outStream,true,true);
    The runthrough:
    1. get the content type of the file coming back form the GET_FILE call
    2. grab the file as an InputStream
    3. get the output stream representing the response
    4. add a header to the response to trigger the "download file" dialog
    5. set the content type of the response
    6. copy the input stream to the output stream to send the xml file to the browser
    Notes:
    -StreamUtil is part of the RIDC jar
    -use Content-Disposition = inline to tell the browser to try and render the file in it's window if it can.
    Hope that helps,
    Andy Weaver - Senior Software Consultant
    Fishbowl Solutions < http://www.fishbowlsolutions.com?WT.mc_id=L_Oracle_Consulting_amw >

  • How to display content in same page when a custom command is clicked

    I have created a custom command and returned the following parameters in getLinkAttributes method but the content still opens in a window. How can I display the content in the same window/
    String editwindow = "open("iViewURL","windowName","javaScriptParam")";
    return new LinkAttributes(editwindow,"_self",true);
    Thanks in advance
    Vidya

    Hi,
    This is part of JPDK. You will have to install it. Which version of portal are you using? You can also try this out using
    URL portlet which is available with webview in 309.
    Thanks,
    Sharmila

  • How to display contents from a database to a jsp page

    hi im using hibernate , i want to display the conetents from a databse to jsp page which is having a form
    i want to get the data on the form fields after changing the values i want to write it back to the database
    im using struts and hibernate
    im struck with this plz help me

    j2ee_struts_hibernate wrote:
    hi im using hibernate , You probably shouldn't be using Hibernate.
    i want to display the conetents from a databse to jsp page which is having a form "contents", "database"
    i want to get the data on the form fields after changing the values i want to write it back to the databaseWhat don't you understand? (Sounds like you don't understand anything.)
    im using struts and hibernate How well do you know Struts? Hibernate? JSP? Java?
    im struck with this plz help meAsk a specific question and we'll see what we can do.
    Write a JSP with the form in it; submit to Struts; Struts interacts with the database. That's the flow.
    %

  • How to display content dynamically base on the menu selection?

    I have only one XML file to populate my menus and display the
    content base on the menu selection.
    If I select anything by name on the menus, example Math all
    the the Math products will display on the dsFeatures region.
    I use istinctOnLoad: true, distinctFieldsOnLoad:['name']
    function to remove duplicate rows from the data set when it loads.
    So far so good.
    Once I try to select from the grades menu this does not
    display anything.
    I'll need to dynamically change the dsFeatures.setPath when I
    click on the menus some how.
    dsFeatures.setXPath("products/product[grade =
    '"+???+"']/features/feature");
    Below is my code.
    XML used to create the menus and the display the content.
    <products>
    <product>
    <name>Math</name>
    <category>Life Math</category>
    <grade type="grade">Grade 6 - 8</grade>
    <subject>Life Math Grade 6 - 8</subject>
    <image>images/math_icon.png</image>
    </product>
    <product>
    <name>Math</name>
    <category>Division</category>
    <grade type="grade">Grade 5</grade>
    <subject>Life Math Grade 5</subject>
    <image>images/math_icon.png</image>
    </product>
    <product>
    <name>Science</name>
    <category>Life Math</category>
    <grade type="grade">Grade 6 - 8</grade>
    <subject>Life Science Grade 6 - 8</subject>
    <image>images/science_icon.png</image>
    </product>
    <product>
    <name>Social Studies</name>
    <category>Studies</category>
    <grade type="grade">Grade 5</grade>
    <subject>Social Studies Life Grade 5</subject>
    <image>images/social_icon.png</image>
    </product>
    <product>
    <name>Language Arts</name>
    <category>Life Arts</category>
    <grade type="grade">Grade 3 - 4</grade>
    <subject>Life ArtsGrade 3 - 4</subject>
    <image>images/language_icon.png</image>
    </product>
    </products>
    // Get all the products data and use distinct() to filter the
    names.
    var dsProducts = new
    Spry.Data.XMLDataSet("included/d_products.xml",
    "/products/product", { useCache: false, distinctOnLoad: true,
    distinctFieldsOnLoad:['name']});
    // Get the menu by grade using distinct()
    var dsByGrade = new Spry.Data.XMLDataSet(null,
    "/products/product/grade", { useCache: false, distinctOnLoad: true,
    sortOnLoad: "grade", distinctFieldsOnLoad:['grade'] });
    // Create the dsFeatures data set, pass a null for the URL
    parameter so that it doesn't load
    var dsFeatures = new Spry.Data.XMLDataSet(null,
    "/products/product[name = '{dsProducts::name}']/features/feature",
    { useCache: false });
    // Define a function that to register as an observer on
    dsProducts.
    function updateCategoriesAndFeatures(notificationType,
    notifier, data)
    // Interested in "onPostLoad" notifications.
    // If it is any other notification, just bail.
    if (notificationType != "onCurrentRowChanged" &&
    notificationType != "onPostLoad")
    return;
    // Received an "onPostLoad" or "onCurrentRowChanged
    notification
    // from dsProducts! Ask it for its XML document. If it has
    one, tell
    // dsFeatures to extract its data from that document.
    var doc = dsProducts.getDocument();
    if (doc)
    if (notificationType == "onPostLoad")
    dsByGrade.setDataFromDoc(doc);
    dsFeatures.setDataFromDoc(doc);
    // Register the function as an observer on dsProducts.
    dsProducts.addObserver(updateCategoriesAndFeatures);
    Menus:
    Display by names:
    <ul spry:region="dsProducts" id="nameRegion">
    <li class="product" spry:repeat="dsProducts"
    spry:setrow="dsProducts" spry:select="selected" spry:hover="hover"
    >{name}</li>
    </ul>
    Display by grades:
    <ul spry:region="dsByGrade" id="gradeRegion">
    <li class="grade " spry:repeat="dsByGrade"
    spry:setrow="dsByGrade" spry:select="selected" spry:hover="hover"
    >{grade}</li>
    </ul>
    Content.
    Display the features content:
    <ul spry:region="dsFeatures">
    <li spry:repeat="dsFeatures">{subject} <br />
    {image}</li>
    </ul>
    Any idea on how to go about this or pointer to an example
    would be appreciated.
    ~Cheers

    Does anybody have idea?

  • How to display contents of one table and update another one

    Hi all
    My requirement is the following:
    - Three tables, guard, site and guard_site where guard_site shows which guards are linked to a particular site and vice-versa
    - I need to create one front-end where i allow all guards to be linked with a particular site
    - so the panel must show all guards available (so get display data from guard table) and then i need to introduce a row selector, which allows user to select whichever guards he/she wants
    - There will be a save button and upon pressing it, i will create an entry on the guards_site table for the selected guards against the siteId provided when user goes to this page.
    - Also upon loading this page if there are already any linked guards these must show as ticked in the row selector.
    so I first attempted using a Tabular form or a form on a table/view, but it then forces me to select a table to update, which is not what i want, the data i display is from guard table, which is not the table i want to update... so I then tried a blank page and I created a SQL Query report region... but it doesn't allow me to add a row selector (even if I have added a button on the region).
    Any ideas?
    Regards and thanks
    Jose
    Ps- im using version Application Express 4.0.2.00.09 that came with Oracle Database Express Edition 11g

    Jose,
    Three tables, guard, site and guard_site where guard_site shows which guards are linked to a particular site and vice-versaso I first attempted using a Tabular form or a form on a table/view, but it then forces me to select a table to update, which is not what i want, the data i display is from guard table, which is not the table i want to update...>
    Maybe I am not understanding what you are trying to do but it appears that the table guard_site is the table you should be updating. Doesn't the guard_site table contain foreign keys from both the guard and site tables?
    Jeff

  • How to display contents of update tasks more comfortable?

    Hello,
    periodically I send an information about failed update tasks (SM13) to our users, and I offer to send more details if necessary. Of course some users want to get more details, and then I go in SM13 through every single update tasks, every single function module in it and every single data / internal tables and make an extract as a text file. This is very annoying. Is there a way which is faster and more comfortable, maybe a program which dumps the contents of a update tasks as a list?
    Thanks in advance
    Jens Hoetger

    Hi Jens,
    For every failed update there will be a system log(SM21) and short dump(ST22)generated.This can give a detailed view on the table, function modules and related stuffs.
    There is one more option from SM13 you can get the Update key (VBKEY), Take this VBKey and go to table VBHDR through SM16, paste the key and execute you will get the details of the WP,user,Function module, Reports used, Table accessed etc.
    Hope this can help you
    Regards
    Ashly.

  • How to display content in HttpSerlvetResponse in a new web page?

    I am a newbie in servlet&html and hope to get some information here for my question.
    Suppose I have a web page having a list. after the user has chosen one of them, he will click on submit to send the request to the servlet.
    In my servlet, I use the query string to get the related information and put it into a httpServletResponse. My question is, what should I do such that the content of Response will be shown in a new web page, instead of replacing the original one? Thanks!

    You can't do this from the server side. The client side should initiate the new window. There are several ways, under each:
    <a href="servlet" target="_blank">Open in new window</a>
    <form action="servlet" target="_blank">Submit to new window</form>
    <someElement onclick="window.open('servlet');">Popup a new window</someElement>

  • Display Content Groups using  JSP

    I have created an ATG content group with the
    rulesets=<ruleset>\n <accepts>\n <rule op\=and tag\="Show">\n <rule op\=and tag\="Content">\n <rule op\=any tag\="ContentSources">\n </rule>\n <rule op\=and tag\="ContentConditions">\n <rule op\=eq>\n <valueof target\="id">\n <valueof constant\="rootProd">\n </rule>\n </rule>\n </rule>\n </rule>\n </accepts>\n</ruleset>
    But i don't know how to use it/ display the product in the JSP.
    I also created a targeter and was able to display the product using TargetingFirst droplet.
    Please share your views on how to display contents of Content Group in JSP.

    Put it in an applet.
    http://java.sun.com/docs/books/tutorial/applet/index.html

  • How to display the content of a region on a different page

    Hello,
    Does anyone knows how to display the content of a region on an other page. I try to make page that displays content that resides somewhere else in my portal, so I can give a summarization of some hot topics. I really want to display the whole content of some regions (not a display with custom search).
    Thanks a lot,
    Hans

    Set that page as portlet, include it in a region in another page and in the edit defaults decide which regions you want to display.
    Mere.

  • How to display the content of a BLOB column in a ADF/BC pages ?

    How to display the content of a BLOB column in a ADF/BC pages ?
    There is some image in database table blog column. And we want to display image on the screeen.
    There is some example about upload and dowload blog columns.
    (steve not yet document example page etc...)
    But We want to display blog picture in a image component...
    is there any basic way to do it ?
    Thanks a lot...

    Ali,
    You could just download the sample app... but... here is the servlet code from the demo (look at it just for technique - you'll obviously have to change it for your needs)...
    John
    package oracle.fodemo.storefront.servlet;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.Key;
    import oracle.jbo.Row;
    import oracle.jbo.ViewObject;
    import oracle.jbo.client.Configuration;
    import oracle.jbo.domain.BlobDomain;
    import oracle.jbo.domain.DBSequence;
    import oracle.jbo.domain.Number;
    import oracle.jbo.server.ViewObjectImpl;
    public class ImageServlet
      extends HttpServlet
      private static final String CONTENT_TYPE =
        "image/jpg; charset=windows-1252";
      public void init(ServletConfig config)
        throws ServletException
        super.init(config);
      public void doGet(HttpServletRequest request,
                        HttpServletResponse response)
        throws ServletException, IOException
        response.setContentType(CONTENT_TYPE);
        response.setContentType(CONTENT_TYPE);
        String detailProductId = request.getParameter("detail");
        String thumbnailProductId = request.getParameter("thumbnail");
        boolean thumbnail = true;
        String productId = null;
        OutputStream os = response.getOutputStream();
        String amDef = "oracle.fodemo.storefront.store.service.StoreServiceAM";
        String config = "StoreServiceAMLocal";
        ApplicationModule am =
          Configuration.createRootApplicationModule(amDef, config);
        ViewObjectImpl vo =
          (ViewObjectImpl) am.findViewObject("ProductImages"); // get view object (the same as used in the table)
        if (detailProductId != null)
          productId = detailProductId;
          thumbnail = false;
        else
          productId = thumbnailProductId;
        vo.defineNamedWhereClauseParam("paramThumbnail", null, null);
        vo.defineNamedWhereClauseParam("paramProductId", null, null);
        vo.setWhereClause("DEFAULT_VIEW_FLAG = :paramThumbnail AND PRODUCT_ID = :paramProductId");
        vo.setNamedWhereClauseParam("paramThumbnail", (thumbnail? "Y": "N"));
        vo.setNamedWhereClauseParam("paramProductId", productId);
        vo.executeQuery();
        Row product = vo.first();
        BlobDomain image = (BlobDomain) product.getAttribute("Image");
        InputStream is = image.getInputStream();
        // copy blob to output
        byte[] buffer = new byte[10 * 1024];
        int nread;
        while ((nread = is.read(buffer)) != -1)
          os.write(buffer, 0, nread);
        os.close();
        vo.setWhereClause(null);
        vo.removeNamedWhereClauseParam("paramProductId");
        vo.removeNamedWhereClauseParam("paramThumbnail");
        Configuration.releaseRootApplicationModule(am, false);
    }

  • How to display file content in browser using servlet..? urgent!!!

    hello,
    i am building a application for which when a user logs in he will we redirected to page where he will have one link ,with this link a file is associated.
    when user press that link he should be able to see that particular file in internet browser....
    now can anybody give me a code sample of how to display a file in browser....
    please reply me as soon as possible...

    thanks for your reply....
    but i don't want this....
    i want to read a file from disk into stream or buffer and from that again reading and printing in browser.....
    a servlet should be built for this....
    i wrote this but its not working
    ========================================================
    public class FilePrinting extends HttpServlet
         public void doPost(HttpServletRequest req,HttpServletResponse res)
              throws IOException,ServletException
              ServletOutputStream out=res.getOutputStream();
              res.setContentType("text/html");
              String fileURL="/mydomainWebApp/Test.htm";
              res.setHeader("Content-disposition","attachment; filename=" +="Test.htm" );
              BufferedInputStream bis=null;
              BufferedOutputStream bos=null;
              try
                   URL url = new URL( fileURL );
                   bis=new BufferedInputStream(url.openStream());
                   bos = new BufferedOutputStream(out);
                   byte[] buff = new byte[2048];
                   int bytesRead;
                   // Simple read/write loop.
                   while(-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
                   bos.write(buff, 0, bytesRead);
              }catch(final MalformedURLException e)
                   System.out.println ( "MalformedURLException." );
                   throw e;
              }catch(final IOException e)
                   System.out.println ( "IOException." );
                   throw e;
              }finally
                   if (bis != null)
                        bis.close();
                   if (bos != null)
                        bos.close();
    =======================================================================
    please send me sample code if anyone have../...

Maybe you are looking for

  • How to find out if JRE is installed on a Win32 system?

    Hi, does anyone know a good and reliable way to find out if JRE is installed on a Windows system? I want to start a JAR file but don't want to appear the "select program to start with"-chooser box when there's no JRE. Most unexperienced users give up

  • Menu does not display unless I hit play??

    I built a simple DVD. STILL image menu with one button. The MENU is set as "first play" When I test with Simulate- everything is fine. The Menu shows up. The button starts the program. Once I burn and try to play back the disc- My dvd player on mac c

  • Why can't I download Tumblr on my iPod 4 anymore??

    I can't download the app anymore! I had to delete the app from my ipod touch gen. 4 in order to make space for an update, so now I'm trying to get it back. But when I attempt to download it, it says that I need iOS 7 or something like that in order t

  • Call to function from ABAP WebDynpro.

    Hello, I am trying to call  function module from WD ABAP. the function is calling to a sap transaction (IW22) with parameter. My code is: CALL FUNCTION 'ZPM_TEST' EXPORTING    IQM           = '1000000531' The function ZPM_TEST is using '1000000531' a

  • Epson C80 software has left the building-what now?

    After my epson c80 wouldn't print, the printer utility wouldn't even recognize it. I tried reinstalling the software (1.33) from the original disk, and even reinstalled Tiger. But even though the Epson printer files appear to be in the library, when