struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Varun Garg" <varun_g...@yahoo.com>
Subject RE: taglibs - nonstatic javascript value
Date Tue, 03 Jun 2003 18:59:10 GMT
The only way I have done that is using straight java <%=%>.

You can definitely do that.

Also, the reason your <%= was not working was that the objects that you
were trying to reference were not declared on you page, but they are
stored in pageContext and cannot be accessed directly.

For using <%= you have define the objects in the scope they will be
used.



-----Original Message-----
From: Alawadhi, Mona [mailto:malawadhi@kpmg.com] 
Sent: Tuesday, June 03, 2003 12:45 PM
To: 'Struts Users Mailing List'
Subject: RE: taglibs - nonstatic javascript value


If I decided to pass a dynamic value using javascript in struts tag
libs, it's not doable, right? regardless of using another taglib or not.

-----Original Message-----
From: Varun Garg [mailto:varun_garg@yahoo.com]
Sent: Tuesday, June 03, 2003 1:26 PM
To: 'Struts Users Mailing List'
Subject: RE: taglibs - nonstatic javascript value


I did not say it is impossible, the thing is that you are trying to use
tag inside tag and that is causing some problems, I am just suggesting a
quick solutions.

Also, when you start getting into custom javascript, you are not really
following struts at that point. 





-----Original Message-----
From: Alawadhi, Mona [mailto:malawadhi@kpmg.com] 
Sent: Tuesday, June 03, 2003 12:21 PM
To: 'Struts Users Mailing List'
Subject: RE: taglibs - nonstatic javascript value


Yes, thank you.
So, this means that it is impossible to do it with struts taglibs?

-----Original Message-----
From: Varun Garg [mailto:varun_garg@yahoo.com]
Sent: Tuesday, June 03, 2003 1:18 PM
To: 'Struts Users Mailing List'
Subject: RE: taglibs - nonstatic javascript value


I changes it to use <a> rather than <html:link> and removed the extra ".

You can use the property or not depending on your requirement.



-----Original Message-----
From: Alawadhi, Mona [mailto:malawadhi@kpmg.com] 
Sent: Tuesday, June 03, 2003 12:15 PM
To: 'Struts Users Mailing List'
Subject: RE: taglibs - nonstatic javascript value


eliminating "property" doesn't do it!

-----Original Message-----
From: Varun Garg [mailto:varun_garg@yahoo.com]
Sent: Tuesday, June 03, 2003 12:35 PM
To: 'Struts Users Mailing List'
Subject: RE: taglibs - nonstatic javascript value


Try this, this should work.
	<logic:iterate name="addressListFormBean" id="choice"
property="letterOptions">
       	<a  href="javascript:setHiddenLetter('<bean:write
name="choice" />'); document.forms[0].submit(); ">
       		<bean:write name="choice" property="labelStr"/>
       	</a>
       </logic:iterate>

-----Original Message-----
From: Alawadhi, Mona [mailto:malawadhi@kpmg.com] 
Sent: Tuesday, June 03, 2003 11:23 AM
To: 'Struts Users Mailing List'
Subject: RE: taglibs - nonstatic javascript value


Varun,

I've tried to put that in, but it still doesn't work:

it cuts it when it comes to those double quotes, so, my href would be =
"javascript:setHiddenLetter('". So, it doesn't like those quotes.

I've tried removing them and putting them in single quotes, I'm back to
that same problem. It reads the whole thing as one string.

Please advice!

Mona

-----Original Message-----
From: Varun Garg [mailto:varun_garg@yahoo.com]
Sent: Tuesday, June 03, 2003 12:06 PM
To: 'Struts Users Mailing List'
Subject: RE: taglibs - nonstatic javascript value


I would just put a bean:write instead on the D.


	<logic:iterate name="addressListFormBean" id="choice"
property="letterOptions">
       	<html:link  href="javascript:setHiddenLetter('"<bean:write
name="choice" property="labelStr"/>"'); document.forms[0].submit(); ">
       		<bean:write name="choice" property="labelStr"/>
       	</html:link>
       </logic:iterate>
-----Original Message-----
From: Alawadhi, Mona [mailto:malawadhi@kpmg.com] 
Sent: Tuesday, June 03, 2003 10:50 AM
To: 'Struts Users Mailing List'
Subject: taglibs - nonstatic javascript value




yes, it worked.

I have one problem, though: passing dynamic value to the function I call
in javascript.

This is what I have:
	<logic:iterate name="addressListFormBean" id="choice"
property="letterOptions">
       	<html:link  href="javascript:setHiddenLetter('D');
document.forms[0].submit(); ">
       		<bean:write name="choice" property="labelStr"/>
       	</html:link>
       </logic:iterate>

I would like to replace that 'D' with something like <%=choice%>, for
the user to be able to select the letter (there are letter A through Z,
and 'letter' is a hidden field).

How can I do that?

Mona 

-----Original Message-----
From: Lynn Guy [mailto:lguy01@yahoo.com]
Sent: Monday, June 02, 2003 4:35 PM
To: Struts Users Mailing List
Subject: RE: first time action


put them in an html form tag
then in your link do something like
onclick=this.submit()
<script>
function doInsert() {
         document.forms[0].submit();
}
</script>

  <html:form action="assetWorksheet.do" method="post"
>
    <a href="javascript:doInsert()">        
      <html:img srcKey="image.button.createIncome"</a>
   </html:form>

I think the name property for the html:form tag is no
longer valid so forms[0] refers to the first form on
my page.

In your case you can probably use the html:link tag
and put the javascript call in the onclick property.

hth


************************************************************************
*****
The information in this email is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
email by anyone else is unauthorized. 

If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on
it, is prohibited and may be unlawful. When addressed to our clients any
opinions or advice contained in this email are subject to the terms and
conditions expressed in
the governing KPMG client engagement letter.         
************************************************************************
*****


---------------------------------------------------------------------
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


************************************************************************
*****
The information in this email is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
email by anyone else is unauthorized. 

If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on
it, is prohibited and may be unlawful. When addressed to our clients any
opinions or advice contained in this email are subject to the terms and
conditions expressed in
the governing KPMG client engagement letter.         
************************************************************************
*****


---------------------------------------------------------------------
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


************************************************************************
*****
The information in this email is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
email by anyone else is unauthorized. 

If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on
it, is prohibited and may be unlawful. When addressed to our clients any
opinions or advice contained in this email are subject to the terms and
conditions expressed in
the governing KPMG client engagement letter.         
************************************************************************
*****


---------------------------------------------------------------------
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


************************************************************************
*****
The information in this email is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
email by anyone else is unauthorized. 

If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on
it, is prohibited and may be unlawful. When addressed to our clients any
opinions or advice contained in this email are subject to the terms and
conditions expressed in
the governing KPMG client engagement letter.         
************************************************************************
*****


---------------------------------------------------------------------
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


************************************************************************
*****
The information in this email is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
email by anyone else is unauthorized. 

If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on
it, is prohibited and may be unlawful. When addressed to our clients any
opinions or advice contained in this email are subject to the terms and
conditions expressed in
the governing KPMG client engagement letter.         
************************************************************************
*****


---------------------------------------------------------------------
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


Mime
View raw message