Re: Moving from isVisible/isEnabled overrides to onConfigure
I've created the issue: https://issues.apache.org/jira/browse/WICKET-3568 I'm not asking to change the behavior of isEnableAllowed(), merely to add a new isEnable*d*Allowed(), with corresponding setEnabledAllowed(). Visibility of a component is determined by 3 factors: isVisible() isRenderAllowed() isVisibilityAllowed(); Whereas whether a component is enabled or not, only relies on 2 factors: isEnabled() isEnableAllowed(); I agree the naming of this new property is a bit unfortunate. Perhaps someone can come up with another name? I don't think you should change the current isEnableAllowed(). It is the counterpart of isRenderAllowed() and serves to implement security. People may depend on that behavior. I've added this clarification to the JIRA issue. Do you want to continue this discussion on the list, or at JIRA? Best regards, Emond Papegaaij On Monday 28 March 2011 18:30:07 Igor Vaynberg wrote: please add a request to jira to do this, referencing or pasting this email. i dont think we can do this for 1.4 as it would change the semantics of isEnabledAllowed() transparently. but, in 1.5 we can make the change. -Igor On Mon, Mar 28, 2011 at 6:59 AM, Emond Papegaaij emond.papega...@topicus.nl wrote: Hi all, We are trying to migrate our projects from overriding isVisible and isEnabled to the new onConfigure method, but are having some problems with the new API. I'll start with explaining the old situation. We find it good practice to always call super.isVisible() in an overriding isVisible method. A typical implementation would look like this: public class MyComponent extends WebMarkupContainer { public boolean isVisible() { return super.isVisible() isConditionSatisfied(); } } Doing things this way, ensures the component will never be visible when the condition is not satisfied, nor when the component is explicitly hidden with setVisible(false). Trying to convert this to the new API, we started with: public class MyComponent extends WebMarkupContainer { protected void onConfigure() { super.onConfigure(); setVisible(isVisible() isConditionSatisfied()); } } However, we soon realized this will not work because a hidden component can never become visible again. Even when the condition is satisfied, isVisible() will still be false, causing the component to remain hidden. Therefore, our second attempt was to remove the call to isVisible(): public class MyComponent extends WebMarkupContainer { protected void onConfigure() { super.onConfigure(); setVisible(isConditionSatisfied()); } } This, however, suffers from another problem: manual setVisible(...) calls are now ignored. The visibility flag is always overridden by onConfigure. On our third attempt, we decided to use the visibilityAllowed flag for onConfigure, like this: public class MyComponent extends WebMarkupContainer { protected void onConfigure() { super.onConfigure(); setVisibilityAllowed(isConditionSatisfied()); } } This works great. It mixes with calls to setVisible. It even mixes well with isVisible overrides in subclasses. However, this approach only works for component visibility. There is no setEnabledAllowed. There is a isEnableAllowed(), but it is security related (the counterpart of isRenderAllowed()). Would it be possible to add a new property to Component (both in 1.4 and 1.5): enabledAllowed? This property would have a final getter (isEnabledAllowed) and setter (setEnabledAllowed), just as with visibilityAllowed. The naming of isEnableAllowed() would be a bit unfortunate, but I don't think that method can be changed. It is part of the public API. This new property would make it significantly easier to move to onConfigure. Best regards, Emond Papegaaij
Re: [vote] release wicket 1.5-RC3
+1 to release -igor On Mon, Mar 28, 2011 at 1:14 AM, Martin Grigorov mgrigo...@apache.org wrote: On behalf of Igor Vaynberg: This vote is to release wicket 1.5-RC3 Branch: http://svn.apache.org/repos/asf/wicket/branches/wicket-1.5-RC3/ Artifacts: http://people.apache.org/~ivaynberg/wicket-1.5-RC3/dist/ Maven repo: https://repository.apache.org/content/repositories/orgapachewicket-046 Changelog: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561version=12316220 This vote ends Thursday, March 31st at 1:00am (GMT-8) Please test the release and offer your vote. The Wicket team!
Re: [vote] release wicket 1.4.17
+1 to release -igor On Mon, Mar 28, 2011 at 1:10 AM, Martin Grigorov mgrigo...@apache.org wrote: On behalf of Igor Vaynberg: This vote is to release wicket 1.4.17. This is a bugfix release on the 1.4.x (stable) branch. Branch: http://svn.apache.org/repos/asf/wicket/branches/wicket-1.4.17/ Artifacts: http://people.apache.org/~ivaynberg/wicket-1.4.17/dist Maven repo: https://repository.apache.org/content/repositories/orgapachewicket-045/ Changelog: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561version=12316219 This vote ends Thursday, March 31st at 1:00am (GMT-8) Please test the release and offer your vote. The Wicket team
Re: [vote] release wicket 1.5-RC3
+1 to release works just fine for me. On behalf of Igor Vaynberg: This vote is to release wicket 1.5-RC3 Branch: http://svn.apache.org/repos/asf/wicket/branches/wicket-1.5-RC3/ Artifacts: http://people.apache.org/~ivaynberg/wicket-1.5-RC3/dist/ Maven repo: https://repository.apache.org/content/repositories/orgapachewicket-046 Changelog: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561version=12316220 This vote ends Thursday, March 31st at 1:00am (GMT-8) Please test the release and offer your vote. The Wicket team!
Re: [vote] release wicket 1.4.17
+1 release On Mon, Mar 28, 2011 at 10:10, Martin Grigorov mgrigo...@apache.org wrote: On behalf of Igor Vaynberg: This vote is to release wicket 1.4.17. This is a bugfix release on the 1.4.x (stable) branch. Branch: http://svn.apache.org/repos/asf/wicket/branches/wicket-1.4.17/ Artifacts: http://people.apache.org/~ivaynberg/wicket-1.4.17/dist Maven repo: https://repository.apache.org/content/repositories/orgapachewicket-045/ Changelog: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561version=12316219 This vote ends Thursday, March 31st at 1:00am (GMT-8) Please test the release and offer your vote. The Wicket team
Re: [vote] release wicket 1.5-RC3
+1 On Tue, Mar 29, 2011 at 5:27 AM, Andrea Del Bene adelb...@ciseonweb.itwrote: +1 to release works just fine for me. On behalf of Igor Vaynberg: This vote is to release wicket 1.5-RC3 Branch: http://svn.apache.org/repos/asf/wicket/branches/wicket-1.5-RC3/ Artifacts: http://people.apache.org/~ivaynberg/wicket-1.5-RC3/dist/ Maven repo: https://repository.apache.org/content/repositories/orgapachewicket-046 Changelog: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561version=12316220 This vote ends Thursday, March 31st at 1:00am (GMT-8) Please test the release and offer your vote. The Wicket team! -- Pedro Henrique Oliveira dos Santos
Re: [vote] release wicket 1.5-RC3
+1 On Tue, Mar 29, 2011 at 4:08 PM, Pedro Santos pedros...@gmail.com wrote: +1 On Tue, Mar 29, 2011 at 5:27 AM, Andrea Del Bene adelb...@ciseonweb.it wrote: +1 to release works just fine for me. On behalf of Igor Vaynberg: This vote is to release wicket 1.5-RC3 Branch: http://svn.apache.org/repos/asf/wicket/branches/wicket-1.5-RC3/ Artifacts: http://people.apache.org/~ivaynberg/wicket-1.5-RC3/dist/ Maven repo: https://repository.apache.org/content/repositories/orgapachewicket-046 Changelog: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561version=12316220 This vote ends Thursday, March 31st at 1:00am (GMT-8) Please test the release and offer your vote. The Wicket team! -- Pedro Henrique Oliveira dos Santos -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: [vote] release wicket 1.4.17
+1 On Mon, Mar 28, 2011 at 11:10 AM, Martin Grigorov mgrigo...@apache.orgwrote: On behalf of Igor Vaynberg: This vote is to release wicket 1.4.17. This is a bugfix release on the 1.4.x (stable) branch. Branch: http://svn.apache.org/repos/asf/wicket/branches/wicket-1.4.17/ Artifacts: http://people.apache.org/~ivaynberg/wicket-1.4.17/dist Maven repo: https://repository.apache.org/content/repositories/orgapachewicket-045/ Changelog: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561version=12316219 This vote ends Thursday, March 31st at 1:00am (GMT-8) Please test the release and offer your vote. The Wicket team -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: 1.5 visitParents problem?
Component#visitParents expects Component as the type to be visited, IMO should expect the same type of the first parameter. On Tue, Mar 29, 2011 at 5:22 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: why is this not valid? message.getReporter().visitParents(Form.class, new IVisitorForm, Void() { @Override public void component(Form object, IVisitVoid visit) { // TODO Auto-generated method stub } }); - 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: 1.5 visitParents problem?
hmm but visitChildren expects differently, there you can specify what every you want as long as its extends from component... In my case I want a feedback panel's filter to visit it's parent to see if the component that reports the message are within it's form.. Therefore i am only searching for forms.. 2011/3/29 Pedro Santos pedros...@gmail.com: Component#visitParents expects Component as the type to be visited, IMO should expect the same type of the first parameter. On Tue, Mar 29, 2011 at 5:22 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: why is this not valid? message.getReporter().visitParents(Form.class, new IVisitorForm, Void() { @Override public void component(Form object, IVisitVoid visit) { // TODO Auto-generated method stub } }); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos