Announcement Announcement Module
Collapse
No announcement yet.
<form:checkbox> no function Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JanHelmut
    started a topic <form:checkbox> no function

    <form:checkbox> no function

    Hello,

    this is my code:

    Code:
    <form:form method="post" commandName="reisekostentransferobject">
    ...
    <tr>
    	<td align="right" width="20%">Buchhaltung:</td>
    	<td width="20%"><form:checkbox path="berechnenBuchhaltung" /></td>
    	<td width="50%"><form:errors path="berechnenBuchhaltung"
    					cssClass="error" /></td>
    </tr>
    ...
    berechnenBuchhaltung is a boolean type variable.

    My problem is everytime I Submit the form the berechnenBuchhaltung variable is true. The checkbox ignore if I check or uncheck it. Every checkbox in my application do this.
    Last edited by JanHelmut; Jan 9th, 2008, 05:13 AM. Reason: to make the headline clearer

  • JanHelmut
    replied
    we fixed it with a dateFormatPropertyEditorRegistrar....

    Leave a comment:


  • Jörg Heinicke
    replied
    I might have overseen it but I did not see anything about the DateFormat object. The lack of thread-safeness is not related to your current problem, but to your next one

    Joerg

    Leave a comment:


  • JanHelmut
    replied
    Originally posted by Jörg Heinicke View Post
    Just as a hint: The shared DateFormat is going to be a problem since it is not thread-safe!

    Joerg

    Yes, I have solved the problem (see the posts before)

    Leave a comment:


  • Jörg Heinicke
    replied
    Originally posted by JanHelmut View Post
    Controller:

    Code:
    public class ReisekostenFormController extends SimpleFormController {
    
    	...
    	private DateFormat dateFormat;
    	...
    }
    Just as a hint: The shared DateFormat is going to be a problem since it is not thread-safe!

    Joerg

    Leave a comment:


  • Marten Deinum
    replied
    You also might want to take a look at the Spring Modules project and especially the XT Module which enables java support in quite an easy way.

    Leave a comment:


  • JanHelmut
    replied
    I use this stuff:

    http://www.jenkov.dk/prizetags/index.html

    it was the only one I found for integrating Ajax in spring in a very simpöe way (look at the jsp code....)

    but for most ajax I use yui

    Leave a comment:


  • Marten Deinum
    replied
    Stripping down to the basics is in a lot of situations quite useful . Which ajax implementation do you use? Or is it something homegrown?

    However glad that you figured it out.

    Leave a comment:


  • JanHelmut
    replied
    at first there is nothing on the url...

    the post thing i coud get out of firebug there is an function to get what the page do post to the server.

    AND

    Thanks for your help it seems to be the ajax stuff which makes the problems

    Leave a comment:


  • Marten Deinum
    replied
    And that is why I think you are mixing GET and POST parameters because POST parameters AREN'T on the url.

    Try removing the ajax capability (just for fun) and see what is happening. Your form in the jsp looks alright.

    Leave a comment:


  • JanHelmut
    replied
    no, I mean that the parameter I was posting to the forum are the right that the site is sending to the server....

    My problem is still if i uncheck a box, the site sends box is checked to the server....

    Leave a comment:


  • Marten Deinum
    replied
    but I think the Post parameter I posted are the right parameter the site is sending. it is the same i can see in my database after I submit the form every checkbox is checked (every field in the Database is 1)
    Then I give up....

    You state checkboxes are ignored but they arrive at the server, so you don't have an issue?!

    Leave a comment:


  • JanHelmut
    replied
    but I think the Post parameter I posted are the right parameter the site is sending. it is the same i can see in my database after I submit the form every checkbox is checked (every field in the Database is 1)

    here is the html code the tag is genarating:

    Code:
    <tr>
    	<td align="right" width="20%"><b><u>Berechnet</u></b></td>
    
    </tr>
      
    <tr>
    	<td align="right" width="20%">Kunde:</td>
    	<td width="20%">
                 <input id="berechnenKunde1" name="berechnenKunde" type="checkbox" value="true" checked="checked"/>
    
                 <input type="hidden" name="_berechnenKunde" value="on"/>
    
            </td>
    	<td width="50%"></td>
    </tr>
    
    <tr>
    
    	<td align="right" width="20%">Buchhaltung:</td>
    
    	<td width="20%">
                   <input id="berechnenBuchhaltung1" name="berechnenBuchhaltung" type="checkbox" value="true" checked="checked"/>
    
                  <input type="hidden" name="_berechnenBuchhaltung" value="on"/>
            </td>
    
            <td width="50%"></td>
    
    </tr>

    Leave a comment:


  • Marten Deinum
    replied
    Yes I know firebug we use it also. But still it is a POST not a GET request to the server, that is what I find strange.

    I strongly suggest you add some debug logging (maybe print the request parameters from your onsubmit to see what is happening.

    Leave a comment:


  • JanHelmut
    replied
    from my firebug (a Firefox extension)... the url is ok...

    with this extension you can get a detaild list of what you send and what you get (parameter, response(html code), post, headers)

    http://www.getfirebug.com/
    Last edited by JanHelmut; Jan 9th, 2008, 07:25 AM.

    Leave a comment:

Working...
X