Re: [announce] Wicket 1.5-rc2 is released!
Martin Grigorov-4 wrote: The Wicket Team is proud to introduce the second Release Candidate in Wicket 1.5 series. It includes bug fixes and improvements reported against 1.5-RC1. See the changelog for full list. More detailed migration notes are available on our [Migrate to 1.5 Wiki Page](https://cwiki.apache.org/WICKET/migration-to-wicket-15.html) Release Artifacts: * Subversion tag: http://svn.apache.org/repos/asf/wicket/releases/wicket-1.5-rc2 * Changelog: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561version=12316059 * To use in Maven: dependency groupIdorg.apache.wicket/groupId artifactIdwicket-core/artifactId version1.5-rc2/version /dependency * Download the full distribution: http://www.apache.org/dyn/closer.cgi/wicket/1.5-rc2 (including source) The Wicket Team! Hi I downloaded the full distribution, but it seems that the wicket-1.5-rc1.jar jar in lib missing. I think it might be a good idea to maybe add it I'm not big on compiling from source so I would appreciate it if we can get a link to download the jar... Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/announce-Wicket-1-5-rc2-is-released-tp3324596p3327689.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [announce] Wicket 1.5-rc2 is released!
Hi fstof, maybe you meant wicket-core-1.5-rc2.jar and not wicket-1.5-rc1.jar. In full distribution still missing wicket core jar. Hi I downloaded the full distribution, but it seems that the wicket-1.5-rc1.jar jar in lib missing. I think it might be a good idea to maybe add it I'm not big on compiling from source so I would appreciate it if we can get a link to download the jar... Thanks - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [announce] Wicket 1.5-rc2 is released!
Andrea Del Bene-2 wrote: Hi fstof, maybe you meant wicket-core-1.5-rc2.jar and not wicket-1.5-rc1.jar. In full distribution still missing wicket core jar. O crap... stupid typo... I copied from my rc1 lib folder... I ment rc2. either way there is no wicket-core-1.5-rc2.jar (or wicket-1.5-rc2.jar for that matter) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/announce-Wicket-1-5-rc2-is-released-tp3324596p3327724.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [announce] Wicket 1.5-rc2 is released!
As a workaround you can download the missing core jar from the maven repo: http://repo1.maven.org/maven2/org/apache/wicket/wicket-core/1.5-rc2/ http://repo1.maven.org/maven2/org/apache/wicket/wicket-core/1.5-rc2/There is no wicket.jar because it was sliced up into 3 smaller one: core (missing from the distribution), request and util. Attila 2011/2/28 fstof frans.stofb...@gmail.com Andrea Del Bene-2 wrote: Hi fstof, maybe you meant wicket-core-1.5-rc2.jar and not wicket-1.5-rc1.jar. In full distribution still missing wicket core jar. O crap... stupid typo... I copied from my rc1 lib folder... I ment rc2. either way there is no wicket-core-1.5-rc2.jar (or wicket-1.5-rc2.jar for that matter) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/announce-Wicket-1-5-rc2-is-released-tp3324596p3327724.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [announce] Wicket 1.5-rc2 is released!
Attila Király wrote: As a workaround you can download the missing core jar from the maven repo: http://repo1.maven.org/maven2/org/apache/wicket/wicket-core/1.5-rc2/ Awesome, Thanks Attila Király wrote: http://repo1.maven.org/maven2/org/apache/wicket/wicket-core/1.5-rc2/There is no wicket.jar because it was sliced up into 3 smaller one: core (missing from the distribution), request and util. Attila Yes I figured as much. Thanks a lot for the info... Frans -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/announce-Wicket-1-5-rc2-is-released-tp3324596p3327757.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Getting Javascript function return value in Wicket
Does anyone have any simple and clear examples as to how to call a javascript function within Wicket AND to then retrieve the output of the function? I see a few people trying to do the same thing but cannot find and clear examples. Any help is truly appreciated! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-Javascript-function-return-value-in-Wicket-tp3327794p3327794.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Getting Javascript function return value in Wicket
Maybe this wiki entry is helpful: Generate a JS within Wicket: https://cwiki.apache.org/WICKET/adding-javascript-from-wicket.html the other way round: https://cwiki.apache.org/WICKET/calling-wicket-from-javascript.html HTH Am 28.02.2011 um 12:34 schrieb drf: Does anyone have any simple and clear examples as to how to call a javascript function within Wicket AND to then retrieve the output of the function? I see a few people trying to do the same thing but cannot find and clear examples. Any help is truly appreciated! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-Javascript-function-return-value-in-Wicket-tp3327794p3327794.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [announce] Wicket 1.5-rc2 is released!
I think wicket team decided to not distribute aggregate jar (that is wicket-1.5-rc2.jar.) no more. There was a thread about it on dev mailing list. Subject was [discuss] How to resolve wicket aggregate classes / sources jar issues Andrea Del Bene-2 wrote: Hi fstof, maybe you meant wicket-core-1.5-rc2.jar and not wicket-1.5-rc1.jar. In full distribution still missing wicket core jar. O crap... stupid typo... I copied from my rc1 lib folder... I ment rc2. either way there is no wicket-core-1.5-rc2.jar (or wicket-1.5-rc2.jar for that matter) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Preventing session creation on abort?
I've got a case where I want to abort request processing and redirect before my session is constructed (since it's fairly expensive). I can trigger the abort and redirect via my RequestCycle.onBeginRequest() impl by throwing a RedirectToUrlException. However, the abort processing in RequestCycle invokes getSession(): // wicket-2013: create a new session if invalidated if (getSession().isSessionInvalidated()) which of course triggers session creation if it doesn't already exist. This is 1.4.14. It appears 2013 added this check so that the session would no longer be available in the current thread - but it seems at a pretty high side-effect cost. I could add some thread local error flag to deal with this case but that's pretty ugly. Is there some better way to stop session creation in this scenario? Thanks - Tom Palmer Director, Strategic Technology Services ATT Hosting Application Services | 2000 Perimeter Park Drive, Suite 140 | Morrisville, NC 27560 Office: +1 (919) 388-5937 | Mobile: +1 (919) 627-5431 thomas.pal...@att.com mailto:thomas.pal...@att.com Confidentiality Notice and Disclaimer: This e-mail transmission may contain confidential and/or proprietary information of ATT that is intended only for the individual or entity named in the e-mail address. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or reliance upon the contents of this e-mail is strictly prohibited. If you have received this e-mail transmission in error, please reply to the sender, so that ATT can arrange for proper delivery, and then please delete the message from your inbox. Thank you.
Re: Preventing session creation on abort?
Hi Tom, Please file a ticket. On Mon, Feb 28, 2011 at 1:50 PM, PALMER, THOMAS C (ATTCORP) tp3...@att.comwrote: I've got a case where I want to abort request processing and redirect before my session is constructed (since it's fairly expensive). I can trigger the abort and redirect via my RequestCycle.onBeginRequest() impl by throwing a RedirectToUrlException. However, the abort processing in RequestCycle invokes getSession(): // wicket-2013: create a new session if invalidated if (getSession().isSessionInvalidated()) which of course triggers session creation if it doesn't already exist. This is 1.4.14. It appears 2013 added this check so that the session would no longer be available in the current thread - but it seems at a pretty high side-effect cost. I could add some thread local error flag to deal with this case but that's pretty ugly. Is there some better way to stop session creation in this scenario? Thanks - Tom Palmer Director, Strategic Technology Services ATT Hosting Application Services | 2000 Perimeter Park Drive, Suite 140 | Morrisville, NC 27560 Office: +1 (919) 388-5937 | Mobile: +1 (919) 627-5431 thomas.pal...@att.com mailto:thomas.pal...@att.com Confidentiality Notice and Disclaimer: This e-mail transmission may contain confidential and/or proprietary information of ATT that is intended only for the individual or entity named in the e-mail address. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or reliance upon the contents of this e-mail is strictly prohibited. If you have received this e-mail transmission in error, please reply to the sender, so that ATT can arrange for proper delivery, and then please delete the message from your inbox. Thank you.
Re: Getting Javascript function return value in Wicket
Thanks, but what we are looking for is a fully working example of how to call a javascript function and retrieve the return value on the Java side. The examples provided are not full or clear to any of us. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-Javascript-function-return-value-in-Wicket-tp3327794p3327906.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Getting Javascript function return value in Wicket
See http://code.google.com/p/londonwicket/downloads/list LondonWicket-Paint On Mon, Feb 28, 2011 at 3:24 PM, drf davidrfi...@gmail.com wrote: Thanks, but what we are looking for is a fully working example of how to call a javascript function and retrieve the return value on the Java side. The examples provided are not full or clear to any of us. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-Javascript-function-return-value-in-Wicket-tp3327794p3327906.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Getting Javascript function return value in Wicket
Looked at the pdf - but there is no documentation or text and cannot see how the code addresses the problem of how to retrieve the return value from a javascript function within Wicket. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-Javascript-function-return-value-in-Wicket-tp3327794p3327979.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Getting Javascript function return value in Wicket
Look at the .zip, there is code inside. The javascript sends events to java with the current position of the mouse. On Mon, Feb 28, 2011 at 4:19 PM, drf davidrfi...@gmail.com wrote: Looked at the pdf - but there is no documentation or text and cannot see how the code addresses the problem of how to retrieve the return value from a javascript function within Wicket. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-Javascript-function-return-value-in-Wicket-tp3327794p3327979.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket philosophy, modelObject isVisible, isEnabled, CSS
Most of the backing modelObject and models are normally associated with the data that is to be displayed or edited. Isn't the CSS and visibility one aspect that is part of the display? What are your thoughts on controlling the visibility, enabled state and CSS through the model objects as opposed at the component? Where do you draw the line between how the component should work and how the data should manipulate the component? public class DataWithCSS { public String getValue() { return value; } public String getCSS() { return css } } For example, let's say you have a text box that has two backing objects: Label label = new LabelDataWithCSS(new DataWithCSS(Hello World, style-red)) { onComponentTag() { tag.put(class, this.getCSS()) } } ... I know we can add functionality that will pull the data value and CSS or visbility or other attributes from the model and model objects, I was just curious if the wicket developers intended for some aspects to be more controlled at the component level.
Re: Perfomance of IDataProvider
You can simply use something like this in your realization of DataProvider: @Override public IModelEntity model(Entity entity) { return new ModelEntity(entity); } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Perfomance-of-IDataProvider-tp3325777p3328194.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Perfomance of IDataProvider
Typically, the LDM that's used to obtain each row in your result set is only called one time, you shouldn't be re-querying individually for each item in the list. LDM's constructor that takes a value will cache that value for the duration of the current request cycle. On Mon, Feb 28, 2011 at 11:09 AM, vov vov...@mail.ru wrote: You can simply use something like this in your realization of DataProvider: @Override public IModelEntity model(Entity entity) { return new ModelEntity(entity); } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Perfomance-of-IDataProvider-tp3325777p3328194.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to prevent user from double-clicking a non-Ajax component
How do we prevent the user from double-clicking a non-Ajax component? When the submit occurs, isEnabled is set to false for the Wicket Button. If the user does a quick double click on the button, its throws a wicket runtime excpetion saying the component is disabled. Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-user-from-double-clicking-a-non-Ajax-component-tp3328308p3328308.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Displaying table in a modalDialog
Hi there, I am trying to use a list view in a modal dialog. But all the time the modal dialog shows everything else except what is inside the table/table tags Here is the panel that am setting as the modal dialog content. Panel.html wicket:panel form wicket:id=frmProject div id=content div style=margin: 2px 0pt 10px; div style=float: right;1 selected of 13/div input type=checkbox wicket:id=selector/ Select/Deselect All /div div wicket:id=projectUsers span wicket:id=lbTest/span table class=grid_list_table thead tr th style=width: 10px;input type=checkbox/th thFirst Nameimg src=img/desc.png class=sort/th thLast Name/th th style=width: 50%;/th /tr /thead tbody tr class=odd wicket:id=checkList tdinput type=checkbox checked=checked wicket:id=checkbox/td td wicket:id=lbFirstNameBob/td td wicket:id=lbLastNameSmith/td td/td /tr /tbody /table /div /div /form /wicket:panel Here is the Java class package com.printgate.webportal.panels; import java.util.List; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Check; import org.apache.wicket.markup.html.form.CheckGroup; import org.apache.wicket.markup.html.form.CheckGroupSelector; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; import org.apache.wicket.markup.html.panel.Panel; import org.apache.wicket.model.CompoundPropertyModel; import org.apache.wicket.model.LoadableDetachableModel; import com.google.inject.Inject; import com.printgate.webportal.dao.ProjectDao; import com.printgate.webportal.dao.UserDao; import com.printgate.webportal.entities.Project; import com.printgate.webportal.entities.User; import java.util.ArrayList; public class ModifyUsersPanel extends Panel { /** * */ private static final long serialVersionUID = 1L; private FormModifyUsersPanel frmProject; private ListViewUser lstUsers; private CheckGroupUser chbUsers; @Inject private ProjectDao projectDao; @Inject private UserDao userDao; private ListUser projectUsers = new ArrayListUser(); public ModifyUsersPanel(String id, final Project project) { super(id); projectUsers = userDao.getAllUsers(); frmProject = new FormModifyUsersPanel(frmProject, new CompoundPropertyModelModifyUsersPanel(ModifyUsersPanel.this)); frmProject.setOutputMarkupId(true); chbUsers = new CheckGroupUser(projectUsers); chbUsers.add(new AjaxFormChoiceComponentUpdatingBehavior() { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { projectDao.updateProject(project); } }); lstUsers = new ListViewUser(checkList, new LoadableDetachableModelListUser() { private static final long serialVersionUID = 1L; @Override protected ListUser load() { return userDao.getAllUsers(); } }) { /** * */ private static final long serialVersionUID = 1L; @Override protected void populateItem(ListItemUser item) { item.add(new CheckUser(checkbox, item.getModel())); item.add(new Label(lbFirstName, item.getModelObject().getFirstname())); item.add(new Label(lbLastName, item.getModelObject().getLastname())); } }; lstUsers.setReuseItems(true); chbUsers.add(lstUsers); frmProject.add(chbUsers); frmProject.add(new CheckGroupSelector(selector, chbUsers)); chbUsers.add(new Label(lbTest, This tests the presence of the form after the table)); add(frmProject); } public ListUser getProjectUsers() { return projectUsers; } public void setProjectUsers(ListUser projectUsers) { this.projectUsers = projectUsers; } } Any help will be appreciated. Josh.
Wizard (updating model)
Greetings, I'm a newbie trying to use the wizard from the extensions package to search and update a user in a database. My first step has a single RequiredTextField where the userid is entered. When the user clicks the next button I search the database and update the User object and display the second step with the users info. This works good. However, if I click the back button and enter a different userid then click next again the second step still diplays the results from the first search. The second step doesn't seem to recognize the the model has changed. I've verified that the User object (the model) does get updated with all the new info for the searched userid. I'm updating the User object in a method which is called in the overriden applyState() method, is this the correct place to update a model? Any help would be appreciated. Parts of the code. public class NewUserWizard extends Wizard { private final class UserSearchStep extends WizardStep { private static final long serialVersionUID = 1L; public UserSearchStep() { super(); add(new RequiredTextFieldString(userid, new PropertyModelString(user, userid))); } @Override public void applyState() { super.applyState(); NewUserWizardHelper.userSearch(user.getUserid, user); // --- I've verified that the user (User object) is being updated in the method. //NewUserWizard.this.setUser(user); -- this doesn't work either. //modelChanged(); } } private final class UserInfoStep extends WizardStep { private static final long serialVersionUID = 1L; private RequiredTextField surname; public UserInfoStep() { super(); //surname = new RequiredTextField(surname); surname = new RequiredTextField(surname, new PropertyModelUser(user, surname) ); add(surname); } } private User user; public NewUserWizard(String id) { super(id); // create a blank user user = new User(); setDefaultModel(new CompoundPropertyModelUser(user)); //setDefaultModel(new CompoundPropertyModelNewUserWizard(this)); WizardModel model = new WizardModel(); model.add(new UserSearchStep()); model.add(new UpdateInfoStep()); // initialize the wizard with the wizard model we just built init(model); } public User getUser() { return user; } public void setUser(User user) { this.user = user; } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Preventing session creation on abort?
Done: https://issues.apache.org/jira/browse/WICKET-3487 Thanks - -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Monday, February 28, 2011 7:52 AM To: users@wicket.apache.org Subject: Re: Preventing session creation on abort? Hi Tom, Please file a ticket. On Mon, Feb 28, 2011 at 1:50 PM, PALMER, THOMAS C (ATTCORP) tp3...@att.comwrote: I've got a case where I want to abort request processing and redirect before my session is constructed (since it's fairly expensive). I can trigger the abort and redirect via my RequestCycle.onBeginRequest() impl by throwing a RedirectToUrlException. However, the abort processing in RequestCycle invokes getSession(): // wicket-2013: create a new session if invalidated if (getSession().isSessionInvalidated()) which of course triggers session creation if it doesn't already exist. This is 1.4.14. It appears 2013 added this check so that the session would no longer be available in the current thread - but it seems at a pretty high side-effect cost. I could add some thread local error flag to deal with this case but that's pretty ugly. Is there some better way to stop session creation in this scenario? Thanks - Tom Palmer Director, Strategic Technology Services ATT Hosting Application Services | 2000 Perimeter Park Drive, Suite 140 | Morrisville, NC 27560 Office: +1 (919) 388-5937 | Mobile: +1 (919) 627-5431 thomas.pal...@att.com mailto:thomas.pal...@att.com Confidentiality Notice and Disclaimer: This e-mail transmission may contain confidential and/or proprietary information of ATT that is intended only for the individual or entity named in the e-mail address. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or reliance upon the contents of this e-mail is strictly prohibited. If you have received this e-mail transmission in error, please reply to the sender, so that ATT can arrange for proper delivery, and then please delete the message from your inbox. Thank you.
Re: internationalizing page title
You will need the following in your application's init: getMarkupSettings().setStripWicketTags(true); Regards, Erik. Op 27-02-11 18:26, Josh Kamau schreef: Anton, This worked. head meta http-equiv=Content-Type content=text/html; charset=UTF-8 wicket:head titleWicket Demo/title /wicket:head /head regards Josh. On Sun, Feb 27, 2011 at 7:13 PM, Anton Bessonovexe...@googlemail.comwrote: Hello Josh, have you found any solution? Best regards, Anton Am trying to internationalize the page title. The below snipplet doesnt seem to work. Where am i going wrong? head meta http-equiv=Content-Type content=text/html; charset=UTF-8 wicket:head titlewicket:message key=login-page-title//title /wicket:head /head regards Josh -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wizard (updating model)
Hi Bob, call Form#modelChanged in applyState to indicate the change. On Mon, Feb 28, 2011 at 2:32 PM, Bob Peterson gp...@yahoo.com wrote: Greetings, I'm a newbie trying to use the wizard from the extensions package to search and update a user in a database. My first step has a single RequiredTextField where the userid is entered. When the user clicks the next button I search the database and update the User object and display the second step with the users info. This works good. However, if I click the back button and enter a different userid then click next again the second step still diplays the results from the first search. The second step doesn't seem to recognize the the model has changed. I've verified that the User object (the model) does get updated with all the new info for the searched userid. I'm updating the User object in a method which is called in the overriden applyState() method, is this the correct place to update a model? Any help would be appreciated. Parts of the code. public class NewUserWizard extends Wizard { private final class UserSearchStep extends WizardStep { private static final long serialVersionUID = 1L; public UserSearchStep() { super(); add(new RequiredTextFieldString(userid, new PropertyModelString(user, userid))); } @Override public void applyState() { super.applyState(); NewUserWizardHelper.userSearch(user.getUserid, user); // --- I've verified that the user (User object) is being updated in the method. //NewUserWizard.this.setUser(user); -- this doesn't work either. //modelChanged(); } } private final class UserInfoStep extends WizardStep { private static final long serialVersionUID = 1L; private RequiredTextField surname; public UserInfoStep() { super(); //surname = new RequiredTextField(surname); surname = new RequiredTextField(surname, new PropertyModelUser(user, surname) ); add(surname); } } private User user; public NewUserWizard(String id) { super(id); // create a blank user user = new User(); setDefaultModel(new CompoundPropertyModelUser(user)); //setDefaultModel(new CompoundPropertyModelNewUserWizard(this)); WizardModel model = new WizardModel(); model.add(new UserSearchStep()); model.add(new UpdateInfoStep()); // initialize the wizard with the wizard model we just built init(model); } public User getUser() { return user; } public void setUser(User user) { this.user = user; } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos
Re: Wizard (updating model)
Hi Pedro, thank you for your reply. In the applyState() of the first step (UserSearchStep) i added the following. However, my second step still displays the user info from the first search, am i correctly getting the form? Form f = (Form)UserSearchStep.this.findParent(Form.class); f.modelChanged(); i've also tryed Form f = NewUserWizard.this.getForm(); f.modelChanged(); - Original Message From: Bob Peterson gp...@yahoo.com To: users@wicket.apache.org Sent: Mon, February 28, 2011 7:32:08 PM Subject: Wizard (updating model) Greetings, I'm a newbie trying to use the wizard from the extensions package to search and update a user in a database. My first step has a single RequiredTextField where the userid is entered. When the user clicks the next button I search the database and update the User object and display the second step with the users info. This works good. However, if I click the back button and enter a different userid then click next again the second step still diplays the results from the first search. The second step doesn't seem to recognize the the model has changed. I've verified that the User object (the model) does get updated with all the new info for the searched userid. I'm updating the User object in a method which is called in the overriden applyState() method, is this the correct place to update a model? Any help would be appreciated. Parts of the code. public class NewUserWizard extends Wizard { private final class UserSearchStep extends WizardStep { private static final long serialVersionUID = 1L; public UserSearchStep() { super(); add(new RequiredTextFieldString(userid, new PropertyModelString(user, userid))); } @Override public void applyState() { super.applyState(); NewUserWizardHelper.userSearch(user.getUserid, user); // --- I've verified that the user (User object) is being updated in the method. //NewUserWizard.this.setUser(user); -- this doesn't work either. //modelChanged(); } } private final class UserInfoStep extends WizardStep { private static final long serialVersionUID = 1L; private RequiredTextField surname; public UserInfoStep() { super(); //surname = new RequiredTextField(surname); surname = new RequiredTextField(surname, new PropertyModelUser(user, surname) ); add(surname); } } private User user; public NewUserWizard(String id) { super(id); // create a blank user user = new User(); setDefaultModel(new CompoundPropertyModelUser(user)); //setDefaultModel(new CompoundPropertyModelNewUserWizard(this)); WizardModel model = new WizardModel(); model.add(new UserSearchStep()); model.add(new UpdateInfoStep()); // initialize the wizard with the wizard model we just built init(model); } public User getUser() { return user; } public void setUser(User user) { this.user = user; } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Displaying table in a modalDialog
Has anyone else experienced this problem? Or do i need to create a quickstart? Josh. On Mon, Feb 28, 2011 at 8:19 PM, Josh Kamau joshnet2...@gmail.com wrote: Hi there, I am trying to use a list view in a modal dialog. But all the time the modal dialog shows everything else except what is inside the table/table tags Here is the panel that am setting as the modal dialog content. Panel.html wicket:panel form wicket:id=frmProject div id=content div style=margin: 2px 0pt 10px; div style=float: right;1 selected of 13/div input type=checkbox wicket:id=selector/ Select/Deselect All /div div wicket:id=projectUsers span wicket:id=lbTest/span table class=grid_list_table thead tr th style=width: 10px;input type=checkbox/th thFirst Nameimg src=img/desc.png class=sort/th thLast Name/th th style=width: 50%;/th /tr /thead tbody tr class=odd wicket:id=checkList tdinput type=checkbox checked=checked wicket:id=checkbox/td td wicket:id=lbFirstNameBob/td td wicket:id=lbLastNameSmith/td td/td /tr /tbody /table /div /div /form /wicket:panel Here is the Java class package com.printgate.webportal.panels; import java.util.List; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Check; import org.apache.wicket.markup.html.form.CheckGroup; import org.apache.wicket.markup.html.form.CheckGroupSelector; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; import org.apache.wicket.markup.html.panel.Panel; import org.apache.wicket.model.CompoundPropertyModel; import org.apache.wicket.model.LoadableDetachableModel; import com.google.inject.Inject; import com.printgate.webportal.dao.ProjectDao; import com.printgate.webportal.dao.UserDao; import com.printgate.webportal.entities.Project; import com.printgate.webportal.entities.User; import java.util.ArrayList; public class ModifyUsersPanel extends Panel { /** * */ private static final long serialVersionUID = 1L; private FormModifyUsersPanel frmProject; private ListViewUser lstUsers; private CheckGroupUser chbUsers; @Inject private ProjectDao projectDao; @Inject private UserDao userDao; private ListUser projectUsers = new ArrayListUser(); public ModifyUsersPanel(String id, final Project project) { super(id); projectUsers = userDao.getAllUsers(); frmProject = new FormModifyUsersPanel(frmProject, new CompoundPropertyModelModifyUsersPanel(ModifyUsersPanel.this)); frmProject.setOutputMarkupId(true); chbUsers = new CheckGroupUser(projectUsers); chbUsers.add(new AjaxFormChoiceComponentUpdatingBehavior() { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { projectDao.updateProject(project); } }); lstUsers = new ListViewUser(checkList, new LoadableDetachableModelListUser() { private static final long serialVersionUID = 1L; @Override protected ListUser load() { return userDao.getAllUsers(); } }) { /** * */ private static final long serialVersionUID = 1L; @Override protected void populateItem(ListItemUser item) { item.add(new CheckUser(checkbox, item.getModel())); item.add(new Label(lbFirstName, item.getModelObject().getFirstname())); item.add(new Label(lbLastName, item.getModelObject().getLastname())); } }; lstUsers.setReuseItems(true); chbUsers.add(lstUsers); frmProject.add(chbUsers); frmProject.add(new CheckGroupSelector(selector, chbUsers)); chbUsers.add(new Label(lbTest, This tests the presence of the form after the table)); add(frmProject); } public ListUser getProjectUsers() { return projectUsers; } public void setProjectUsers(ListUser projectUsers) {
Re: Wizard (updating model)
I just noticed that you have the user at 2 places: inside the model and in an instance variable. Set the searched user on those 2 places, or only use the model to keep the user object. On Mon, Feb 28, 2011 at 4:23 PM, Bob Peterson gp...@yahoo.com wrote: Hi Pedro, thank you for your reply. In the applyState() of the first step (UserSearchStep) i added the following. However, my second step still displays the user info from the first search, am i correctly getting the form? Form f = (Form)UserSearchStep.this.findParent(Form.class); f.modelChanged(); i've also tryed Form f = NewUserWizard.this.getForm(); f.modelChanged(); - Original Message From: Bob Peterson gp...@yahoo.com To: users@wicket.apache.org Sent: Mon, February 28, 2011 7:32:08 PM Subject: Wizard (updating model) Greetings, I'm a newbie trying to use the wizard from the extensions package to search and update a user in a database. My first step has a single RequiredTextField where the userid is entered. When the user clicks the next button I search the database and update the User object and display the second step with the users info. This works good. However, if I click the back button and enter a different userid then click next again the second step still diplays the results from the first search. The second step doesn't seem to recognize the the model has changed. I've verified that the User object (the model) does get updated with all the new info for the searched userid. I'm updating the User object in a method which is called in the overriden applyState() method, is this the correct place to update a model? Any help would be appreciated. Parts of the code. public class NewUserWizard extends Wizard { private final class UserSearchStep extends WizardStep { private static final long serialVersionUID = 1L; public UserSearchStep() { super(); add(new RequiredTextFieldString(userid, new PropertyModelString(user, userid))); } @Override public void applyState() { super.applyState(); NewUserWizardHelper.userSearch(user.getUserid, user); // --- I've verified that the user (User object) is being updated in the method. //NewUserWizard.this.setUser(user); -- this doesn't work either. //modelChanged(); } } private final class UserInfoStep extends WizardStep { private static final long serialVersionUID = 1L; private RequiredTextField surname; public UserInfoStep() { super(); //surname = new RequiredTextField(surname); surname = new RequiredTextField(surname, new PropertyModelUser(user, surname) ); add(surname); } } private User user; public NewUserWizard(String id) { super(id); // create a blank user user = new User(); setDefaultModel(new CompoundPropertyModelUser(user)); //setDefaultModel(new CompoundPropertyModelNewUserWizard(this)); WizardModel model = new WizardModel(); model.add(new UserSearchStep()); model.add(new UpdateInfoStep()); // initialize the wizard with the wizard model we just built init(model); } public User getUser() { return user; } public void setUser(User user) { this.user = user; } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos
Re: Perfomance of IDataProvider
First render thanks for your replies. @vov: If i use this: public IModelEntity model(Entity entity) { return new ModelEntity(entity); } In this case the memory footprint of the session grows because you return Model object that is not a transient object(or this is what I've read in wicket documentation...!!) . ¿This means that if you dataview have 100 rows you have 100 ModelEntity stored in your session? ¿To avoid this do not exist LoadableDetachableModel what is detached after page rendering? @James Carman: This is the aspect of the most LoadableDetachableModel used in DataView examples. Specifically in wicket official examples. For each row in DataView this create new DetachableContactModel , store his ID. After in method populateItem of Dataview, getModelObject() call result in direct call to DetachableContactModel.load() that again return object to a database. Using hibernate this object is cached (or so I have understood), but if use hand made DAO (like me) that simply query and return a POJO populated this result in more database conections and querys! Am I right? public class DetachableContactModel extends LoadableDetachableModel { private long id; protected ContactsDatabase getContactsDB() { return DatabaseLocator.getDatabase(); } /** * @param c */ public DetachableContactModel(Contact c) { this(c.getid()) } /** * @param id */ public DetachableContactModel(long id) { if (id == 0) { throw new IllegalArgumentException(); } this.id = id; } /** * @see java.lang.Object#hashCode() */ public int hashCode() { return Long.valueOf(id).hashCode(); } /** * used for dataview with ReuseIfModelsEqualStrategy item reuse strategy * * @see org.apache.wicket.markup.repeater.ReuseIfModelsEqualStrategy * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals(final Object obj) { if (obj == this) { return true; } else if (obj == null) { return false; } else if (obj instanceof DetachableContactModel) { DetachableContactModel other = (DetachableContactModel)obj; return other.id == this.id; } return false; } /** * @see org.apache.wicket.model.LoadableDetachableModel#load() */ @Override protected Object load() { // loads contact from the database return getContactsDB().get(id); } } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Perfomance-of-IDataProvider-tp3325777p3328345.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Perfomance of IDataProvider
If I understand where you are going I completely agree the example is a little misleading. Some ways to think about it differently... id is synonymous with a small sub-set of the entire result-set which can be used to rehydrate the detached model The model is the data you want to provide to a repeater for instance, so this can be a single Contact model (one query for each row) or a ContactList (one query per page with pagination). Retrieving a list instead of each contact individually would be more efficient. If you need an example let me know... From: Juansoft andresnet2...@yahoo.es To: users@wicket.apache.org Date: 02/28/2011 03:53 PM Subject:Re: Perfomance of IDataProvider First render thanks for your replies. @vov: If i use this: public IModelEntity model(Entity entity) { return new ModelEntity(entity); } In this case the memory footprint of the session grows because you return Model object that is not a transient object(or this is what I've read in wicket documentation...!!) . ¿This means that if you dataview have 100 rows you have 100 ModelEntity stored in your session? ¿To avoid this do not exist LoadableDetachableModel what is detached after page rendering? @James Carman: This is the aspect of the most LoadableDetachableModel used in DataView examples. Specifically in wicket official examples. For each row in DataView this create new DetachableContactModel , store his ID. After in method populateItem of Dataview, getModelObject() call result in direct call to DetachableContactModel.load() that again return object to a database. Using hibernate this object is cached (or so I have understood), but if use hand made DAO (like me) that simply query and return a POJO populated this result in more database conections and querys! Am I right? public class DetachableContactModel extends LoadableDetachableModel { private long id; protected ContactsDatabase getContactsDB() { return DatabaseLocator.getDatabase(); } /** * @param c */ public DetachableContactModel(Contact c) { this(c.getid()) } /** * @param id */ public DetachableContactModel(long id) { if (id == 0) { throw new IllegalArgumentException(); } this.id = id; } /** * @see java.lang.Object#hashCode() */ public int hashCode() { return Long.valueOf(id).hashCode(); } /** * used for dataview with ReuseIfModelsEqualStrategy item reuse strategy * * @see org.apache.wicket.markup.repeater.ReuseIfModelsEqualStrategy * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals(final Object obj) { if (obj == this) { return true; } else if (obj == null) { return false; } else if (obj instanceof DetachableContactModel) { DetachableContactModel other = (DetachableContactModel)obj; return other.id == this.id; } return false; } /** * @see org.apache.wicket.model.LoadableDetachableModel#load() */ @Override protected Object load() { // loads contact from the database return getContactsDB().get(id); } } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Perfomance-of-IDataProvider-tp3325777p3328345.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org Notice: This communication, including any attachments, is intended solely for the use of the individual or entity to which it is addressed. This communication may contain information that is protected from disclosure under State and/or Federal law. Please notify the sender immediately if you have received this communication in error and delete this email from your system. If you are not the intended recipient, you are requested not to disclose, copy, distribute or take any action in reliance on the contents of this information.
Re: Perfomance of IDataProvider
You want to use this constructor: http://wicket.apache.org/apidocs/1.4/org/apache/wicket/model/LoadableDetachableModel.html#LoadableDetachableModel%28T%29 This way, the LDM will be initialized with the object pre-loaded and won't need to go to the database. However, on subsequent requests (such as if a user clicks on a remove link or something), the model will go to the database (in the load() method) and get the object again. On Mon, Feb 28, 2011 at 12:14 PM, Juansoft andresnet2...@yahoo.es wrote: First render thanks for your replies. @vov: If i use this: public IModelEntity model(Entity entity) { return new ModelEntity(entity); } In this case the memory footprint of the session grows because you return Model object that is not a transient object(or this is what I've read in wicket documentation...!!) . ¿This means that if you dataview have 100 rows you have 100 ModelEntity stored in your session? ¿To avoid this do not exist LoadableDetachableModel what is detached after page rendering? @James Carman: This is the aspect of the most LoadableDetachableModel used in DataView examples. Specifically in wicket official examples. For each row in DataView this create new DetachableContactModel , store his ID. After in method populateItem of Dataview, getModelObject() call result in direct call to DetachableContactModel.load() that again return object to a database. Using hibernate this object is cached (or so I have understood), but if use hand made DAO (like me) that simply query and return a POJO populated this result in more database conections and querys! Am I right? public class DetachableContactModel extends LoadableDetachableModel { private long id; protected ContactsDatabase getContactsDB() { return DatabaseLocator.getDatabase(); } /** * @param c */ public DetachableContactModel(Contact c) { this(c.getid()) } /** * @param id */ public DetachableContactModel(long id) { if (id == 0) { throw new IllegalArgumentException(); } this.id = id; } /** * @see java.lang.Object#hashCode() */ public int hashCode() { return Long.valueOf(id).hashCode(); } /** * used for dataview with ReuseIfModelsEqualStrategy item reuse strategy * * @see org.apache.wicket.markup.repeater.ReuseIfModelsEqualStrategy * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals(final Object obj) { if (obj == this) { return true; } else if (obj == null) { return false; } else if (obj instanceof DetachableContactModel) { DetachableContactModel other = (DetachableContactModel)obj; return other.id == this.id; } return false; } /** * @see org.apache.wicket.model.LoadableDetachableModel#load() */ @Override protected Object load() { // loads contact from the database return getContactsDB().get(id); } } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Perfomance-of-IDataProvider-tp3325777p3328345.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Perfomance of IDataProvider
An example with a list would be quite useful. Regards -Original Message- From: mzem...@osc.state.ny.us [mailto:mzem...@osc.state.ny.us] Sent: Monday, February 28, 2011 3:10 PM To: users@wicket.apache.org Subject: Re: Perfomance of IDataProvider If I understand where you are going I completely agree the example is a little misleading. Some ways to think about it differently... id is synonymous with a small sub-set of the entire result-set which can be used to rehydrate the detached model The model is the data you want to provide to a repeater for instance, so this can be a single Contact model (one query for each row) or a ContactList (one query per page with pagination). Retrieving a list instead of each contact individually would be more efficient. If you need an example let me know... From: Juansoft andresnet2...@yahoo.es To: users@wicket.apache.org Date: 02/28/2011 03:53 PM Subject:Re: Perfomance of IDataProvider First render thanks for your replies. @vov: If i use this: public IModelEntity model(Entity entity) { return new ModelEntity(entity); } In this case the memory footprint of the session grows because you return Model object that is not a transient object(or this is what I've read in wicket documentation...!!) . ¿This means that if you dataview have 100 rows you have 100 ModelEntity stored in your session? ¿To avoid this do not exist LoadableDetachableModel what is detached after page rendering? @James Carman: This is the aspect of the most LoadableDetachableModel used in DataView examples. Specifically in wicket official examples. For each row in DataView this create new DetachableContactModel , store his ID. After in method populateItem of Dataview, getModelObject() call result in direct call to DetachableContactModel.load() that again return object to a database. Using hibernate this object is cached (or so I have understood), but if use hand made DAO (like me) that simply query and return a POJO populated this result in more database conections and querys! Am I right? public class DetachableContactModel extends LoadableDetachableModel { private long id; protected ContactsDatabase getContactsDB() { return DatabaseLocator.getDatabase(); } /** * @param c */ public DetachableContactModel(Contact c) { this(c.getid()) } /** * @param id */ public DetachableContactModel(long id) { if (id == 0) { throw new IllegalArgumentException(); } this.id = id; } /** * @see java.lang.Object#hashCode() */ public int hashCode() { return Long.valueOf(id).hashCode(); } /** * used for dataview with ReuseIfModelsEqualStrategy item reuse strategy * * @see org.apache.wicket.markup.repeater.ReuseIfModelsEqualStrategy * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals(final Object obj) { if (obj == this) { return true; } else if (obj == null) { return false; } else if (obj instanceof DetachableContactModel) { DetachableContactModel other = (DetachableContactModel)obj; return other.id == this.id; } return false; } /** * @see org.apache.wicket.model.LoadableDetachableModel#load() */ @Override protected Object load() { // loads contact from the database return getContactsDB().get(id); } } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Perfomance-of-IDataProvider-tp3325777p3328345.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org Notice: This communication, including any attachments, is intended solely for the use of the individual or entity to which it is addressed. This communication may contain information that is protected from disclosure under State and/or Federal law. Please notify the sender immediately if you have received this communication in error and delete this email from your system. If you are not the intended recipient, you are requested not to disclose, copy, distribute or take any action in reliance on the contents of this information. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
spring 3.1 wicket auth integration
Can anyone point me to a tutorial or example on getting spring 3.x setup and working with wicket-auth-roles for an AuthenticatedWebApplication? Thanks in advance. mail2web.com Enhanced email for the mobile individual based on Microsoft® Exchange - http://link.mail2web.com/Personal/EnhancedEmail - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to prevent user from double-clicking a non-Ajax component
This is in the category how do we prevent the user from doing stupid things... like not clicking the log off link before closing the browser window, or to read all feedback messages, or to fill out all required fields that are marked required with an asterisk and painted with a yellow background color. You won't be able to prevent users from clicking twice on a button, a link, a check box, radio button, etc. That said, you might want to consider using a veil (see wicketstuff minis). Or search the lists for veil. Martijn On Mon, Feb 28, 2011 at 6:01 PM, eugenebalt eugeneb...@yahoo.com wrote: How do we prevent the user from double-clicking a non-Ajax component? When the submit occurs, isEnabled is set to false for the Wicket Button. If the user does a quick double click on the button, its throws a wicket runtime excpetion saying the component is disabled. Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-user-from-double-clicking-a-non-Ajax-component-tp3328308p3328308.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
ajax refresh of ListItems
I have an html table with a ListView generating the rows. Certain rows in the middle of the table are initially hidden via setVisible(false), but then displayed later when an AjaxLink is clicked. In order to effect this I have had tenclose the table in a div with wicket:id=tableContainer, and then choose the component to update in an odd manner. onClick(AjaxRequestTarget target) { // for each relevant ListItem item.setVisible(toggleValue); // why? if (item.isVisible()) target.addComponent(item); else target.addComponent(tableContainer); } The rows will only be made visible if the specific ListItems are added to the AjaxRequestTarget. Refreshing the entire tableContainer does not display them, even though they have setVisible(true). Conversely, to hide them I have to refresh tableContainer, refreshing each ListItem does not hide them. While I have this working, after a fair bit of trial error, I am unsure why my earlier approaches failed: 1. always refreshing the ListItem will not hide them, 2. always refreshing the tableContainer will not display them. Is this related to a bug, or am I missing something about ListViews ajax? Thank you, Scott - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ajax refresh of ListItems
does the listitem have setoutputmarkupplaceholdertag(true)? -igor On Mon, Feb 28, 2011 at 5:01 PM, Scott Swank scott.sw...@gmail.com wrote: I have an html table with a ListView generating the rows. Certain rows in the middle of the table are initially hidden via setVisible(false), but then displayed later when an AjaxLink is clicked. In order to effect this I have had tenclose the table in a div with wicket:id=tableContainer, and then choose the component to update in an odd manner. onClick(AjaxRequestTarget target) { // for each relevant ListItem item.setVisible(toggleValue); // why? if (item.isVisible()) target.addComponent(item); else target.addComponent(tableContainer); } The rows will only be made visible if the specific ListItems are added to the AjaxRequestTarget. Refreshing the entire tableContainer does not display them, even though they have setVisible(true). Conversely, to hide them I have to refresh tableContainer, refreshing each ListItem does not hide them. While I have this working, after a fair bit of trial error, I am unsure why my earlier approaches failed: 1. always refreshing the ListItem will not hide them, 2. always refreshing the tableContainer will not display them. Is this related to a bug, or am I missing something about ListViews ajax? Thank you, Scott - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Getting Javascript function return value in Wicket
Thanks a lot, but there are no comments or notes in the code and we cannot see how to apply the example provided to our use case. Let's say we create a class like this (notes are my understanding of what each method is doing): public class JSTest extends AbstractDefaultAjaxBehavior { // Used to add Javacript to page @Override public void renderHead(IHeaderResponse response) { response.renderOnDomReadyJavascript( function test() {return 'abcd' };); } // Used to call javascript and then return result @Override public final CharSequence getCallbackUrl(final boolean onlyTargetActivePage) { return super.getCallbackUrl(onlyTargetActivePage) + x='test()'; } // Used to get return value from request @Override protected void respond(AjaxRequestTarget target) { Request request = RequestCycle.get().getRequest(); String x = request.getParameter(x); System.out.println(value:+x); } } How would we then instantiate and call this class ??? Adding this in the constructor: add( new JSTest()) Does nothing - would expect the print statement in respond() to be called. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-Javascript-function-return-value-in-Wicket-tp3327794p3329321.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org