Bugs item #668290, was opened at 2003-01-15 03:52
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=104754&aid=668290&group_id=4754

Category: Tapestry
Group: bug
Status: Open
Resolution: None
Priority: 5
Submitted By: daniel manzau (danielmanzau)
Assigned to: Howard Lewis Ship (hship)
Summary: javascript updated submit button value ignored

Initial Comment:
Hi Guys,

I have a situation where I want to be able to change the 
submit button value using javascript on the page. 

I can do this fine however the renderComponent method 
of the Submit class throws away the value that it 
retrieves from the requestContext and passes through 
the original value that is stored in it's _tag member. 


The problem is easily solved by the following code 
changes to the renderComponent method of 
net.sf.tapestry.form.Submit.java

    protected void renderComponent(IMarkupWriter writer, 
IRequestCycle cycle)
        throws RequestCycleException
    {

...

            String value = cycle.getRequestContext
().getParameter(_name);

            // If the value isn't there, then this button wasn't
            // selected.

            if (value == null)
                return;

            if (_selectedBinding != null)
// This code ignores the actual value of the button when 
//it is submitted and presumes that it will not change
//              _selectedBinding.setObject(_tag);

//Suggested fix - pass through the new button value.
//rather than the original tag value
               _selectedBinding.setObject(value);


            if (_listener != null)
                _listener.actionTriggered(this, cycle);

            return;
        }

   ...
}

If I can make any of this clearer please let me know.

Cheers,
Daniel

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=104754&aid=668290&group_id=4754


-------------------------------------------------------
This SF.NET email is sponsored by: Take your first step towards giving 
your online business a competitive advantage. Test-drive a Thawte SSL 
certificate - our easy online guide will show you how. Click here to get 
started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to