for the versioning to work properly though you need to remember changes done against your dataprovider because it keeps its own state that needs to be rolled back. attached is the submitlinkpage.java that shows you how to do that.
-Igor
On 9/12/06, Igor Vaynberg <[EMAIL PROTECTED]
> wrote:
yeah i can reproduce it to, the problem is that the submitlink changes the form's value using _javascript_ - and the browser remembers it in its cache! so when you go back that cahnged url is present. ugly, im going to look for a solution.
-IgorOn 9/12/06, Johan Compagner < [EMAIL PROTECTED]> wrote:best thing is to make a bug report and attach the testcase.
Because in the traffic ammount of the mailing list it can be forgotton..
johanOn 9/12/06, Erik Brakkee <[EMAIL PROTECTED]> wrote:Have you seen the test case I posted on the mailing list?
Can you confirm that you see the problem too and that it is indeed a
wicket problem and not a problem with the way I use wicket?
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
package wicket.quickstart; import java.io.Serializable; import java.util.ArrayList; import java.util.Iterator; import java.util.List;
import wicket.extensions.markup.html.repeater.data.DataView; import wicket.extensions.markup.html.repeater.data.IDataProvider; import wicket.extensions.markup.html.repeater.refreshing.Item; import wicket.markup.html.WebPage; import wicket.markup.html.basic.Label; import wicket.markup.html.form.Form; import wicket.markup.html.form.SubmitLink; import wicket.model.IModel; import wicket.model.Model; import wicket.version.undo.Change; public class SubmitLinkPage extends WebPage { private int _counter = 0; public SubmitLinkPage() { System.out.println("New page"); final Form form = new Form("form"); add(form); final LinkProvider provider = new LinkProvider(); DataView view = new DataView("links", provider) { protected void populateItem(Item aItem) { String text = (String) aItem.getModelObject(); SubmitLink link = new SubmitLink("link"); link.setDefaultFormProcessing(false); aItem.add(link); link.add(new Label("text", text)); } }; form.add(view); SubmitLink addLink = new SubmitLink("add") { protected void onSubmit() { System.out.println("Hallo!"); final int index = provider.add("Look ma, a new link! " + _counter++)-1; addStateChange(new Change() { @Override public void undo() { provider.remove(index-1); } }); System.out.println("no. items = " + provider.size()); } }; addLink.setVersioned(true); form.add(addLink); } } class LinkProvider implements IDataProvider { private List<String> _links; public LinkProvider() { _links = new ArrayList<String>(); } public int add(String aLink) { _links.add(aLink); return _links.size(); } public void remove(int index) { _links.remove(index); } public Iterator iterator(int aFirst, int aCount) { Iterator iterator = _links.iterator(); for (int i = 0; i < aFirst; i++) { iterator.next(); } return iterator; } public IModel model(Object aObject) { return new Model((Serializable) aObject); } public int size() { return _links.size(); } }
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user