I found a workaround. It seems tapestry is not linking the checkbox
event with the hidden field in this case

     addPositionFragment:hidden

This value of this hidden field is used on the server side to determine
if binding of the fragment fields should happen. If I manually add a
onchange event on the checkbox that toggles the value of the above
field, it starts to work

         <t:checkbox t:id="addPosition" t:mixins="triggerfragment"
onclick="document.getElementById('addPositionFragment:hidden').value=tru
e"
fragment="addPositionFragment"/>

Is this a bug or by design? 
       

-----Original Message-----
From: Zheng, Xiahong 
Sent: Thursday, March 27, 2008 2:24 PM
To: Tapestry users
Subject: RE: [T5] FormFragment doesn't work on IE6

I am not sure why it is not working for me. Here is my simple test page,

NewPosition.tml

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>

<body>

<form t:type="Form" t:id="addForm">
        <t:checkbox t:id="addPosition" t:mixins="triggerfragment"
fragment="addPositionFragment"/>
        <t:label for="addPosition">Add Position ?</t:label>
        <t:formfragment t:id="addPositionFragment"
visible="addPosition">
                <table>
                <tr>
                        <td class="unlined">
                                Symbol
                        </td>
                        <td class="unlined">
                                Shares
                        </td>   
                        <td class="unlined">
                                Price
                        </td>                                           
                </tr>
                <tr>
                        <td class="unlined">
                                <t:TextField
value="newPosition.symbol"/>
                        </td>
                        <td class="unlined">
                                <t:TextField
value="newPosition.shares"/>
                        </td>   
                        <td class="unlined">
                                <t:TextField
value="newPosition.purchasePrice"/>
                        </td>                                           
                </tr>
        </table>        
        <p/>
        <t:submit value="Save"/>
        </t:formfragment>
</form>

</body>

</html> 

And my page class

NewPosition.java

public class NewPosition {
        
        private Position newPosition = new Position();
        
    private boolean addPosition;
        
        public String onSubmit() {
                if (newPosition.getSymbol() != null) {
                        // do something
                }
                
                return "Start";
        }

        public Position getNewPosition() {
                return newPosition;
        }

        public void setNewPosition(Position newPosition) {
                this.newPosition = newPosition;
        }

        public boolean isAddPosition() {
                return addPosition;
        }

        public void setAddPosition(boolean addPosition) {
                this.addPosition = addPosition;
        }

}

And the position class

public class Position {
        
        private String symbol;
        private String shares;
        private String purchasePrice;

        public String getSymbol() {
                return symbol;
        }

        public void setSymbol(String symbol) {
                this.symbol = symbol;
        }

        public String getShares() {
                return shares;
        }
        public void setShares(String shares) {
                this.shares = shares;
        }
        public String getPurchasePrice() {
                return purchasePrice;
        }
        public void setPurchasePrice(String prices) {
                this.purchasePrice = prices;
        }
}

In the onSubmit method, the newPosition instance is always blank. I
tried setting break point in the setter methods of the Position classes
and they don't get invoked.

-----Original Message-----
From: Adam Zimowski [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 27, 2008 1:39 PM
To: Tapestry users
Subject: Re: [T5] FormFragment doesn't work on IE6

That could be by design. If your fragment is hidden values won't be
submitted. If it's shown, they should be submitted and I never had
this problem as they do submit correctly for me. I tested it with all
kinds of browsers and it works well aside from issue with javascript
slide down I mentioned earlier.

On Thu, Mar 27, 2008 at 12:28 PM, Zheng, Xiahong <[EMAIL PROTECTED]>
wrote:
> I am seeing another problem; On submit from the fragment, I don't get
>  any input values bound to the fragment fields. Has anybody seen it?
>
>
>
>  -----Original Message-----
>  From: Adam Zimowski [mailto:[EMAIL PROTECTED]
>  Sent: Thursday, March 27, 2008 1:01 PM
>  To: Tapestry users
>  Subject: Re: [T5] FormFragment doesn't work on IE6
>
>  I think there is an issue, although it works partially. If you click
>  on the checkbox it doesn't slide the fragment down. However, a
>  subsequent click anywhere on the page will slide it down causing the
>  process and checkbox to be out of sync. I implemented my own toggle
>  functionality so it wasn't that major of an issue for me, but that is
>  something that probably has to get fixed for IE6.
>
>  On Thu, Mar 27, 2008 at 11:31 AM, Zheng, Xiahong
<[EMAIL PROTECTED]>
>  wrote:
>  > Anybody tested formfragment/mixin on IE6? I could not get the
fragment
>  >  to show on IE6. It does work on firefox however. Is this a known
>  issue
>  >  or am I missing something?
>  >
>  >
---------------------------------------------------------------------
>  >  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  >  For additional commands, e-mail: [EMAIL PROTECTED]
>  >
>  >
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to