Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-745

ZHTML Input no longer works with XML value in ZK6

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 5.0.10
    • 6.0.0
    • None
    • None

      I stumbled across this problem trying to submit a HTML form with hidden input fields to PayPal's Website Payments service.
      Here's a small example snippet of what I'm trying to do:

       
      ...
      org.zkoss.zhtml.Form form = new Form();
      form.setDynamicProperty("action", "https://www.sandbox.paypal.com/cgi-bin/webscr");
      form.setDynamicProperty("method", "post");
      form.setDynamicProperty("target", "_self");
      form.setParent(container);
      
      org.zkoss.zhtml.Input input = new Input();
      input.setParent(form);
      input.setDynamicProperty("type", "hidden");
      input.setDynamicProperty("name", "custom1");
      input.setValue("<foo>1</foo><bar>2</bar>");
      
      input = new Input();
      input.setParent(form);
      input.setDynamicProperty("type", "hidden");
      input.setDynamicProperty("name", "custom2");
      input.setValue("1,2");
      ...
      

      Now this is what the resulting form should look like and in fact does render using ZK5 (5.0.7):

       
      ...
      <form id="qZ7Q2" target="_self" method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
      <input id="qZ7Q3" type="hidden" name="custom1" value="<foo>1</foo><bar>2</bar>">
      <input id="qZ7Q4" type="hidden" name="custom2" value="1,2">
      </form>
      ...
      

      But when you switch to ZK6 (6.0.0-RC2) the first input field with its XML tagged value is completely messed up:

       
      ...
      <form id="mRHP2" target="_self" method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
      <input id="mRHP3" mrhp3"="" value="<foo id=">
      1
      <bar>2</bar>
      " type="hidden" name="custom1"/&gt;
      <input id="mRHP4" type="hidden" name="custom2" value="1,2">
      </form>
      ...
      

            Jenkins Jenkins
            andiklein andiklein
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h