Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
Subject: Re: re placePushButtonField doesn 't work on fields with the same name?

Subject: Re: re placePushButtonField doesn 't work on fields with the same name?

2007-11-02       - By Mark Storer

 Back
Yep, you found a bug.  Have a look at line 2101 through 2120 here:
http://itext.svn.sourceforge.net/viewvc/itext/trunk/src/com/lowagie/text/pdf
/AcroFields.java?view=markup

You'll see that the function only modifies the first entry in
AcroFields.Item.[merged/widget/values].  To handle your case, it would have
to enumerate each of those arrays.

Suggestion: Write up a patched version that can replace some or all fields
with the same name, and submit it.  Something like:

/***DANGER: CODE WRITTEN IN EMAIL EDITOR AHEAD***/
public boolean replacePushbuttonField(String field, PdfFormField button) {
 return replacePushButtonField( field, button, 0 ); // maintain old
behavior
}
// new version, containing most of the old function
public boolean replacePushbuttonField(String field, PdfFormField button, int
replaceIndex) {
if (replaceIndex == -1) {
/*change them all*/
} else {
/* change the specified button */
}
}

 Mark Storer
 Senior Software Engineer
 Cardiff.com
#include <disclaimer>
typedef std::Disclaimer<Cardiff> DisCard;


On 11/2/07, iy <iyeh@(protected)> wrote:
>
>
> I have a PDF with two submit buttons with the same field name.  I am using
> AcroField replacePushButtonField() to set the submit URL at run time.  But
> it seems to replace the first submit button only.   Is this a bug? how do
> I
> get around that?  I tried renaming one of the submit button to a different
> name, but it seems the method renames all fields of the same name, so that
> doesn't help.  The two buttons are on the same page.
> --
> View this message in context: http://www.nabble.com/replaceP
> ushButtonField-doesn%27t-work-on-fields-with-the-same-name--
> tf4737381.html#a13547490
> Sent from the iText - General mailing list archive at Nabble.com.
>
>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> __ ____ ____ ____ ____ ____ ____ ____ ____ ____
> iText-questions mailing list
> iText-questions@(protected)
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/
>



--
--Mark Storer
Professional Geek

<font style="font-family: courier new,monospace;" size="2">Yep, you found a bug
.&nbsp; Have a look at line 2101 through 2120 here:&nbsp; <a href="http://itext
.svn.sourceforge.net/viewvc/itext/trunk/src/com/lowagie/text/pdf/AcroFields.java
?view=markup">
http://itext.svn.sourceforge.net/viewvc/itext/trunk/src/com/lowagie/text/pdf
/AcroFields.java?view=markup</a><br><br>You&#39;ll see that the function only
modifies the first entry in AcroFields.Item.[merged/widget/values].&nbsp; To
handle your case, it would have to enumerate each of those arrays.
<br><br>Suggestion: Write up a patched version that can replace some or all
fields with the same name, and submit it.&nbsp; Something like:<br><br>/**
*DANGER: CODE WRITTEN IN EMAIL EDITOR AHEAD***/<br></font><font size="2"><span
style="font-family: courier new,monospace;" class="kwa">
public</span><span style="font-family: courier new,monospace;"> </span><span
style="font-family: courier new,monospace;" class="kwb">boolean</span><span
style="font-family: courier new,monospace;"> </span><span style="font-family:
courier new,monospace;" class="kwd">
replacePushbuttonField</span><span style="font-family: courier new,monospace;"
class="sym">(</span><span style="font-family: courier new,monospace;" class=
"kwc">String</span><span style="font-family: courier new,monospace;">
field</span><span style="font-family: courier new,monospace;" class="sym">,<
/span><span style="font-family: courier new,monospace;"> PdfFormField button<
/span><span style="font-family: courier new,monospace;" class="sym">
) {<br></span><span style="font-family: courier new,monospace;">&nbsp; return
replacePushButtonField( field, button, 0 ); // maintain old behavior</span><br
style="font-family: courier new,monospace;"><span style="font-family: courier
new,monospace;">
}</span><br style="font-family: courier new,monospace;"><span style="font
-family: courier new,monospace;">// new version, containing most of the old
function</span><br style="font-family: courier new,monospace;"><span style=
"font-family: courier new,monospace;" class="kwa">
public</span><span style="font-family: courier new,monospace;"> </span><span
style="font-family: courier new,monospace;" class="kwb">boolean</span><span
style="font-family: courier new,monospace;"> </span><span style="font-family:
courier new,monospace;" class="kwd">
replacePushbuttonField</span><span style="font-family: courier new,monospace;"
class="sym">(</span><span style="font-family: courier new,monospace;" class=
"kwc">String</span><span style="font-family: courier new,monospace;">
field</span><span style="font-family: courier new,monospace;" class="sym">,<
/span><span style="font-family: courier new,monospace;"> PdfFormField button,
int replaceIndex) {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;if (replaceIndex == -1)
{</span><br style="font-family: courier new,monospace;"><span style="font
-family: courier new,monospace;">&nbsp;/*change them all*/</span><br style="font
-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;} else {</span><br
style="font-family: courier new,monospace;"><span style="font-family: courier
new,monospace;">&nbsp;/* change the specified button */</span><br style="font
-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;}</span><br style="font
-family: courier new,monospace;"><span style="font-family: courier new,monospace
;" class="sym"></span><span style="font-family: courier new,monospace;">
}</span><br style="font-family: courier new,monospace;"></font><pre style="font
-family: courier new,monospace;"><font size="2">  Mark Storer <br>  Senior
Software Engineer <br>  <a href="http://Cardiff.com">Cardiff.com</a>
<br>#include &lt;disclaimer&gt; <br>typedef std::Disclaimer&lt;Cardiff&gt;
DisCard; <br></font></pre><font style="font-family: courier new,monospace;"
size="2"><br></font><div style="font-family: courier new,monospace;"><font size
="2">
<span class="gmail_quote">On 11/2/07, <b class="gmail_sendername">iy</b> &lt;<a
href="mailto:iyeh@(protected)">iyeh@(protected)</a>&gt; wrote:</span></font>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204)
; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<font size="2"><br>I have a PDF with two submit buttons with the same field
name.&nbsp;&nbsp;I am using<br>AcroField replacePushButtonField() to set the
submit URL at run time.&nbsp;&nbsp;But<br>it seems to replace the first submit
button only.&nbsp;&nbsp; Is this a bug? how do I
<br>get around that?&nbsp;&nbsp;I tried renaming one of the submit button to a
different<br>name, but it seems the method renames all fields of the same name,
so that<br>doesn&#39;t help.&nbsp;&nbsp;The two buttons are on the same page.
<br>--
<br>View this message in context: <a href="http://www.nabble.com/replaceP">http
://www.nabble.com/replaceP</a></font><font size="2">ushButtonField-doesn%27t
-work</font><font size="2">-on-fields-with-the-same-name-</font><font size="2">
-tf4737381.html#a13547490<br>Sent from the iText - General mailing list archive
at <a href="http://Nabble.com">Nabble.com</a>.<br><br><br>-- ---- ---- ---- ---
-- ------</font><font size="2">-- ---- ---- ---- ---- ---- --</font>
<font size="2">-- ---- -----<br>This SF.net email is sponsored by: Splunk Inc.
<br>Still grepping through log files to find problems?&nbsp;&nbsp;Stop.<br>Now
Search log events and configuration files using AJAX and a browser.<br>Download
your FREE copy of Splunk now &gt;&gt;
<a href="http://get.splunk.com/">http://get.splunk.com/</a><br>__ ____ ____ ___
__ ____ ______</font><font size="2">__ ____ ____ ____<br>iText-questions mailing
list<br><a href="mailto:iText-questions@(protected)">iText-questions@(protected)
.sourcefo
</a></font><font size="2"><a href="http://rge.net">rge.net</a><br><a href=
"https://lists.sourceforge.net">https://lists.sourceforge.net</a></font><font
size="2">/lists/listinfo/itext-question</font><font size="2">s<br>Buy the iText
book:
<a href="http://itext.ugent.be/itext-in">http://itext.ugent.be/itext-in</a><
/font><font size="2">-action/<br></font></blockquote></div><font style="font
-family: courier new,monospace;" size="2"><br><br clear="all"><br>--
<br>--Mark Storer<br>Professional Geek
</font>

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

©2008 junlu.com - Jax Systems, LLC, U.S.A.