Re: [Wicket-user] feature suggestion component instantiation
Ok, thanks for your input guys, no hard feelings :) There are indeed workarounds, i just thought it would be an elegant solution if wicket supported it. But i guess you are right, there are too many caveats. Maurice On 7/18/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > > i think its time for you to build something that uses aop and get it out of > > your system :) > > Get it out of my system? I'm not exactly recommending AOP as I think > other solutions would be better. > > after(Component c) returning: this(c) && execution(Component.new(..)) > { > System.out.println("constructed component with model " + > c.getModel()); > } > > Something like that works. I'm sure there's lots of ifs and buts, but > the point is that it is a possible way out. > > Eelco > > - > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] feature suggestion component instantiation
> i think its time for you to build something that uses aop and get it out of > your system :) Get it out of my system? I'm not exactly recommending AOP as I think other solutions would be better. after(Component c) returning: this(c) && execution(Component.new(..)) { System.out.println("constructed component with model " + c.getModel()); } Something like that works. I'm sure there's lots of ifs and buts, but the point is that it is a possible way out. Eelco - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] feature suggestion component instantiation
On 7/18/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > > > Sounds to me like you have alternative ways to implement this, for > instance, construct what's on your page according to what can be > displayed, throw an auth exception in the page itself (doesn't sound > like you were doing this generically to start with?) or use an > intermediate page that functions like a switch. Also, if you really > want to follow your approach and IComponentInstantiationListener is > not rich enough, consider using AOP, which should give you all the > freedom you wish for. i think its time for you to build something that uses aop and get it out of your system :) -igor - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] feature suggestion component instantiation
On 7/18/07, Maurice Marrink <[EMAIL PROTECTED]> wrote: > True you can't do setModel(foo) and expect your instantiation check to > work. Which imho is perfectly logical if you want to use your model in > the instantiation check you need to pass it in the constructor. > > As for the example > We have a search page for students, uppon clicking on one of those > students, you go to a detail page for that student. that page also > contains several tabs to go to other relevant pages for the student > (like it's school grades). on these pages we made a quicksearch > function with contains amongst other things 2 buttons to navigate > forth and back between the searchresults of the search page, while > keeping the same view. Suppose i have sufficient rights to see the > detail pages of all students but only enough rights to see the grades > of my own students. > > So if i make the search wide enough to get all students and then > select one of my own, going to the grades. That's fine. But if i then > navigate to another student i am not allowed to see the grades > (creating a new instance of the grades page in the process) i need to > know if the page in combination with the student is allowed, because > the page itself is basically allowed. Sounds to me like you have alternative ways to implement this, for instance, construct what's on your page according to what can be displayed, throw an auth exception in the page itself (doesn't sound like you were doing this generically to start with?) or use an intermediate page that functions like a switch. Also, if you really want to follow your approach and IComponentInstantiationListener is not rich enough, consider using AOP, which should give you all the freedom you wish for. Eelco - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] feature suggestion component instantiation
i am -1 on this first of all there are already too many exception to this: it wont work if its a wrap model, it wont work if its icomponentassignedmodel, blah blah blah. if i construct my component with new Component("id", foo) and foo is not null then it is very clumsy that sometimes in the auth strategy it is all of a sudden null and other times is not even though the exact same line is executing. i bet a lot of people will be filing bug reports. also i really wish we would limit passing around instances of not fully constructed objects to users. we already do it in some places where it is very strictly necessary, but we should not do this lightly. i do not wish something like this introduced just to make maurice's life a little easier, sorry maurice nothing personal. -igor On 7/18/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > > I don't think I agree with that. > > MyComponent c = new MyComponent(); c.setModel(foo) wouldn't work for > starters, and you can even set models mutliple times. Not to mention > the other problems you mentioned in this thread. And finally, it would > just invite people to go crazy with this functionality. > > But give us a good example of where using the model to determine an > access restriction would actually be useful? > > Eelco > > - > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] feature suggestion component instantiation
what does your strategy do? it redirects right? you do that with throw new RestartResponseException - you can do the same from your constructor once you check your model. it isnt that much "later" that you would fail - only the init of super hierarchy. -igor On 7/18/07, Maurice Marrink <[EMAIL PROTECTED]> wrote: > > However besides the benefit of being more efficient it also prevents a > lot of nasty stuff like throwing custom exceptions / NPE in the page > constructor or redirecting, which i now have to take into account > because the page is fully constructed. When the strategy can tell me > for certain if the page is allowed i would not have to do that. > > Maurice > > On 7/18/07, Maurice Marrink <[EMAIL PROTECTED]> wrote: > > Right now i manually need to trigger > > isActionAuthorized(Component.RENDER); after the component has been > > fully initialized. I would like to abort as soon as possible. > > > > Maurice > > > > On 7/18/07, Johan Compagner <[EMAIL PROTECTED]> wrote: > > > cant you test this with the render action check? > > > that is always done also if the model is changed > > > > > > johan > > > > > > > > > On 7/18/07, Maurice Marrink <[EMAIL PROTECTED]> wrote: > > > > > > > > True you can't do setModel(foo) and expect your instantiation check > to > > > > work. Which imho is perfectly logical if you want to use your model > in > > > > the instantiation check you need to pass it in the constructor. > > > > > > > > As for the example > > > > We have a search page for students, uppon clicking on one of those > > > > students, you go to a detail page for that student. that page also > > > > contains several tabs to go to other relevant pages for the student > > > > (like it's school grades). on these pages we made a quicksearch > > > > function with contains amongst other things 2 buttons to navigate > > > > forth and back between the searchresults of the search page, while > > > > keeping the same view. Suppose i have sufficient rights to see the > > > > detail pages of all students but only enough rights to see the > grades > > > > of my own students. > > > > > > > > So if i make the search wide enough to get all students and then > > > > select one of my own, going to the grades. That's fine. But if i > then > > > > navigate to another student i am not allowed to see the grades > > > > (creating a new instance of the grades page in the process) i need > to > > > > know if the page in combination with the student is allowed, because > > > > the page itself is basically allowed. > > > > > > > > Maurice > > > > > > > > On 7/18/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > > > > > I don't think I agree with that. > > > > > > > > > > MyComponent c = new MyComponent(); c.setModel(foo) wouldn't work > for > > > > > starters, and you can even set models mutliple times. Not to > mention > > > > > the other problems you mentioned in this thread. And finally, it > would > > > > > just invite people to go crazy with this functionality. > > > > > > > > > > But give us a good example of where using the model to determine > an > > > > > access restriction would actually be useful? > > > > > > > > > > Eelco > > > > > > > > > > > > > > > - > > > > > This SF.net email is sponsored by DB2 Express > > > > > Download DB2 Express C - the FREE version of DB2 express and take > > > > > control of your XML. No limits. Just data. Click to get it now. > > > > > http://sourceforge.net/powerbar/db2/ > > > > > ___ > > > > > Wicket-user mailing list > > > > > Wicket-user@lists.sourceforge.net > > > > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > > > > > > > > > > - > > > > This SF.net email is sponsored by DB2 Express > > > > Download DB2 Express C - the FREE version of DB2 express and take > > > > control of your XML. No limits. Just data. Click to get it now. > > > > http://sourceforge.net/powerbar/db2/ > > > > ___ > > > > Wicket-user mailing list > > > > Wicket-user@lists.sourceforge.net > > > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > > > > - > > > This SF.net email is sponsored by DB2 Express > > > Download DB2 Express C - the FREE version of DB2 express and take > > > control of your XML. No limits. Just data. Click to get it now. > > > http://sourceforge.net/powerbar/db2/ > > > ___ > > > Wicket-user mailing list > > > Wicket-user@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > > > - > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > contr
Re: [Wicket-user] feature suggestion component instantiation
However besides the benefit of being more efficient it also prevents a lot of nasty stuff like throwing custom exceptions / NPE in the page constructor or redirecting, which i now have to take into account because the page is fully constructed. When the strategy can tell me for certain if the page is allowed i would not have to do that. Maurice On 7/18/07, Maurice Marrink <[EMAIL PROTECTED]> wrote: > Right now i manually need to trigger > isActionAuthorized(Component.RENDER); after the component has been > fully initialized. I would like to abort as soon as possible. > > Maurice > > On 7/18/07, Johan Compagner <[EMAIL PROTECTED]> wrote: > > cant you test this with the render action check? > > that is always done also if the model is changed > > > > johan > > > > > > On 7/18/07, Maurice Marrink <[EMAIL PROTECTED]> wrote: > > > > > > True you can't do setModel(foo) and expect your instantiation check to > > > work. Which imho is perfectly logical if you want to use your model in > > > the instantiation check you need to pass it in the constructor. > > > > > > As for the example > > > We have a search page for students, uppon clicking on one of those > > > students, you go to a detail page for that student. that page also > > > contains several tabs to go to other relevant pages for the student > > > (like it's school grades). on these pages we made a quicksearch > > > function with contains amongst other things 2 buttons to navigate > > > forth and back between the searchresults of the search page, while > > > keeping the same view. Suppose i have sufficient rights to see the > > > detail pages of all students but only enough rights to see the grades > > > of my own students. > > > > > > So if i make the search wide enough to get all students and then > > > select one of my own, going to the grades. That's fine. But if i then > > > navigate to another student i am not allowed to see the grades > > > (creating a new instance of the grades page in the process) i need to > > > know if the page in combination with the student is allowed, because > > > the page itself is basically allowed. > > > > > > Maurice > > > > > > On 7/18/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > > > > I don't think I agree with that. > > > > > > > > MyComponent c = new MyComponent(); c.setModel(foo) wouldn't work for > > > > starters, and you can even set models mutliple times. Not to mention > > > > the other problems you mentioned in this thread. And finally, it would > > > > just invite people to go crazy with this functionality. > > > > > > > > But give us a good example of where using the model to determine an > > > > access restriction would actually be useful? > > > > > > > > Eelco > > > > > > > > > > > - > > > > This SF.net email is sponsored by DB2 Express > > > > Download DB2 Express C - the FREE version of DB2 express and take > > > > control of your XML. No limits. Just data. Click to get it now. > > > > http://sourceforge.net/powerbar/db2/ > > > > ___ > > > > Wicket-user mailing list > > > > Wicket-user@lists.sourceforge.net > > > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > > > > > > - > > > This SF.net email is sponsored by DB2 Express > > > Download DB2 Express C - the FREE version of DB2 express and take > > > control of your XML. No limits. Just data. Click to get it now. > > > http://sourceforge.net/powerbar/db2/ > > > ___ > > > Wicket-user mailing list > > > Wicket-user@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > - > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > ___ > > Wicket-user mailing list > > Wicket-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] feature suggestion component instantiation
Right now i manually need to trigger isActionAuthorized(Component.RENDER); after the component has been fully initialized. I would like to abort as soon as possible. Maurice On 7/18/07, Johan Compagner <[EMAIL PROTECTED]> wrote: > cant you test this with the render action check? > that is always done also if the model is changed > > johan > > > On 7/18/07, Maurice Marrink <[EMAIL PROTECTED]> wrote: > > > > True you can't do setModel(foo) and expect your instantiation check to > > work. Which imho is perfectly logical if you want to use your model in > > the instantiation check you need to pass it in the constructor. > > > > As for the example > > We have a search page for students, uppon clicking on one of those > > students, you go to a detail page for that student. that page also > > contains several tabs to go to other relevant pages for the student > > (like it's school grades). on these pages we made a quicksearch > > function with contains amongst other things 2 buttons to navigate > > forth and back between the searchresults of the search page, while > > keeping the same view. Suppose i have sufficient rights to see the > > detail pages of all students but only enough rights to see the grades > > of my own students. > > > > So if i make the search wide enough to get all students and then > > select one of my own, going to the grades. That's fine. But if i then > > navigate to another student i am not allowed to see the grades > > (creating a new instance of the grades page in the process) i need to > > know if the page in combination with the student is allowed, because > > the page itself is basically allowed. > > > > Maurice > > > > On 7/18/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > > > I don't think I agree with that. > > > > > > MyComponent c = new MyComponent(); c.setModel(foo) wouldn't work for > > > starters, and you can even set models mutliple times. Not to mention > > > the other problems you mentioned in this thread. And finally, it would > > > just invite people to go crazy with this functionality. > > > > > > But give us a good example of where using the model to determine an > > > access restriction would actually be useful? > > > > > > Eelco > > > > > > > > - > > > This SF.net email is sponsored by DB2 Express > > > Download DB2 Express C - the FREE version of DB2 express and take > > > control of your XML. No limits. Just data. Click to get it now. > > > http://sourceforge.net/powerbar/db2/ > > > ___ > > > Wicket-user mailing list > > > Wicket-user@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > > > - > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > ___ > > Wicket-user mailing list > > Wicket-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > - > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] feature suggestion component instantiation
cant you test this with the render action check? that is always done also if the model is changed johan On 7/18/07, Maurice Marrink <[EMAIL PROTECTED]> wrote: > > True you can't do setModel(foo) and expect your instantiation check to > work. Which imho is perfectly logical if you want to use your model in > the instantiation check you need to pass it in the constructor. > > As for the example > We have a search page for students, uppon clicking on one of those > students, you go to a detail page for that student. that page also > contains several tabs to go to other relevant pages for the student > (like it's school grades). on these pages we made a quicksearch > function with contains amongst other things 2 buttons to navigate > forth and back between the searchresults of the search page, while > keeping the same view. Suppose i have sufficient rights to see the > detail pages of all students but only enough rights to see the grades > of my own students. > > So if i make the search wide enough to get all students and then > select one of my own, going to the grades. That's fine. But if i then > navigate to another student i am not allowed to see the grades > (creating a new instance of the grades page in the process) i need to > know if the page in combination with the student is allowed, because > the page itself is basically allowed. > > Maurice > > On 7/18/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > > I don't think I agree with that. > > > > MyComponent c = new MyComponent(); c.setModel(foo) wouldn't work for > > starters, and you can even set models mutliple times. Not to mention > > the other problems you mentioned in this thread. And finally, it would > > just invite people to go crazy with this functionality. > > > > But give us a good example of where using the model to determine an > > access restriction would actually be useful? > > > > Eelco > > > > > - > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > ___ > > Wicket-user mailing list > > Wicket-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > - > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] feature suggestion component instantiation
True you can't do setModel(foo) and expect your instantiation check to work. Which imho is perfectly logical if you want to use your model in the instantiation check you need to pass it in the constructor. As for the example We have a search page for students, uppon clicking on one of those students, you go to a detail page for that student. that page also contains several tabs to go to other relevant pages for the student (like it's school grades). on these pages we made a quicksearch function with contains amongst other things 2 buttons to navigate forth and back between the searchresults of the search page, while keeping the same view. Suppose i have sufficient rights to see the detail pages of all students but only enough rights to see the grades of my own students. So if i make the search wide enough to get all students and then select one of my own, going to the grades. That's fine. But if i then navigate to another student i am not allowed to see the grades (creating a new instance of the grades page in the process) i need to know if the page in combination with the student is allowed, because the page itself is basically allowed. Maurice On 7/18/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > I don't think I agree with that. > > MyComponent c = new MyComponent(); c.setModel(foo) wouldn't work for > starters, and you can even set models mutliple times. Not to mention > the other problems you mentioned in this thread. And finally, it would > just invite people to go crazy with this functionality. > > But give us a good example of where using the model to determine an > access restriction would actually be useful? > > Eelco > > - > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] feature suggestion component instantiation
I don't think I agree with that. MyComponent c = new MyComponent(); c.setModel(foo) wouldn't work for starters, and you can even set models mutliple times. Not to mention the other problems you mentioned in this thread. And finally, it would just invite people to go crazy with this functionality. But give us a good example of where using the model to determine an access restriction would actually be useful? Eelco - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] feature suggestion component instantiation
After having Johan explain to me that It is only the IComponentAssignedModel that will cause serious problems and models like CompoundPropertyModel will work just fine. And since we do not use those. I have no objection to this restriction. Maurice On 7/18/07, Johan Compagner <[EMAIL PROTECTED]> wrote: > i can see the value of having the model in the authorizationstrategy > this is pretty handy. But the problem is with wrapmodels because we > just can't give those to the outside world withing a constructor of a > component > because we have a big warning in the wrapOnAssigment(Component) call > that in that method you shouldn't really touch the component because it is > not > fully constructed yet. But we can't have it that the component is still not > fully constructed > in the getObject() call of the wrapped model. > > So i am +1 for such a change except that the model param will be null of not > given and > null if it is wrapped model. > > johan > > > On 7/18/07, Maurice Marrink <[EMAIL PROTECTED]> wrote: > > > > Hi, > > In my project we often have the case where a user initially is allowed > > to construct a certain component (pages mostly) but whether he really > > can depends on the model of the page. > > So my request / suggestion is to enhance IAuthorizationStrategy with > > the following method isInstantiationAuthorized(Class, IModel). whether > > this methods is made available next to > > isInstantiationAuthorized(Class) or replaces it is not important. > > > > As far as i can see the following changes need to be made > > -Application.notifyComponentInstantiationListeners needs to be > > upgraded to receive the model to, or the component should not call > > notify untill the model has been set on the component (which happens > > on the next line) > > -the default listener needs to pass the model to the strategy. > > > > For regular models this should not be a problem but IWrapModels might > > have a problem when accessing anything else from the component but the > > id. Not passing the wrappedmodel but the original model is imo not an > > option because the main point of passing the model is to be able to > > use the getObject method. > > > > What do you think? > > > > Maurice > > > > - > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > ___ > > Wicket-user mailing list > > Wicket-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > - > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] feature suggestion component instantiation
i can see the value of having the model in the authorizationstrategy this is pretty handy. But the problem is with wrapmodels because we just can't give those to the outside world withing a constructor of a component because we have a big warning in the wrapOnAssigment(Component) call that in that method you shouldn't really touch the component because it is not fully constructed yet. But we can't have it that the component is still not fully constructed in the getObject() call of the wrapped model. So i am +1 for such a change except that the model param will be null of not given and null if it is wrapped model. johan On 7/18/07, Maurice Marrink <[EMAIL PROTECTED]> wrote: > > Hi, > In my project we often have the case where a user initially is allowed > to construct a certain component (pages mostly) but whether he really > can depends on the model of the page. > So my request / suggestion is to enhance IAuthorizationStrategy with > the following method isInstantiationAuthorized(Class, IModel). whether > this methods is made available next to > isInstantiationAuthorized(Class) or replaces it is not important. > > As far as i can see the following changes need to be made > -Application.notifyComponentInstantiationListeners needs to be > upgraded to receive the model to, or the component should not call > notify untill the model has been set on the component (which happens > on the next line) > -the default listener needs to pass the model to the strategy. > > For regular models this should not be a problem but IWrapModels might > have a problem when accessing anything else from the component but the > id. Not passing the wrappedmodel but the original model is imo not an > option because the main point of passing the model is to be able to > use the getObject method. > > What do you think? > > Maurice > > - > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] feature suggestion component instantiation
Hi, In my project we often have the case where a user initially is allowed to construct a certain component (pages mostly) but whether he really can depends on the model of the page. So my request / suggestion is to enhance IAuthorizationStrategy with the following method isInstantiationAuthorized(Class, IModel). whether this methods is made available next to isInstantiationAuthorized(Class) or replaces it is not important. As far as i can see the following changes need to be made -Application.notifyComponentInstantiationListeners needs to be upgraded to receive the model to, or the component should not call notify untill the model has been set on the component (which happens on the next line) -the default listener needs to pass the model to the strategy. For regular models this should not be a problem but IWrapModels might have a problem when accessing anything else from the component but the id. Not passing the wrappedmodel but the original model is imo not an option because the main point of passing the model is to be able to use the getObject method. What do you think? Maurice - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user