Results 1 to 9 of 9

Thread: Dynamic select and show results

  1. #1
    Join Date
    Feb 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Dynamic select and show results

    Hi,

    i would want implement on my site a similar script of this: click

    I have a page with a list of books divided for language (english,italian,dutch and spanish). I want create a dynamic list for choise the desired language and show the result in the same page.

    Can you help me ?

    Thanks !

  2. #2
    Join Date
    Feb 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    up.........

  3. #3
    Join Date
    Dec 2007
    Location
    Ankara, Turkey
    Posts
    160
    Thanks
    2
    Thanked 2 Times in 2 Posts

    Default

    You may do that with an AJAX call where the server filters the book list OR you can keep the list as a Javascript array then filter and show the list.

  4. #4
    Join Date
    May 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    can you please tell how to do this using ajax as i am new to ajax and i also have such requirement in my project. i am using ajax+struts

  5. #5
    Join Date
    Dec 2007
    Location
    Ankara, Turkey
    Posts
    160
    Thanks
    2
    Thanked 2 Times in 2 Posts

    Default

    What do you use for AJAX?

  6. #6
    Join Date
    May 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hi!!
    i have a jsp page where on click on a button a new window gets opened up which contains data retieved from the database. also there is a text box on top with label where if user enters any character then corresponding to that character the data should get filtered in that table.
    eg:
    there is a button on index.jsp. click on this button results in the pop up of the child window where a table gets created containing the data retrieved from the database. also there is a text box on top where now if user enters any character data in the table gets filtered corresponding to that character(s)
    eg:

    <input type="text" name="text">(text box on the child window)
    |------------------|
    S.No. CityName
    1 Delhi
    2. Mumbai
    3. Jaipur
    5. Jodhpur
    6. kolkata
    (all these values are stored in the database and retrieved in a query) now my requirement is that if user enters J then all the cities starting with J should get displayed on the same page. I am using ajax for this but i need a javascript solution for doing this.

    output should be:
    S.No. CityName
    3. Jaipur
    4. Jodhpur

    i am using ajax and struts.i want to know how can the data retrieved from the action class be displayed. please help me solve this problem.thanks in advance

  7. #7
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    I think you are looking for mixing AJAX and auto-suggest feature together for your purpose. As already mentioned you have to use AJAX for retrieving the state names in run-time from server. In order to work with AJAX you need to write code in a cross-browser compatible manner. You can use any freely available JS framework that makes AJAX operations simple for a beginner
    http://developer.yahoo.com/yui/connection/

    For the auto suggest part you can have some freely available JavaScript for that purpose. Have a look at the following link which shows some examples for auto suggest/auto complete functionality.
    http://developer.yahoo.com/yui/autocomplete/

    If you are looking for some AJAX tutorial please mention that here.

  8. #8
    Join Date
    May 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the prompt response. let me put some details regarding what i am looking and how am i thinking of doing it. let me know if it is by any chance possible or not.

    i have a jsp page where each field has a button associated with it. on click to that button a child window opens up and it shows a dynamic table which consists data fetched from the database based on the name of the field(textbox).

    flow of my project is:
    jsp->struts(action class)->ejb(bean class)->action class-> result(jsp page)
    i want to integrate ajax with it.

    now what i wish to do is apply the filter property on the child window.
    when the user enters any text then onkeypress a fuction retrieveURL() gets called from where action class is being called.

    the problems i am facing are:
    1. on executing the action claas i not getting recognized. the error it shows is invalid action path.
    2. my 2nd problem is how will i post the data which i retained in a 2d array corresponding to the text entered by the user on the jsp.

    please help me solve this problem
    thanks

  9. #9
    Join Date
    May 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the prompt response. let me put some details regarding what i am looking and how am i thinking of doing it. let me know if it is by any chance possible or not.

    i have a jsp page where each field has a button associated with it. on click to that button a child window opens up and it shows a dynamic table which consists data fetched from the database based on the name of the field(textbox).

    flow of my project is:
    jsp->struts(action class)->ejb(bean class)->action class-> result(jsp page)
    i want to integrate ajax with it.

    now what i wish to do is apply the filter property on the child window.
    when the user enters any text then onkeypress a fuction retrieveURL() gets called from where action class is being called.

    the problems i am facing are:
    1. on executing the action claas i not getting recognized. the error it shows is invalid action path.
    2. my 2nd problem is how will i post the data which i retained in a 2d array corresponding to the text entered by the user on the jsp.

    please help me solve this problem
    thanks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •