I'd file JIRA for this. On Fri, Mar 28, 2008 at 3:14 PM, Zheng, Xiahong <[EMAIL PROTECTED]> wrote: > I had a look at the tapestry.js. The following function is used to > connect the checkbox with the fragment. > > // Links a FormFragment to a checkbox, such that changing the > checkbox will hide > // or show the FormFragment. Care should be taken to render the page > with the > // checkbox and the FormFragment('s visibility) in agreement. > > linkCheckboxToFormFragment : function(checkbox, element) > { > checkbox = $(checkbox); > > checkbox.observe("change", function() > { > $(element).formFragment.setVisible(checkbox.checked); > }); > }, > > I am not familiar with javascript function. But it seems to me that the > checkbox onchange event only toggles the visibility of the fragment. > There should be another line that toggels the hidden field value as > well. > > > -----Original Message----- > From: Adam Zimowski [mailto:[EMAIL PROTECTED] > > > Sent: Thursday, March 27, 2008 4:10 PM > To: Tapestry users > Subject: Re: [T5] FormFragment doesn't work on IE6 > > I recently posted e-mail to this list on this exact same topic. Here > is that post: > > Per documentation, FormFragment decides if its content should be > submitted based on the hidden field [formfragmentname]:hidden: > > // this is the relevant code from FormFragment source: void > beginRender(..) > writer.element("input", > > "type", "hidden", > > "name", _controlName, > > "id", _clientId + ":hidden", > > "value", String.valueOf(_visible)); > writer.end(); > > > However, that field being generated at render time is fairly static, > which defeats the very purpose of dynamic behavior provided by > Tapestry.ElementEffect sidedown/slideup functions. The problem is that > when the silide function is invoked on the client (triggered by click > on the checkbox), that inherently means that FormFragment should be > submitted, but it won't be if the hidden field was generated with > false value. > > The solution to this problem should be Tapestry dynamically changing > hidden field's value to true/false based on the client side state of > the checkbox tied to the FormFragment. For those who need a > workaround, I can share mine. In onclick of submit button one can > execute the following function: > > function setupFragment(fragment, checkbox) { > var checked = document.getElementById(checkbox).value; > var advanced = (checked == 'on'); > document.getElementById(fragment + ':hidden').value=advanced; > } > > > <input t:id="submitButton" > onclick="setupFragment('advancedFragment','advancedCheckbox');" > type="submit" t:type="submit" value="Submit"/> > > I believe this should be one of those "plumbing" tasks that Tapestry > should do for us. Should this be a JIRA improvement, or am I missing > something? > > -adam > Reply > > Forward > > > Howard Lewis Ship > The code is already in place to set the hidden field to the correct > value whe... > > Howard's Reply was: > > "The code is already in place to set the hidden field to the correct > value when the form is submitted." > > In fact, that code is already present in deepVisible stuff inside > tapestry.js > > -adam > > > > > On Thu, Mar 27, 2008 at 3:02 PM, Zheng, Xiahong <[EMAIL PROTECTED]> > wrote: > > 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] > > > > > > --------------------------------------------------------------------- > 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]