Re: [Wicket-user] AjaxLink not updating Image
Done: https://issues.apache.org/jira/browse/WICKET-720 But unfortunately the TestCase works as expected, while the in the wild test fails. -- View this message in context: http://www.nabble.com/AjaxLink-not-updating-Image-tf3915168.html#a11425908 Sent from the Wicket - User mailing list archive at Nabble.com. - 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] [wicket 1.2.6]Listview and item.getModelObject()?
Ok, thanks. Igor Vaynberg wrote: On 7/3/07, *Nino Saturnino Martinez Vazquez Wael* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi I have this setup: ListView blockContainer = new ListView(blockContainer, model) { protected void populateItem(ListItem item) { item.getModelObject (); more code... } I've experienced some what I belive unexpected behavior here. So I'll try to explain what I expect should happen when iterating trough the listview. In the above example, I would expect the following 1. listview should to call model.getObject to retrieve the list that it should iterate over. 2. item.getModelObject should give me the current items modelObject These two points are also what happens but its the way that they seem to be implemented that are odd. It looks like when calling item.getModelObject this is what happens: model.getObject.get(iterationnumber), I would have expected listview to extract the list only once? no, listview doesnt cache the list. but the model can do so. so if you use loadabledetachablemodel() then your list is only extracted once, and then cached by the model for the duration of the request. there are never contracts on how often a component will call getobject() on the model. -igor regards Nino - 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 mailto: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] 401 HTTP authentication?
Very interesting question indeed. I did some digging in the code and found the following: using the RequestCycle you can get the Response. which is most likely a WebResponse from there you can get the HttpServletResponse and set the statuscode to 401. Question remains how to tell wicket to stop processing and simply return the statuscode. If any of the core committers could respond with a proper way of doing this :) Maurice On 7/4/07, Jesse Barnum [EMAIL PROTECTED] wrote: What is the right way to use basic HTTP authentication? I know how to read the headers to extract the username and password, but if they don't match, or if they're not supplied, what is the best way to send the 401 response to the user? It seems like the ISecuritySettings.setUnauthorizedComponentInstantiationListener() method assumes that you want to present an HTML login component to the user. --Jesse Barnum, President, 360Works http://www.360works.com (770) 234-9293 - 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] DatePicker broken on beta2 and snapshot?
eelco, speaking of wicket-datetime. is it possible to change the default implementation of notifyComponentOnDateSelected to return true? when telling other people (happend twice up to now) about how to use the datepicker, i always felt the urge to tell them to override this method if they wanted onchange notification. still i think this is actually what would be expected to be the default behavior (the onchange notification), since the value of the associated component does change. what do you think? anyway, sorry if this issue demands more time than it actually might deserve, due to not enough thinking in the first place... gerolf On 7/4/07, Eelco Hillenius [EMAIL PROTECTED] wrote: Just noticed that the DatePicker in my Form no longer works. The wicket form examples page also does not work: http://wicketstuff.org/wicket13/forminput/ Yeah, this is fixed in example's trunk (it's actually removed from that example), but there is no ultimate solution for this. The problem is described here: http://issues.apache.org/jira/browse/WICKET-694 (or rather in the thread it references). Still no good idea about a solution. It's one of the things 2.0's constructor change *did* fix, but unfortunately, pros like that didn't outweight the cons. The issue is left open. Hopefully someone get's some fresh inspiration soon. Snippet of code: add(new TextField(dateProperty, Date.class).add(new DatePicker())); As you can read in the above-mentioned thread, you can work around this by not using an id attribute on dateProperty's markup tag. Another question, which is the 'current'/recommended DateTextField implementation as there is one in wicket.datetime and one in wicket.extentions? Doesn't matter much. I prefer the one in wicket-datetime, as there's some magic in there (or rather in the converter is used by default) to adjust for time zones, but if you need just the basics, they're both fine. 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] 401 HTTP authentication?
you can use a Page that you also display and then in the configureResponse() you can set the right status like the AccessDeniedPage does: protected void configureResponse() { super.configureResponse(); getWebRequestCycle().getWebResponse().getHttpServletResponse().setStatus( HttpServletResponse.SC_FORBIDDEN); } or if you don't want a page but only set the status you can do: RequestCycle.get().setRequestTarget(new IRequestTarget() { respond() { getWebRequestCycle().getWebResponse().getHttpServletResponse().setStatus( HttpServletResponse.SC_FORBIDDEN); } }); On 7/4/07, Jesse Barnum [EMAIL PROTECTED] wrote: What is the right way to use basic HTTP authentication? I know how to read the headers to extract the username and password, but if they don't match, or if they're not supplied, what is the best way to send the 401 response to the user? It seems like the ISecuritySettings.setUnauthorizedComponentInstantiationListener() method assumes that you want to present an HTML login component to the user. --Jesse Barnum, President, 360Works http://www.360works.com (770) 234-9293 - 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] Tree - override onNodeLinkClicked(...)?
the reason i using the tree is my menu will be cover a lot of reports ( i m develop the report module). So if using the tree style, the interface will be look more nicer and structure. Plus the dynamic feel to the user :p (more attractive). is that the wicket - tree is hard to maintain? Actually i had build the tree, sub tree and report name. All i listed in array and then called up the array to execute became a tree. Anyway, i found that the wicket example did not show the use of the node link. Any place can help ? As i went through this forum but still cant get any idea to solve it .. :( how ar?? Eelco Hillenius wrote: sorry for understood.. i m not just play around. i wish to build a new module for my current project. And i wish to manage all the menus in a tree style outlook. So, can i get some guide frou u , Eelco .. If you are looking for menus, why not use something like this: http://developer.yahoo.com/yui/menu/? That will be much easier to set up than bending the Tree component into something it is not meant 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 -- View this message in context: http://www.nabble.com/Tree---override-onNodeLinkClicked%28...%29--tf4010264.html#a11426246 Sent from the Wicket - User mailing list archive at Nabble.com. - 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] AuthorizeAction and !Role
Is there an elegant way to do the opposite of what the AuthorizeAction annotation was intended for? I have an unregister function that any user _except_ the admin user should be able to use. If the admin unregisters, I'm f*. Essentially, I'd really like to be able to do something like this: @AuthorizeAction( action = Action.RENDER, roles = { !Roles.ADMIN, Roles.USER }) Any ideas? Thanks! - 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] Passing parameters to PageExpired page
Hi all, Rather than using the default session expiry page I registered my LoginPage with getApplicationSettings().setPageExpiredErrorPage(LoginPage.class); Is there a way to pass along parameters to the LoginPage when it's registered as the expiry page? On the LoginPage I want to let the user know that he has to relogin because his session expired however within the LoginPage I cannot determine the cause anymore. gr, Thies -- http://www.ehour.nl/ http://blog.ehour.nl/ - 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] Passing parameters to PageExpired page
Is there a way to pass along parameters to the LoginPage when it's registered as the expiry page? On the LoginPage I want to let the user know that he has to relogin because his session expired however within the LoginPage I cannot determine the cause anymore. How about ExpiredPage extends LoginPage? That way you have everything the LoginPage does and you know exactly where you are. Carl-Eric - 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] Wicket with JExcel
thats why the source is open for you to hack into :) however, 1. for the Not Set Stuff, check the XCell class for modification 2. the one without ajax is easy, Look up the ExcelGridPanel class and make these modifications final XCell cell = ... TextField celltx = new TextField(cell, new PropertyModel(cell,data)){ public void onComponentTag(ComponentTag tag){ super.onComponentTag(tag); if(!isValid()){ tag.put(class, grid-error); }else tag.put(class, grid-normal); //How can I change the empty field box style in Red color. It's easy to //Identify. Because XL file may contains lot of empty fields. if(cell.getContent().equals()) tag.put(class,grid-error); //In xls one field contains more than 20 characters. When I upload that xls, //initially it shows the data only not in red color box. But when I click the //box only it shows red color. How can I show in red color when load the //document. if(cell.getContent().length() 20) tag.put(class, grid-error); //And how can I add alt tag when I mouse over the empty field text box - //for eg. If I mouse over the empty field, It shows the empty field should not //be allowed. if(cell.getContent().equals()) tag.put(alt,Empty Cells Not Allowed ); } }; After changing the file, what is save record button. How it works? Please explain. hmm... ok, depends on what you want to achieve but basically this is the part of the code that you du what you got to do when i wrote the code, i used it for a project where ppl needed to upload Mobile phone contacts into a database from Excel file, so our line of purpose may be different. if you want to allow users to modify the Excel Spreadsheet, its a different ball game Form gridForm = new Form(gridform){ public void onSubmit(){ //you could keep a reference to a XCell array and then write it back to the corresponding Cell instances from the Workbook // NOte: that the code assumes every data in the Excel is a String. to support multiple data types is another beast of code //so place your logic code here } } Regards, On 7/4/07, Edi [EMAIL PROTECTED] wrote: In xls one field contains more than 20 characters. When I upload that xls, initially it shows the data only not in red color box. But when I click the box only it shows red color. How can I show in red color when load the document. Ayodeji Aladejebi wrote: meanwhile for the AjaxExcelGirdPanel, you have to click on the cell labels to edit them and you will require wicket-extensions along with the wicket jar to make it work regards On 7/4/07, Ayodeji Aladejebi [EMAIL PROTECTED] wrote: hmm..i have been busy but i worked a quick fix for you it is attached, its a netbeans project folder. I really hope you find it useful There are two panels there that meet your requirements ExcelGridPanel and AjaxExcelGridPanel i does not support paging yet so that gagantic excel data wont scatter the screen I also realized that Loop and ListView have a lot of difference cuz igor's validation error notification code did not work with Loop until i modified it to ListView Either way, you could work your way from what is attached when i have more updates, i will let you know regards On 7/2/07, Edi [EMAIL PROTECTED] wrote: Excuse me, ANy updates? please Ayodeji Aladejebi wrote: alas...igor has rescued us pls give me some time to update the code wih this approach and send it to yu On 6/29/07, Igor Vaynberg [EMAIL PROTECTED] wrote: On 6/29/07, Ayodeji Aladejebi [EMAIL PROTECTED] wrote: that should be simple, although my wicket is bit rusty at the moment, I think final TextField tx = new TextField(cell, new PropertyModel(values[row][col],data)); tx.add(new IValidator(){ public void validate(FormComponent fc){ if(fc.getValue () is greater than 20){ fc.add(new AttributeModifier(style,true, new Model(background-color: #FF;))); fc.error(error.toolongvalue ,null); }else{ fc.add(new AttributeModifier(style,true, new Model(background-color: normal-color;))); } } }); item.add(tx); something like dat...just buzz around ayyayay, i guess no matter how you try to engineer the api people always find ways to abuse it :) TextField tf=new TextField() { oncomponenttag(tag) { if (!isvalid()) { tag.put(class,error); } }}; tf.add(StringValidator.maxLength(20)); -igor On 6/29/07, Edi [EMAIL PROTECTED] wrote: Or, tell me how to validate, if the text box value exceeds 20 characters, I want to change the color of the text box. HOW? Ayodeji Aladejebi wrote: well, yu can use String.length to do dat. but be aware
Re: [Wicket-user] Passing parameters to PageExpired page
Carl-Eric Menzel wrote: Is there a way to pass along parameters to the LoginPage when it's registered as the expiry page? On the LoginPage I want to let the user know that he has to relogin because his session expired however within the LoginPage I cannot determine the cause anymore. How about ExpiredPage extends LoginPage? That way you have everything the LoginPage does and you know exactly where you are. Ah didn't think of that, that'll work. Does Wicket travel up the hierarchy tree to look for the markup file? If ExpiredPage.html doesn't exist, will it use LoginPage.html? regards, Thies - 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] Passing parameters to PageExpired page
Ah didn't think of that, that'll work. Does Wicket travel up the hierarchy tree to look for the markup file? If ExpiredPage.html doesn't exist, will it use LoginPage.html? I don't really know and can't test it right now. I just thought of that off the top of my head ;-) Simply give it a try, if it doesn't work as expected, you should see it immediately. Carl-Eric - 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] Filterable DefaultDatatable
Hello, thx a lot for your input! In fact the value are sticking well after the submit. But I was explicitly reloading a new page with the values of the checkboxes. So that was bad but my Form model should be oK. What I don't understant is that I created a Form that I added to my Page. I didn't relate the form to the DefaultDataTable This table has a DataProvider. Do I have to use an instance variable in that provides that would keep the state of my checkboxes? How is this state modified when I modify my InputForm? What is or should be the connection betwee the Form et the DataProvider. How are used the getFilterState and setFilterState of my DataProvider. I know I've got a lack of understanding those concept. What should I read to fill this gap? Thanks a lot! Ox igor.vaynberg wrote: you dont need to do anything in onsubmit, it will automatically reload the current page unless you call setresponsepage to another one. if the values are not sticking after submit that means they are not saved properly, you might want to look at your models. -igor On 7/3/07, Ox [EMAIL PROTECTED] wrote: Hello, I'm trying do display a simple Data Table with a filter on it. I had a look at the wicket-phonebook example because what I have to do is really similar to that example. So I will refer to the code of this example to describe my problem. The thing is I want to have some filter on the table that would add a criteria on a status column (not present in the wicket-phonebook example). This status would be an Integer and I would like to dispay a checkGroup as filter on this status! I don't really understand how the page should reload keeping the filter status (meaning the checked checkboxes) and refreshing the table with the status criteria. (NB I don't want to use Ajax here) Do I have to Implement a load method in my DetachebleContactModel? I succeeded linking the criteria to my query but don't succeed to refresh the page correctly. Can somebody help me with some clues or code example? I putted some of my code here... The rest is really base on the wicket-phonebook example I have seen a similar question in the Filterable ListViews thread but don't really understand how to adapt it in the phonebook example. Thanks a lot, Ox public class ListContactPage extends BasePage { ... public ListContactPage(List statuses) { add(new InputForm(inputForm)); ... RequestDataProvider dataProvider = new ConatctDataProvider( getContactDao(), statuses); DefaultDataTable table = new DefaultDataTable(requestTable, Arrays .asList(columns), dataProvider, 15); // I don't use it // ... addTopToolbar(new FilterToolbar(... add(table); ... } private class InputForm extends Form { public InputForm(String name) { super(name, new CompoundPropertyModel(new FormInputModel())); CheckGroup statusChecks = new CheckGroup(statusCheckGroup); add(statusChecks); ListView statusChecksList = new ListView(statuses, ContactUtil.getStatusCodes()) { protected void populateItem(ListItem item) { item.add(new Check(scheck, item.getModel ())); item.add(new Label(status, item.getModelObjectAsString())); }; }; statusChecks.add(statusChecksList); ... } public void onSubmit(){ info(Search model + getModelObject()); //Do I have to set a ResponsePage here? Or will it automatically remains and reload the current page } } ... } public class ListContactPage extends BasePage { ... public ListContactPage(List statuses) { add(new InputForm(inputForm)); ... RequestDataProvider dataProvider = new ConatctDataProvider( getContactDao(), statuses); DefaultDataTable table = new DefaultDataTable(requestTable, Arrays .asList(columns), dataProvider, 15); // I don't use it // ... addTopToolbar(new FilterToolbar(... add(table); ... } private class InputForm extends Form { public InputForm(String name) { super(name, new CompoundPropertyModel(new FormInputModel())); CheckGroup statusChecks = new
Re: [Wicket-user] Wicket ModalWindow, MaskType and opacity
Unfortunately, there is no control of the opacity. The problem is that for certain browsers, the opacity attribute doesn't work well and we need to use a masking transparent picture. -Matej On 7/4/07, Sean Sullivan [EMAIL PROTECTED] wrote: Hello, I am using a Wicket 1.3.0 SNAPSHOT from the trunk. In the ModalWindow class, there are two masks available: MaskType.TRANSPARENT MaskType.SEMI-TRANSPARENT (10% opacity) Is there a way for me to have finer control of the degree of opacity? I'd love to be able to control it through a Java API. For what its worth, I inspected the Wicket's ModalWindow implementation and noticed that the mask is implemented in the modal.css file: div.wicket-mask-dark { position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; opacity: 0.1; -moz-opacity:0.1; background-color: black; filter: alpha(opacity=10); background-image: url('transparent2.png'); } div.wicket-mask-transparent { position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background-image: url('transparent1.gif'); } Cheers, Sean - 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] Tree - override onNodeLinkClicked(...)?
I believe, that what you want, is not to set response page, but rather to switch panel components. At least that sounds much more reasonable to me. -Matej On 7/4/07, kenixwong [EMAIL PROTECTED] wrote: the reason i using the tree is my menu will be cover a lot of reports ( i m develop the report module). So if using the tree style, the interface will be look more nicer and structure. Plus the dynamic feel to the user :p (more attractive). is that the wicket - tree is hard to maintain? Actually i had build the tree, sub tree and report name. All i listed in array and then called up the array to execute became a tree. Anyway, i found that the wicket example did not show the use of the node link. Any place can help ? As i went through this forum but still cant get any idea to solve it .. :( how ar?? Eelco Hillenius wrote: sorry for understood.. i m not just play around. i wish to build a new module for my current project. And i wish to manage all the menus in a tree style outlook. So, can i get some guide frou u , Eelco .. If you are looking for menus, why not use something like this: http://developer.yahoo.com/yui/menu/? That will be much easier to set up than bending the Tree component into something it is not meant 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 -- View this message in context: http://www.nabble.com/Tree---override-onNodeLinkClicked%28...%29--tf4010264.html#a11426246 Sent from the Wicket - User mailing list archive at Nabble.com. - 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] Why wicket-phonebook 1.3 doesn't reload and run in glassfish?
On Wednesday, July 4, 2007, 3:25:33 AM, Lec [EMAIL PROTECTED] wrote: I have been trying to figure out a reason as to why wicket-phonebook 1.3 couldn't be executed anymore after reloading in glassfish but it can be done in tomcat 5.x...I could reload it in glassfish without seeing error on the glassfish console, but if i type the URL pointing to the wicket-phonebook 1.3 context path, it shows 404 http error.. any idea? would be appreciated if somebody can shed me a light here. upon reloading, the glassfish produces this output on the console What URL are you trying - it looks as if it's loading OK, but I can't be sure where - it looks as if it's either on /wicket-phonebook-1 or /wicket-phonebook-1.2 as a guess, though. Does the Glassfish console show where it thinks it is mapped to? /Gwyn - 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] Can I get a 'Nice URL' when form validation fails?
Thanks for that Dave. It does make sense. But I know the values are stored in the session pagemap, so I'd like to be able to get them from there. I was hoping that a combination of a bookmarked url, and maybe cookie or hidden field, managed by wicket, would be enough for wicket not to stray from my 'nice' bookmarked url, and not to expose wickets inner workings via a url. Cheers. David Leangen-8 wrote: Philip, You need to also include all your form values in the PageParamters, and parse those values in your page, filling each of the fields with those values. Does that make sense? So, your url would be something like: /myPage?field1=blahcheckbox1=true... Cheers, Dave On Tue, 2007-07-03 at 13:48 -0700, Philip Wilkinson wrote: Hi, When my form validation fails, the page is redisplayed with the default url with all its wicket:interface stuff. I'd rather this didn't happen as I've bookmarked the page, and would prefer to have the bookmarked url redisplayed. (the bookmarked url was initially displayed for the page) I've tried overriding Form.onError() { setResponsePage(WelcomePage.class, new PageParameters()); } and that got me my nice bookmarked url, but lost all my form field values. Obviously creating a new page instance. I've also tried Form.onError() { setResponsePage(WelcomePage.this); } Is it possible with wicket to only have the bookmarkable urls visible, without exposing the wicket internals in the url? Thanks in advance Philip Wilkinson. - 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 -- View this message in context: http://www.nabble.com/Can-I-get-a-%27Nice-URL%27-when-form-validation-fails--tf4020865.html#a11429922 Sent from the Wicket - User mailing list archive at Nabble.com. - 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] Can I get a 'Nice URL' when form validation fails?
Philip, But I know the values are stored in the session pagemap, so I'd like to be able to get them from there. I was hoping that a combination of a bookmarked url, and maybe cookie or hidden field, managed by wicket, would be enough for wicket not to stray from my 'nice' bookmarked url, and not to expose wickets inner workings via a url. You got me really curious with this. I can't really help you, but now I really want to know more about this. I checked out the request lifecycle and found this page when googling: http://www.wicket-wiki.org.uk/wiki/index.php/Lifecycle What I'm trying to figure out is where Form.onSubmit() fits in, since this is where you determine the page that you redirect to, and logically (to me) this is where the URL of the next page gets set up. What I can't figure out here is this: when the form's submit button gets pressed on the current page, obvious a new HttpServletRequest gets sent to the server, and the onSubmit() method gets invoked. 1. What URL is sent to the server? 2. Since the response can differ according to the input of the form, this means that the URL could change according to the input... but the URL is already decided on in step 1 Obviously, there's something I'm not getting here. (Eu, experienced Wicket people: feel free to step in any time ;-) In any case, once we can understand this lifecycle issue, we'll be able to figure out whether or not you can achieve what you're trying to do. Regards, David - 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] Image questions
I'm using wicket 1.2.6 and I'd like to display simple gif images. I have the following code in my constructor for WelcomePage: add(new Image(toplogo, new ResourceReference(WelcomePage.class, toplogo.gif))); The html looks like: .. trtd /img/td/tr .. The toplogo.gif is located in the same directory as the WelcomePage. When I load the application the page the images is distorted, it's like somebody has smeared the image. The image looks alright if I display it in an imaging program. The same thing happens with jpg and png images. I'm using maven 2.0.7 and jetty and I'm not sure if this is a wicket, maven or jetty problem. Has any experienced the same problem? The second question is how I should go about to load an image that is located in a resource folder (i.e. src/main/resources). If I just go with add(new Image(toplogo, new ResourceReference(toplogo.gif))), the images is resolved to http://localhost:8080/app/resources/wicket.Application/toplogo.gif, but I want the image to be loaded from the resource root directory. Thanks -- View this message in context: http://www.nabble.com/Image-questions-tf4024374.html#a11430756 Sent from the Wicket - User mailing list archive at Nabble.com. - 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] Passing parameters to PageExpired page
Ah didn't think of that, that'll work. Does Wicket travel up the hierarchy tree to look for the markup file? If ExpiredPage.html doesn't exist, will it use LoginPage.html? Yes janos - 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] Filterable DefaultDatatable
On 7/4/07, Ox [EMAIL PROTECTED] wrote: What I don't understant is that I created a Form that I added to my Page. I didn't relate the form to the DefaultDataTable you need to relate it to the dataprovider rather then the table This table has a DataProvider. Do I have to use an instance variable in that provides that would keep the state of my checkboxes? you can put it there sure, or you can make it a page property and link both form and dataprovider to that: class mypage extends webpage { private boolean showdeletedusers=false; public mypage { Form f=new Form(..); f.add(new checkbox(cb, new PropertyModel(this, showdeletedusers)); ... } private class usersprovider extends dataprovider { public int size() { return dao.countusers(showdeletedusers); } ... } } How is this state modified when I modify my InputForm? dont understand what you mean. What is or should be the connection betwee the Form et the DataProvider. like i said, it can be whatever you want, you are only limited by java How are used the getFilterState and setFilterState of my DataProvider. see the contactsdataprovider in the phonebook I know I've got a lack of understanding those concept. What should I read to fill this gap? i think you should read the models page on the wiki -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] Can I get a 'Nice URL' when form validation fails?
On 7/4/07, David Leangen [EMAIL PROTECTED] wrote: What I can't figure out here is this: when the form's submit button gets pressed on the current page, obvious a new HttpServletRequest gets sent to the server, and the onSubmit() method gets invoked. 1. What URL is sent to the server? the url that is defined in form.action attribute in html. it tells wicket that the form has been submitted, pointing out which one. 2. Since the response can differ according to the input of the form, this means that the URL could change according to the input... but the URL is already decided on in step 1 the url is the same but the post values are different. -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] Image questions
On 7/4/07, Gohan [EMAIL PROTECTED] wrote: I'm using wicket 1.2.6 and I'd like to display simple gif images. I have the following code in my constructor for WelcomePage: add(new Image(toplogo, new ResourceReference(WelcomePage.class, toplogo.gif))); The html looks like: .. trtd /img/td/tr /img? shouldnt that be img/ and then img wicket:id=img/? .. The toplogo.gif is located in the same directory as the WelcomePage. When I load the application the page the images is distorted, it's like somebody has smeared the image. not sure, never seen that happen. try setting width/height on the img tag - longshot, but hay :) The second question is how I should go about to load an image that is located in a resource folder (i.e. src/main/resources). If I just go with add(new Image(toplogo, new ResourceReference(toplogo.gif))), the images is resolved to http://localhost:8080/app/resources/wicket.Application/toplogo.gif, but I want the image to be loaded from the resource root directory. files in src/main/resources get copied directly into classes dir - that means for all intents and purposes they are in the default package. you need to have a class in the default package you can use as a scope. -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] Can I get a 'Nice URL' when form validation fails?
On 7/4/07, Philip Wilkinson [EMAIL PROTECTED] wrote: Thanks for that Dave. It does make sense. But I know the values are stored in the session pagemap, so I'd like to be able to get them from there. I was hoping that a combination of a bookmarked url, and maybe cookie or hidden field, managed by wicket, would be enough for wicket not to stray from my 'nice' bookmarked url, and not to expose wickets inner workings via a url. the cookie idea mightve worked, but it would mean that we would have to rewrite every link to set the cookie, so essentially wicket will not work without javascript. :| -igor Cheers. David Leangen-8 wrote: Philip, You need to also include all your form values in the PageParamters, and parse those values in your page, filling each of the fields with those values. Does that make sense? So, your url would be something like: /myPage?field1=blahcheckbox1=true... Cheers, Dave On Tue, 2007-07-03 at 13:48 -0700, Philip Wilkinson wrote: Hi, When my form validation fails, the page is redisplayed with the default url with all its wicket:interface stuff. I'd rather this didn't happen as I've bookmarked the page, and would prefer to have the bookmarked url redisplayed. (the bookmarked url was initially displayed for the page) I've tried overriding Form.onError() { setResponsePage( WelcomePage.class, new PageParameters()); } and that got me my nice bookmarked url, but lost all my form field values. Obviously creating a new page instance. I've also tried Form.onError() { setResponsePage(WelcomePage.this); } Is it possible with wicket to only have the bookmarkable urls visible, without exposing the wicket internals in the url? Thanks in advance Philip Wilkinson. - 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 -- View this message in context: http://www.nabble.com/Can-I-get-a-%27Nice-URL%27-when-form-validation-fails--tf4020865.html#a11429922 Sent from the Wicket - User mailing list archive at Nabble.com. - 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] Modifying attributes of tabs in TabbedPanel
Hi, I'm trying to update the provided TabbedPanel to be able to provide a new CSS style to each tab so I can control the color of each tab. I tried subclassing TabbedPanel and adding this method: @Override protected void onBeforeRender() { super.onBeforeRender(); // get each tab and add a style for (int i = 0; i getTabs().size(); i++) { Component tab = get(tabs-container:tabs: + i); tab.add(new AttributeAppender(class, true, new Model(tab+i), )); } } This doesn't work (Null Pointer) because this method gets called before the actual tabs are added. I tried using onAfterRender(). This time the tabs exist, but I can't modify the hierarchy during rendering. Is there a way I can accomplish what I want without forking the TabbedPanel class? Thanks for your help, Erik - 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] Model.getObject non-processing form submits
Hi How do I make that IModel.getObject of FormComponets gets called on every request? I have a form, wich dislpays a record from a database. On the form I have put buttons for navigation - previos and next records and so on. These buttons have DefaultFormProcessing set to false (needs to be, dont want validation when navigating away from the record) - and then... the form values are not updated from the model .. I must be missing something. ??? Thanks -- View this message in context: http://www.nabble.com/Model.getObject---non-processing-form-submits-tf4025837.html#a11435288 Sent from the Wicket - User mailing list archive at Nabble.com. - 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] Model.getObject non-processing form submits
Thank god, I fixed it :) I had to iterate trough FormComponents and call valid(). modelChanged() shoud work also, I think. -- View this message in context: http://www.nabble.com/Model.getObject---non-processing-form-submits-tf4025837.html#a11435495 Sent from the Wicket - User mailing list archive at Nabble.com. - 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] Can I get a 'Nice URL' when form validation fails?
I've thought of a way of making my question clearer. I have a web page with a form which is accessed thru a bookmarked url so the address looks like http://localhost:8080/MyApp/myform I submit the form and the validation fails, the url in the address bar now looks like this http://localhost:8080/MyApp/myform?wicket:interface=:0::: I'd prefer not to see the ?wicket:interface=:0::: in the url. It's a implementation detail that nobody needs to see. Its not book-markable anymore, and it gives any malicious hacker out there too much info. Is theres any way I can get wicket just to show the bookmarked url when it redisplays the page? Cheers, Phil. igor.vaynberg wrote: On 7/4/07, David Leangen [EMAIL PROTECTED] wrote: What I can't figure out here is this: when the form's submit button gets pressed on the current page, obvious a new HttpServletRequest gets sent to the server, and the onSubmit() method gets invoked. 1. What URL is sent to the server? the url that is defined in form.action attribute in html. it tells wicket that the form has been submitted, pointing out which one. 2. Since the response can differ according to the input of the form, this means that the URL could change according to the input... but the URL is already decided on in step 1 the url is the same but the post values are different. -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 -- View this message in context: http://www.nabble.com/Can-I-get-a-%27Nice-URL%27-when-form-validation-fails--tf4020865.html#a11436161 Sent from the Wicket - User mailing list archive at Nabble.com. - 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] London Wicket Event - Tuesday, 7th August, 2007
The first London Wicket Users Group went well; it was informative, interesting and entertaining. Our generous hosts at Arclight Media took really good care of us and Matt Dudbridge rounded the evening off with a nice presentation about the impressive http://zoomf.com zoomf.com . Alastair Maw's depth of knowledge was quite remarkable (and presumably still is). During his presentation he effortlessly demonstrated what he was telling us about by coding it in real time whilst also answering all sorts of questions comprehensively and with great clarity. Attendees were not slow to express their thanks and how impressed they were with the presentations and, naturally, with Wicket. So, perhaps we should do it again ... only this time, Al has offered to help attendees with their Wicket apps if they want to bring their laptops along! If you are interested in coming along or if there are topics you'd like to talk about, or things you'd like someone else to talk about, contact us at the http://jWeekend.co.uk jWeekend.com site or reply on this thread. It does appear that there is enough interest to make this a regular event, provisionally on the first Tuesday of every month. Let us know how that sounds. Cemal -- View this message in context: http://www.nabble.com/London-Wicket-Event---Tuesday%2C-7th-August%2C-2007-tf4026461.html#a11437291 Sent from the Wicket - User mailing list archive at Nabble.com. - 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] inline frame usage
Hi,New to wickets - trying to figure out how to dynamically add i fra mes to a page.Both the url to be set in the iframe and the body of the I want to dynamically add i fr ames to external urls (i.e. urls not in the wicket pkg. - some external entities. , i.e. i do not know how many of these frame I will have to add or where they are pointed to - until the request is made. How do I achive this? Inline Frames need some parameters that don't seem to make sense in this scenario.would appreciate help/pointers in this regard.thanks,ed _ Don't get caught with egg on your face. Play Chicktionary! http://club.live.com/chicktionary.aspx?icid=chick_wlmailtextlink- 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] Problem with the InlineFrame
I would like to use the InlineFrame, but the InlineFrame does not work. The codes are as follows: body span wicket:id=libBorder iframe wicket:id=bFrame src=[source] name=bottom/ /span /body public class Map extends WebPage { public static final String BOTTOM_FRAME_NAME = bottom; public Map(final PageParameters pps) { Border borderUser = new LibBorderUser(libBorder); add(borderUser); InlineFrame iframe = new InlineFrame(bFrame, PageMap.forName(BOTTOM_FRAME_NAME),Display.class); add(iframe); } } Can you tell us more of what goes wrong and what version of Wicket you are using? And out of curiousity, why use an inline frame? 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] DatePicker broken on beta2 and snapshot?
On 7/4/07, Gerolf Seitz [EMAIL PROTECTED] wrote: eelco, speaking of wicket-datetime. is it possible to change the default implementation of notifyComponentOnDateSelected to return true? when telling other people (happend twice up to now) about how to use the datepicker, i always felt the urge to tell them to override this method if they wanted onchange notification. still i think this is actually what would be expected to be the default behavior (the onchange notification), since the value of the associated component does change. Yeah, makes sense, especially because it doesn't typically do any harm. what do you think? Committed the change. anyway, sorry if this issue demands more time than it actually might deserve, due to not enough thinking in the first place... Not at all. It can take many iterations before it's perfect, and I'm glad people are thinking with us. :) Cheers, 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] Foldable border
I'm trying to create a foldable box component - not unlike the quick contacts and labels boxes in gmail. I want to render some markup around a border's contents - particulary, an open/close link. So far, I've made it toggle the value of Border.setBorderBodyVisible() and it works fine. But. I also want to skip the loading of the contents of borders, that are initially rendered closed. I though the deal would be to just borderBodyVisible to false and not to put any components in it at all, but unfortunatelly wicket raises an exception that components with coresponding names cannot be found in the hierarchy. Only in development mode, is that correct? If you turn the hierarchy check off, it might work. This was not the behavior I was expecting, since after Component.setVisible(false) it doesn't check the markup for matching components. Or just make sure the hierarchy does match, even if it's just with dummy components. They won't actualy be rendered anyway. 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] inline frame usage
New to wickets - trying to figure out how to dynamically add i fra mes to a page. Both the url to be set in the iframe and the body of the I want to dynamically add i fr ames to external urls (i.e. urls not in the wicket pkg. - some external entities. , i.e. i do not know how many of these frame I will have to add or where they are pointed to - until the request is made. How do I achive this? Inline Frames need some parameters that don't seem to make sense in this scenario. I think you can just use iframe tags and do something like this: add(new WebMarkupContainer(iframe) { protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put(src, http://wicketframework.org/;); } }); or add(new WebMarkupContainer(iframe).add(new SimpleAttributeModifier(src, http://wicketframework.org/;))); 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] RestartResponseAtInterceptPageException / continueToOriginalDestination
I have an authorization scheme where by the user is presented with a sign in page. After signing in, a check is made to see if they need to change their password. If so, they are redirected to a change password page. After that they should be redirected back to their intended page. However, if I use a RestartResponseAtInterceptPageException(); to go to the password change page from the sign in page, after submission I get directed back to the sign in page. Can I specify the intended original destination without setting a response page and passing it as a page parameter? Thank you, You could have your authorization strategy check the destination (the page that the user is trying to create) and if it is the login page and the user is already logged in, you could redirect to some home. That should work for your case. 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] Passing parameters to PageExpired page
Ah didn't think of that, that'll work. Does Wicket travel up the hierarchy tree to look for the markup file? If ExpiredPage.html doesn't exist, will it use LoginPage.html? Yes That's a nice idea. But for the record, alternatively you could use a custom request cycle, override public Page onRuntimeException(Page page, RuntimeException e) and test for PageExpiredException and pass any parameters you like. 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] State selection from imagemap
I know this is long winded, and I apologize. But it would be nice to know the best way to deal with a large imagemap like this. I would be happy to post this information on the wiki, but I don't want to do it if there are better solutions. So any advice would be appreciated. Tbh, I never use image maps myself, so I wouldn't be able to give you advice backed by experience. If you think your component would be a good addition, we could consider putting it in Wicket. For instance as part of the wicket-stuff mini's project, or if you think it really solves a common problem, we could vote to see whether we could put it in wicket-extensions. If you think this makes sense, please open up a JIRA issue and attache your sources (preferably as a patch). Thanks, 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
[Wicket-user] Dataview and panels
I am trying to render two columns of panels of a given type on a page.I want to use the dataview to get the content from the DB and make use of the pagenavigation.I want to set up a maximum of 5 panels per column and essentially have navigation to the next page if there is more to render.All examples of Dataview are for tables rendering multiple columns or a given type.Is there a better way to think about this to get the desired result. If not how would one use DataView to do it.thanks!ed _ Don't get caught with egg on your face. Play Chicktionary! http://club.live.com/chicktionary.aspx?icid=chick_wlmailtextlink- 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] Modifying attributes of tabs in TabbedPanel
On 7/4/07, Erik Dreyer [EMAIL PROTECTED] wrote: Hi, I'm trying to update the provided TabbedPanel to be able to provide a new CSS style to each tab so I can control the color of each tab. I tried subclassing TabbedPanel and adding this method: @Override protected void onBeforeRender() { super.onBeforeRender(); // get each tab and add a style for (int i = 0; i getTabs().size(); i++) { Component tab = get(tabs-container:tabs: + i); tab.add(new AttributeAppender(class, true, new Model(tab+i), )); } } This doesn't work (Null Pointer) because this method gets called before the actual tabs are added. I tried using onAfterRender(). This time the tabs exist, but I can't modify the hierarchy during rendering. Is there a way I can accomplish what I want without forking the TabbedPanel class? Thanks for your help, Erik No response. Let me rephrase the question more generally. How can a component manipulate the component hierarchy of its children if those children don't expose their inner structure? It seems the components render from the top down. That is, a parent is rendered before its children. Is that correct? What if a parent wants to modify its children in onBeforeRender(), but can't because performing a get(path:to:child) results in a NPE? Is there a way to do so? See my original post for an example of why I might want to do this. Thanks, Erik - 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] Dataview and panels
On 7/4/07, Ed _ [EMAIL PROTECTED] wrote: I am trying to render two columns of panels of a given type on a page. I want to use the dataview to get the content from the DB and make use of the pagenavigation. I want to set up a maximum of 5 panels per column and essentially have navigation to the next page if there is more to render. All examples of Dataview are for tables rendering multiple columns or a given type. Is there a better way to think about this to get the desired result. If not how would one use DataView to do it. i cant picture exactly what you want -igor thanks! ed -- Don't get caught with egg on your face.Play Chicktionary! http://club.live.com/chicktionary.aspx?icid=chick_wlmailtextlink - 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] Modifying attributes of tabs in TabbedPanel
On 7/4/07, Erik Dreyer [EMAIL PROTECTED] wrote: Hi, I'm trying to update the provided TabbedPanel to be able to provide a new CSS style to each tab so I can control the color of each tab. I tried subclassing TabbedPanel and adding this method: @Override protected void onBeforeRender() { super.onBeforeRender(); // get each tab and add a style for (int i = 0; i getTabs().size(); i++) { Component tab = get(tabs-container:tabs: + i); tab.add(new AttributeAppender(class, true, new Model(tab+i), )); } } This doesn't work (Null Pointer) because this method gets called before the actual tabs are added. I tried using onAfterRender(). This time the tabs exist, but I can't modify the hierarchy during rendering. Is there a way I can accomplish what I want without forking the TabbedPanel class? the short answer is: you cannot. the point of tabbedpanel is to encapsulate a lot of these details so you do not have to worry about it. the ease of use comes at a price - not everything is customizable to everyone's content. so there are two options to solve this a) you can roll your own tabbed panel (which in wicket is not very hard, the original has about 30-40 lines of code that make it tick? b) we can add this functionality to the tabbed pael in core, making it a bit more bloated. i dont mind (b) if its just adding tab1, tab2 class attributes. -igor Thanks for your help, Erik - 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] Can I get a 'Nice URL' when form validation fails?
On Wed, 2007-07-04 at 12:14 -0700, Philip Wilkinson wrote: I've thought of a way of making my question clearer. I have a web page with a form which is accessed thru a bookmarked url so the address looks like http://localhost:8080/MyApp/myform I submit the form and the validation fails, the url in the address bar now looks like this http://localhost:8080/MyApp/myform?wicket:interface=:0::: I'd prefer not to see the ?wicket:interface=:0::: in the url. It's a implementation detail that nobody needs to see. Its not book-markable anymore, and it gives any malicious hacker out there too much info. Is theres any way I can get wicket just to show the bookmarked url when it redisplays the page? Oh... If that's all you need... Why not just use nice urls? Note that if you don't include any page parameters (or some other way of retrieving the data), your user will have to fill in all the form details from scratch... not sure that's what you want. Cheers, Dave - 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] Can I get a 'Nice URL' when form validation fails?
Thanks, Igor, that makes sense. But still one more question before I really understand onSubmit(): I could have this in my onSubmit: if( isValidated ) setResponsePage( PageOne.class ); else setResponsePage( PageTwo.class ); So, what gets sent back in the HttpServletResponse is different according to the validation of the form (data being sent via POST and handled in the background by Wicket). Are you saying that in either case, the URL would be the same (i.e. the one generated by Wicket magic and seen in the html of the form), but the content of reply would be different depending on whether it's PageOne or PageTwo? If so... it all makes sense to me now... :-) Very smart, too! On Wed, 2007-07-04 at 07:34 -0700, Igor Vaynberg wrote: On 7/4/07, David Leangen [EMAIL PROTECTED] wrote: What I can't figure out here is this: when the form's submit button gets pressed on the current page, obvious a new HttpServletRequest gets sent to the server, and the onSubmit() method gets invoked. 1. What URL is sent to the server? the url that is defined in form.action attribute in html. it tells wicket that the form has been submitted, pointing out which one. 2. Since the response can differ according to the input of the form, this means that the URL could change according to the input... but the URL is already decided on in step 1 the url is the same but the post values are different. -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 - 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] Can I get a 'Nice URL' when form validation fails?
On 7/4/07, David Leangen [EMAIL PROTECTED] wrote: Thanks, Igor, that makes sense. But still one more question before I really understand onSubmit(): I could have this in my onSubmit: if( isValidated ) setResponsePage( PageOne.class ); else setResponsePage( PageTwo.class ); So, what gets sent back in the HttpServletResponse is different according to the validation of the form (data being sent via POST and handled in the background by Wicket). Are you saying that in either case, the URL would be the same (i.e. the one generated by Wicket magic and seen in the html of the form), but the content of reply would be different depending on whether it's PageOne or PageTwo? this is what happens in a nutshell you pull up a page that has a form, wicket has already generated an action url for that form that points back to that page. this url cannot be pretty because it points to a specific instance of a page wicket holds in session. you submit the form, the url in action is invoked and hits the page, along with page parameters in post. lets say validation fails - that means your form.onsubmit() is never called. what wicket does is redirect to a url that will render the current page again back to the user (it doesnt have to redirect, but it does by default - see redirect-after-post pattern for details). this url also cannot be pretty because it points to a specific instance of a page in session - this is the url you will see when validation fails. now if validation succeeds and your onsubmit() is called which does setresponsepage(MyPage.class) then you will be redirected to a pretty url given that MyPage is mounted. now if you want to maintain pretty url throughout then you might want to try using a statelesspage and a stateless form. however, notice that you would only be allowed to have stateless components on that page (components that do not generate a callback back to themselves - images, regular Links, etc) hope this helps some -igor If so... it all makes sense to me now... :-) Very smart, too! On Wed, 2007-07-04 at 07:34 -0700, Igor Vaynberg wrote: On 7/4/07, David Leangen [EMAIL PROTECTED] wrote: What I can't figure out here is this: when the form's submit button gets pressed on the current page, obvious a new HttpServletRequest gets sent to the server, and the onSubmit() method gets invoked. 1. What URL is sent to the server? the url that is defined in form.action attribute in html. it tells wicket that the form has been submitted, pointing out which one. 2. Since the response can differ according to the input of the form, this means that the URL could change according to the input... but the URL is already decided on in step 1 the url is the same but the post values are different. -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 - 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] Modifying attributes of tabs in TabbedPanel
snip b) we can add this functionality to the tabbed pael in core, making it a bit more bloated. i dont mind (b) if its just adding tab1, tab2 class attributes. /snip That would be much appreciated... item.add(new AttributeAppender(class, true, new Model(tab+index), )); On 7/4/07, Igor Vaynberg [EMAIL PROTECTED] wrote: On 7/4/07, Erik Dreyer [EMAIL PROTECTED] wrote: Hi, I'm trying to update the provided TabbedPanel to be able to provide a new CSS style to each tab so I can control the color of each tab. I tried subclassing TabbedPanel and adding this method: @Override protected void onBeforeRender() { super.onBeforeRender(); // get each tab and add a style for (int i = 0; i getTabs().size(); i++) { Component tab = get(tabs-container:tabs: + i); tab.add(new AttributeAppender(class, true, new Model(tab+i), )); } } This doesn't work (Null Pointer) because this method gets called before the actual tabs are added. I tried using onAfterRender(). This time the tabs exist, but I can't modify the hierarchy during rendering. Is there a way I can accomplish what I want without forking the TabbedPanel class? the short answer is: you cannot. the point of tabbedpanel is to encapsulate a lot of these details so you do not have to worry about it. the ease of use comes at a price - not everything is customizable to everyone's content. so there are two options to solve this a) you can roll your own tabbed panel (which in wicket is not very hard, the original has about 30-40 lines of code that make it tick? b) we can add this functionality to the tabbed pael in core, making it a bit more bloated. i dont mind (b) if its just adding tab1, tab2 class attributes. -igor Thanks for your help, Erik - 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] Dataview and panels
Maybe this helps---| _Prev /1/2/Next_ ||| P1 | | P2 | || - --- || _ | || P3 | | P4 | | | - --- || _ | || P5 | | P6 | | | - --- || _ | || P7 | | P8 | | | - --- || _ | || P7 | | P8 | | | - --- | ---Where Panels are being rendered based on a DB query - essentially a two column representation instead of a single list that most DataView examples show.-edDate: Wed, 4 Jul 2007 19:56:56 -0700From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: Re: [Wicket-user] Dataview and panelsOn 7/4/07, Ed _ [EMAIL PROTECTED] wrote: I am trying to render two columns of panels of a given type on a page.I want to use the dataview to get the content from the DB and make use of the pagenavigation.I want to set up a maximum of 5 panels per column and essentially have navigation to the next page if there is more to render. All examples of Dataview are for tables rendering multiple columns or a given type.Is there a better way to think about this to get the desired result. If not how would one use DataView to do it. i cant picture exactly what you want-igor thanks! edDon't get caught with egg on your face. Play Chicktionary! -This SF.net email is sponsored by DB2 ExpressDownload DB2 Express C - the FREE version of DB2 express and takecontrol 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 _ Local listings, incredible imagery, and driving directions - all in one place! Find it! http://maps.live.com/?wip=69FORM=MGAC01- 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] Can I get a 'Nice URL' when form validation fails?
Igor, hope this helps some Yep. Helps me to understand how this works. Very clever. Thanks! Hopefully it will also help Philip, who was asking the questions about this. Cheers, Dave On Wed, 2007-07-04 at 20:31 -0700, Igor Vaynberg wrote: On 7/4/07, David Leangen [EMAIL PROTECTED] wrote: Thanks, Igor, that makes sense. But still one more question before I really understand onSubmit(): I could have this in my onSubmit: if( isValidated ) setResponsePage( PageOne.class ); else setResponsePage( PageTwo.class ); So, what gets sent back in the HttpServletResponse is different according to the validation of the form (data being sent via POST and handled in the background by Wicket). Are you saying that in either case, the URL would be the same (i.e. the one generated by Wicket magic and seen in the html of the form), but the content of reply would be different depending on whether it's PageOne or PageTwo? this is what happens in a nutshell you pull up a page that has a form, wicket has already generated an action url for that form that points back to that page. this url cannot be pretty because it points to a specific instance of a page wicket holds in session. you submit the form, the url in action is invoked and hits the page, along with page parameters in post. lets say validation fails - that means your form.onsubmit() is never called. what wicket does is redirect to a url that will render the current page again back to the user (it doesnt have to redirect, but it does by default - see redirect-after-post pattern for details). this url also cannot be pretty because it points to a specific instance of a page in session - this is the url you will see when validation fails. now if validation succeeds and your onsubmit() is called which does setresponsepage(MyPage.class) then you will be redirected to a pretty url given that MyPage is mounted. now if you want to maintain pretty url throughout then you might want to try using a statelesspage and a stateless form. however, notice that you would only be allowed to have stateless components on that page (components that do not generate a callback back to themselves - images, regular Links, etc) hope this helps some - 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] Dataview and panels
On 7/4/07, Ed _ [EMAIL PROTECTED] wrote: Maybe this helps --- | _Prev /1/2/Next_ | | | P1 | |P2| | | - --- | | _ | | | P3 | |P4| | | - --- | | _ | | | P5 | |P6| | | - --- | | _ | | | P7 | |P8| | | - --- | | _ | | | P7 | |P8| | | - --- | --- Where Panels are being rendered based on a DB query - essentially a two column representation instead of a single list that most DataView examples show. ah, that does help. see GridView, set its column count to two and you will have what you want -igor -ed -- Date: Wed, 4 Jul 2007 19:56:56 -0700 From: [EMAIL PROTECTED] To: wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] Dataview and panels On 7/4/07, *Ed _* [EMAIL PROTECTED] wrote: I am trying to render two columns of panels of a given type on a page. I want to use the dataview to get the content from the DB and make use of the pagenavigation. I want to set up a maximum of 5 panels per column and essentially have navigation to the next page if there is more to render. All examples of Dataview are for tables rendering multiple columns or a given type. Is there a better way to think about this to get the desired result. If not how would one use DataView to do it. i cant picture exactly what you want -igor thanks! ed -- Don't get caught with egg on your face.Play Chicktionary! http://club.live.com/chicktionary.aspx?icid=chick_wlmailtextlink - 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 -- Local listings, incredible imagery, and driving directions - all in one place! Find it! http://maps.live.com/?wip=69FORM=MGAC01 - 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] Modifying attributes of tabs in TabbedPanel
On Wed, 04 Jul 2007, Erik Dreyer wrote: snip b) we can add this functionality to the tabbed pael in core, making it a bit more bloated. i dont mind (b) if its just adding tab1, tab2 class attributes. /snip That would be much appreciated... item.add(new AttributeAppender(class, true, new Model(tab+index), )); Or maybe there could just be a hook in the protected void populateItem(LoopItem item) method inside TabbedPanel, something like in the attached patch. - Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ Index: wicket-extensions/src/test/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanelTest.java === --- wicket-extensions/src/test/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanelTest.java (revision 0) +++ wicket-extensions/src/test/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanelTest.java (revision 0) @@ -0,0 +1,80 @@ +package org.apache.wicket.extensions.markup.html.tabs; + +import junit.framework.TestCase; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.list.Loop; +import org.apache.wicket.markup.html.panel.EmptyPanel; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.model.Model; +import org.apache.wicket.util.tester.TestPanelSource; +import org.apache.wicket.util.tester.WicketTester; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Timo Rantalaiho + */ +public class TabbedPanelTest extends TestCase { +private WicketTester wicket; + +protected void setUp() throws Exception +{ +wicket = new WicketTester(); +} + +public void testAllowsCustomCssClassesForTabs() +{ +wicket.startPanel(new TestPanelSource() { +public Panel getTestPanel(final String panelId) +{ +return new TabbedPanel(panelId, createTabs()) +{ +protected void afterPopulateItem(Loop.LoopItem item, final boolean selected, boolean last) +{ +int index = item.getIteration(); +item.add(new AttributeAppender(class, true, new Model(tab + index), )); +} +}; +} +}); +String dogsClass = class=\tab0\; +String catsClass = class=\tab1\; + +wicket.assertContains(Dogs); +wicket.assertContains(Cats); +wicket.assertContains(dogsClass); +wicket.assertContains(catsClass); + +clickCatsLink(); +wicket.assertContains(dogsClass); +wicket.assertContains(catsClass); +} + +private void clickCatsLink() +{ +TabbedPanel panel = (TabbedPanel) wicket.getComponentFromLastRenderedPage(panel); +Link catsLink = (Link) panel.get(tabs-container:tabs:1:link); +wicket.clickLink(catsLink.getPageRelativePath()); +} + +private List createTabs() +{ +List tabs = new ArrayList(); +tabs.add(createTestTab(Dogs)); +tabs.add(createTestTab(Cats)); +return tabs; +} + +private ITab createTestTab(final String title) +{ +return new AbstractTab(new Model(title)) +{ +public Panel getPanel(final String panelId) +{ +return new EmptyPanel(panelId); +} +}; +} +} Index: wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.java === --- wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.java (revision 553372) +++ wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.java (working copy) @@ -16,8 +16,6 @@ */ package org.apache.wicket.extensions.markup.html.tabs; -import java.util.List; - import org.apache.wicket.Component; import org.apache.wicket.WicketRuntimeException; import org.apache.wicket.behavior.AttributeAppender; @@ -32,7 +30,9 @@ import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; +import java.util.List; + /** * TabbedPanel component represets a panel with tabs that are used to switch * between different content panels inside the TabbedPanel panel. @@ -155,21 +155,9 @@ titleLink.add(newTitle(title, tab.getTitle(), index)); item.add(titleLink); - item.add(new SimpleAttributeModifier(class, selected) - { - private static final long serialVersionUID = 1L; - - public boolean isEnabled(Component component) - { -
Re: [Wicket-user] onSubmit() called twice
On Tue, 03 Jul 2007, Igor Vaynberg wrote: the problem here is that onchange is fired when the focus is lost from the field. so if you are on that field and you click the submit button this will result in two form-submittals that are very very close to each other. thus the double submit that you see. you should add validatingbehavior to onkeyup, and make sure to set a throttle so it doesnt flood your server. ...but with onkeyup, you don't get cut and paste mouse events, nor browser autocomplete. In 1.3.0 trunk there is the new OnChangeAjaxBehavior by Janne; we've been prototyping it and the approach seems very promising. Autocomplete is all you lose, other editing seems to work at least on Firefox 2 and IE 7. The failure of the HTML spec and browser implementations in such an essential and technically trivial thing (available since the 1980s on desktop?) is a prime example of the limitations of the web as an UI platform. - Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - 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