You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Frederic Dernbach <fr...@free.fr> on 2003/10/16 15:57:06 UTC

Calling a javascript function with the tag

How can I call a javascript function with one parameter using a
<logic:iterate> tag (the parameter being different from row to row).

Below is a simple JSP snipplet which uses an iteration. Its first
item prints a "code" property with an hyperlink with a "onclick"
attribute that points to a javascript function with ONE parameter
(closeWindowWithOK).

As you can see, I would like to pass the "code" property to the
javascript function when the link is clicked on. 

How can I do this ? How should I write the "onclick" attribute of the
<html:link> tag ? Obviously waht I write is wrong since I do not get the
expected result. 

Thanks in advance for your help.

Fred

<script type="text/javascript">

	function closeWindowWithCode(myparameter)
	{
		opener.updateWith(myparameter);
		window.close();
	}
</script>

<table width="650" border="0" cellspacing="0" cellpadding="0">
<tr align="left">
	<th>Code</th>
</tr>
<logic:iterate 	name="searchSignalForm"
		property="signals"
		id="signal" 
		type="com.rubis.web.system.bean.SignalBean">		
					
<tr align="left">
<td>
	<html:link
		href=''
		onclick='closeWindowWithCode(<bean:write name="signal"
property="code"/>)' >
		<bean:write name="signal" property="code"/>
	</html:link>
</td>
</tr>					
</logic:iterate>									
</table>





---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


TILES - jsp pages hierarchy structure

Posted by Todor Sergueev Petkov <t....@basalmed.uio.no>.
Hello everymody, yet another question...

To help users navigate in my web-site ( using tiles ) I would like to 
indicate in each page where in the page "hierarchy" the user is. Example:
current page is : home->search->advanced search.

Since I am already using TILES I wander if Tiles stores already
the full page hierarchy and if there is a way to access it from
a jsp page.
If that is not so how do you people go about implementing such kind
of functionality?

Thanks a lot,
	Todor


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: EVALUATION of TEST FRAMEWORKS

Posted by Mick Wever <mi...@machina.no>.
On Wed, 22 Oct 2003 09:07:46 +0200, Todor Sergueev Petkov wrote:
> Is there any
> other framework that you people use? 


Here's some instructions on how to setup XTest for your Java project.

http://xtest.netbeans.org/XTest4Java.html

 XTest is an opensource automated testing framework used for testing Java
 products through JUnit, HttpUnit (and hopefully soon Cactus) type tests,
 and publishing the results into html pages. It integrates testing from
 multiple platforms, products, product versions, and test types, to
 provide upto date comprehensive statistical information about the status
 of your java code.

I've been using this at 'De norske Bokklubbene' where, along with
different junit test types (unit, httpUnit, cactus), and platforms, tests
are also grouped (by using the department attribute) into 'Weekly Build',
'Nightly Build', and 'CVS-user' builds corresponding to each cvs commit
per user (using cvsroot/loginfo). This makes the production environment
very resistant to regression because regressions can quickly be traced to
the exact cvs commit and user through the published results of XTest.

The document is still beta, so feedback would be appreciated.

Mick.



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: EVALUATION of TEST FRAMEWORKS

Posted by Benz Lim <be...@bizwave.net>.
There are two tools from mercury

AstraLoadTest
AstraQuickTest

You can give it a test.

Best Regards,
Benz Lim

-----Original Message-----
From: Todor Sergueev Petkov [mailto:t.s.petkov@basalmed.uio.no]
Sent: Wednesday, October 22, 2003 3:08 PM
To: Struts Users Mailing List
Subject: EVALUATION of TEST FRAMEWORKS


I have to choose a testing framework for my webapp( written using
Struts. I am currently reviewing documentation on CACTUS - especially
StrutsTestCase and on the other hand HTTPUnit. Is that what people use
to test medium size web-applications.
Can someone with experience point out some advantages and disadvantages
of using one or the other. Is there any other framework that you people use?
Thanks a lot,
	Todor


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


EVALUATION of TEST FRAMEWORKS

Posted by Todor Sergueev Petkov <t....@basalmed.uio.no>.
I have to choose a testing framework for my webapp( written using 
Struts. I am currently reviewing documentation on CACTUS - especially 
StrutsTestCase and on the other hand HTTPUnit. Is that what people use 
to test medium size web-applications.
Can someone with experience point out some advantages and disadvantages 
of using one or the other. Is there any other framework that you people use?
Thanks a lot,
	Todor


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Calling a javascript function with the tag

Posted by Mark Lowe <ma...@talk21.com>.
If you dont need the link then using html:link would be a waste of 
time..

so..

<a href="javascript: closeWindowWithCode('<bean:write name="signal" 
property="code" >')">

or

<a href="#" onlclick="closeWindowWithCode('<bean:write name="signal" 
property="code" >')">

or

<a href="#" onclick="closeWindowWithCode('<c:out 
value="${signal.code}"/>')">

Cheers Mark





On Thursday, October 16, 2003, at 02:57 PM, Frederic Dernbach wrote:

> How can I call a javascript function with one parameter using a
> <logic:iterate> tag (the parameter being different from row to row).
>
> Below is a simple JSP snipplet which uses an iteration. Its first
> item prints a "code" property with an hyperlink with a "onclick"
> attribute that points to a javascript function with ONE parameter
> (closeWindowWithOK).
>
> As you can see, I would like to pass the "code" property to the
> javascript function when the link is clicked on.
>
> How can I do this ? How should I write the "onclick" attribute of the
> <html:link> tag ? Obviously waht I write is wrong since I do not get 
> the
> expected result.
>
> Thanks in advance for your help.
>
> Fred
>
> <script type="text/javascript">
>
> 	function closeWindowWithCode(myparameter)
> 	{
> 		opener.updateWith(myparameter);
> 		window.close();
> 	}
> </script>
>
> <table width="650" border="0" cellspacing="0" cellpadding="0">
> <tr align="left">
> 	<th>Code</th>
> </tr>
> <logic:iterate 	name="searchSignalForm"
> 		property="signals"
> 		id="signal"
> 		type="com.rubis.web.system.bean.SignalBean">		
> 					
> <tr align="left">
> <td>
> 	<html:link
> 		href=''
> 		onclick='closeWindowWithCode(<bean:write name="signal"
> property="code"/>)' >
> 		<bean:write name="signal" property="code"/>
> 	</html:link>
> </td>
> </tr>					
> </logic:iterate>									
> </table>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org