Skip to Content
author's profile photo Former Member
Former Member

New window (popup)

I created a JSP page for a SEARCH. once user enter something inthe input field, then it will check in the database and will display the matching information in the same window. But now I need to display the matching information in a different window like a popup.

Is there any way we can do that? Please let me know.

here is the code for the jsp page.

<%@ taglib uri="tagLib" prefix="hbj" %>

<jsp:useBean id="myBean" scope="request" class="com.flightsafety.bsd.bean.ContactSearchBean" />

<hbj:content id="myContext" >

<hbj:page title="Initial Page">

<hbj:form>

<hbj:gridLayout>

<hbj:gridLayoutCell rowIndex="1" columnIndex="1">

<!-- make sure to implement a corresponding event handling -->

<!-- method for the onClick attribute in your JSPDynPage: -->

<!-- public void onInitialButtonClicked(Event event); -->

<table>

<tr>

<td>

<hbj:label

id="lblSearchTerm"

required="FALSE"

text="Enter Subject of Interest"

design="LABEL"

labelFor="inptSearchTerm"

/>

</td>

</tr>

<tr>

<td>

<hbj:inputField

id="inptSearchTerm"

type="string"

maxlength="100"

value=""

/>

<hbj:button id="search"

text="Search"

onClick="onSearchButtonClicked"

/>

</td></tr>

</table>

**********from here I need it in a popup

<p>

<%if(myBean.isSearchResultAvailable())

{

%>

<table>

<%

java.util.Vector searchResult = (java.util.Vector) myBean.getSearchResult();

String title =myBean.getSearchString()"-- Search result ("searchResult.size()+")";

%>

<tr>

<td>

</td>

</tr>

<tr>

<td>

<hbj:textView

id="Title"

text="<%=title%>"

design="EMPHASIZED"

/>

</td>

</tr>

<%

for (int i=0; i<searchResult.size();i++)

{

com.flightsafety.bsd.bean.SearchResultBean bean = (com.flightsafety.bsd.bean.SearchResultBean)searchResult.get(i);

String name=bean.getUserName();

String employeeId="Employee Id: "+bean.getEmployeeId();

String emailAddress="Email Address: "+bean.getEmailAddress();

String phoneNo="Phone No: "+bean.getPhoneNo();

String email_send = "mailto:"+bean.getEmailAddress();

%>

<tr>

<td>

<hbj:textView

id="<%=name%>"

text="<%=name%>"

design="EMPHASIZED"

/>

</td>

</tr>

<tr>

<td>

<a href="<%=email_send%>"

<hbj:textView

id="<%=emailAddress%>"

text="<%=emailAddress%>"

design="STANDARD"

/>

</a>

</td>

</tr>

<tr>

<td>

<hbj:textView

id="<%=phoneNo%>"

text="<%=phoneNo%>"

design="STANDARD"

/>

</td>

</tr>

<%

}

%>

</table>

<%

}

%>

</hbj:gridLayoutCell>

</hbj:gridLayout>

</hbj:form>

</hbj:page>

</hbj:content>

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Feb 09, 2005 at 09:30 AM

    Hi "TT",

    two months ago, in thread /thread/21466 [original link is broken] I wrote "just a general advise for submitting issues: If something does not work, try to minimize your example. No more characters than needed.". This holds. If you give <i>short</i> examples, you will get more attraction and others will find it more interesting to look into it (rather than when they would feel to have reading something like a book).

    Short answer to your question: instead of <i>onClick="onSearchButtonClicked"</i> use <i>onClientClick</i>, and then by JS open a new window calling the component in question with the input field as parameter.

    Hope it helps

    Detlev

    PS: Please consider to reward points. Thanks in advance!

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.