How to display a dynamic combobox?

We had a requirement to display a combobox that is filled with some values on the Web page when someone checks the box that is located on the Web page.

The approach we have taken is ajax. How we did it, it's when someone checks the check box on the Web page we begin the ajax call asking for a servlet. This servlet extracts data from the database, place the data in the request and forwards the request to a jsp page. In this jsp I am writing simple html combobox and filling of the values in the ComboBox of the query using JSTL and this jsp will be sent in response to the ajax call. Ajax Gets the HTML as a response that contains a combobox control and I just place HTML (complete response) in a div which is next to the check box.

In this approach, there are a lot of pain. If I have to post 10 html dynamically components under certain conditions so I have 10 jsp for each component. I always feel that there is a wrong way of doing things. What is the best approach to deal with the dynamic controls on Web pages.

Your problem here is the mix of data with the presentation. Your ajax calls should not return HTML. They must return data only as XML or JSON (JSON is almost always preferable).
Conditionally display layout is then easily achievable using javascript as javascript can parse JSON or XML.

Tags: Java

Similar Questions

  • How to display values dynamically in poplist

    Hello
    I have a poplist which currently has 4 values. I need to display these values dynamically according to some other employee say field id. I wrote a query that retrieves these 4 values but now how display the poplist based on a flag?
    If the indicator is none, it should display on the other 1 value display all.
    can someone help me?

    You did not mention if you need your dynamic poplists in one table (multiple instances per page) or you will need in a standard format (occurrence is one per page).

    If a table and query must be the same for all lines or not?

    in any case the above solution works in the case of a poplist on a standard form, or if all the rows in the table need to show values in drop-down list.

    If this isn't the case, you must use dependent on Poplist.

    To activate the average Action allow PPR on the flag (change of outbreak of bean).

  • How to display dynamic columns, published by vo.addDynamicAttribute in jspx?

    Hello

    I met the problem when add cloumn programmatically and display it on the screen. Here are my steps:

    1 put implement Application Module, add an init() method and expose it to the customer.
    2. in the init() method, get VO target and use vo.addDynamicAttribute ("Addition3"). Then it iterate using row.setAttribute ("Addition3", Math.random ()). Add init() for liaison page and invoke it. (it is invoked)
    3 al ' jspx, use #{row.bindings.Addition3.inputValue}

    Error occurs when eval expression EL in step 3.
    javax.el.PropertyNotFoundException: unattainable target, "Addition3" returns null.

    Addition3 is not defined in XML, but dynamically. I guess that's important.

    Anyone know how to view on jspx?

    The new attribute is not in the definition of the page. You must use a technique where people called "dynamic table".

    http://deepakcs.blogspot.com/2012/06/display-ADF-dynamic-table-based-on.html

  • How to convert a dynamic disk to a basic?

    How to convert a dynamic disk to a basic? I can't really deleat the C and readers of the system, and if so, how?

    Hi Brad,

    Welcome to Microsoft Community and thank you for the query display.

    According to the description, it seems that you want to convert a dynamic disk to Basic.

    However, we need more information about the issue to help you better.

    Please help me to answer these questions.

    1 how many partitions are on the hard drive?

    2 is installed Windows on drive C?

    3. you have any operating system installed on the hard drive?

    To convert the dynamic disk to basic, here are some steps that you can try.

    You can try to convert the dynamic disk drive basis (except your drive C :) using the Diskpart.exe in the command line. By following these steps, you can avoid reinstalling Windows XP. But if you want all the hard disk as a single partition, then proceed as follows.

    Note: Before formatting the hard drive or perform the steps, back up your data to an external storage device.

    Steps to convert dynamic disk to basic

    a. press Windows key + r on the keyboard and in the immediate window, type cmd.exe

    b. in the command prompt and type D iskpart .

    c. at the Diskpart prompt, type list disk . Note the number of the disk you want to convert to dynamic.

    d. at the Diskpart prompt, type select disk . (select the dynamic disk you want to convert.)

    e. at the Diskpart prompt, type clean to remove all volumes on the disk.

    (f) then, at the Diskpart prompt, type: convert base to begin to restore the disk to basic training.

    Respond us if you have any queries with hard drive problems and we will be happy to help you.

  • How to find the dynamic inside the af acomponent ID: foreach?

    Hi friends,

    Jdev: 11.1.1.7

    I have a requirement like I need a list of books available as links. So I posted using af: foreach and inside I used af:goLink.

    I need to display the ToolTip on mouseover this link. To display the ToolTip, I used the popup. How to find the dynamic ID inside the af: foreach in java.

    If I bind the comonent, it does not work inside foreach.

    Try this way, root.findComponent("r1:it2"); it is in taskflow. On popufetchlistener you call a method to get the id of the component to get the book desc.

    Thank you

    Hello

    You can probably assign a customer attribute for elements and then using that you could get the values?

    Check out https://docs.oracle.com/cd/E21764_01/apirefs.1111/e12419/tagdoc/af_clientAttribute.html and http://jdevadf.oracle.com/adf-richclient-demo/faces/components/clientAttribute.jspx

    Arun-

  • How to display the logo in reports 10G?

    Dear members,

    I want to display a dynamic logo of path of the server (the newspaper was placed in bin custom albums) in the Oracle reports.

    If I pass Org1 logo1 first must show, if I pass org2 and second logo2 should display.

    How can I achieve this?

    Thanks in advance.

    Kind regards

    Durga

    Hello 1283172

    Please follow the following steps.
    1-

    Select St_id, St_name  from student;
    

    2-
    Save the Images in a folder with the same name as St_Id
    3-
    Put a column formula report & go to his property
    a Datatype - character
    b - read the file - Yes
    c - file Format - Image

    function CF_1Formula return Char is
    
    begin
    
    Return ('C:\'||:St_id||'.jpg');
    
    end;
    

    Hope this helps

    Hamid

  • SharedObject AS3 displaying not dynamic text

    Hello:
    I use AS3 on the timeline. I'm trying to figure out how to save text input using dynamic text boxes.
    I have two input boxes (box1 and box2) where user types and last name. Two dynamic text (box3 and Box 4) that will save the user name and last name boxes.

    PROBLEM:

    I can draw full name, but not able to display the dynamic text and save the text in the entry fields.

    Please help me to fix my code.


    Here is my code:

    var so: SharedObject = SharedObject.getLocal ("sampleCode");


    Box1.text = so.data.firstName;
    Box2.text = so. Data.LastName;

    If (!) YOU Data.FirstName)
    {
    Box1.text = Box3.Text;
    Box2.text = box4. Text;
    }

    saveBtn.addEventListener (MouseEvent.CLICK, saveData);

    function saveData(evt:MouseEvent)

    {
    Switch (evt.currentTarget.Name)
    {
    case 'saveBtn ':
    {

    so.data.firstName = box3.text;
    so.data.lastName = box4.text;
    so. Flush();
    break;
    }

    trace (SO. Data.FirstName);
    trace (SO. Data.LastName);

    Thank you;

    German

    If your trace() functions reveal you're setting if properly, but you're not well, use of recovery:

    var so: SharedObject = SharedObject.getLocal("sampleCode","/");

  • How to display coordintes xy drag and drop the movie

    can someone tell me how drag to display the coordinates of the Red cirle shown in the tutorial - déposer found here:
    http://www.flashvalley.com/fv_tutorials/advanced_drag_and_drop_in_Flash/
    I did this tutorial very well but do not know how to display its x and y coordinatetes in a dynamic text box as I move the red circle around the screen.
    Thank you for any assistance you can give.
    Steve

    Thank you for your help. Your solution is exactly what I needed.
    :)

  • Does anyone know how to display along with the app on the Mac App Store in the Sierra of MacOS?

    Does anyone know how to display along with the app on the Mac App Store in the Sierra of MacOS?

    I've just updated to Sierra. Since the upgrade did several reboots. When I discover an app the side also shows "4 +" or similar and I click on the note to view reviews and ratings of customer, a blank screen appears. Everyone knows this or have a way to solve this problem?

    I see even here in Seattle, so I think the question is about the end of Apple.

    By the end of 2012 Mac minis, macOS?  Watch 38 mm silver AL, watchOS 3; iPad 2 Air & iPhone 6 + iOS 10.0.1;  Apple Airport Express

  • How to display date / time in the browser console?

    How to display date / time in the browser console?

    You can set through the Options (gear icon) page in the Web Console (Firefox/tools > Web Developer).
    This applies to the browser console and the Web console.

  • How to display the width of the page or the big screen in firefox 11 automatically?

    How to display the width of the page or the big screen in firefox 11 automatically? I know how to Ctrl +, ctrl - and ctrl 0, but is there a way to define 11 firefox to automatically set the page viewing by default "page width" or full screen (F11 not)?
    Help, please. Thank you.

    You can use an extension to set a page zoom and the size of the default font on the web pages.

  • How to display bookmarks as default to the bottom of the left side of the page in Internet Explorer

    How to display bookmarks as default to the bottom of the left side of the page in Internet Explorer

     opens the Bookmarks sidebar or you can use View > Sidebar - Bookmarks to open it. It will stay open until you close it, and if you close Firefox when it is open, it should appear the next time you open Firefox.
    
  • FCP 7 How to display several takes both

    I'm running FCP 7 on a Macbook Pro with OS 10.10. Trying to figure out how to display several takes of the video on my calendar running at the same time. Mounting a show of live music from four cameras simultaneously turned and want to choose between shots while seeing the four outlets. Is this possible?

    Multiclip editing:

    https://documentation.Apple.com/en/FinalCutPro/UserManual/index.html#chapter=42% 26section = 12% 26tasks = true

    MtD

  • How to display scrollbars on Type Def

    Dear programmers,

    Question:

    Does anyone know how to display scroll bars in a window of Type Def after that both have been disabled?

    Background:

    I have a several projects where the scroll bars do not appear on some Type definitions. It is possible that they may have been disabled by other programmers in the past. This prevent me to see big bouquets stored inside and I have to physically move the entire cluster which takes a long time. I can't find a way to reactivate them (assuming both have been disabled).

    You can reproduce my problem if you start with a new Type def...

    Disable the two scroll bars...

    After that the scroll bars disappeared, how do I return? Using the control properties > appearance window will not allow the user to customize the scroll bars, and is no longer a right click menu available because you have to click with the right button on the bar itself scrolling.

    For those who work for the glory, I can provide the !

    It's funny, I couldn't find a simple way to do it either!

    You can try this code snippet. Please backup your control before you run it. Just browse the constant path to the location of your command, then run.

  • How to display on my screen 2 different applications at the same time?

    How to display on my screen 2 different applications at the same time?

    Hello

    The best place to ask would be the forums for answers corresponding to your version of Windows.

    Answers - Windows Forums
    http://answers.Microsoft.com/en-us/Windows

    =====================

    If you have Windows 7 with Aero - click with the right button on the taskbar at the bottom of the screen and click on 'show windows '.
    Side by Side.

    For all versions of Windows:

    You could also reduce less than full screen using the small box to the left of the red X at the top right
    and then resizing windows as you want.

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

Maybe you are looking for