cancel
Showing results for 
Search instead for 
Did you mean: 

New window (popup)

Former Member
0 Kudos

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>

Accepted Solutions (0)

Answers (1)

Answers (1)

detlev_beutner
Active Contributor
0 Kudos

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!