Re: Saving data in interim states of IWizard
Hi Why not do thé job in applyState() method ? Le lundi 14 mars 2011, tech7 [via Apache Wicket] ml-node+3354469-1631656439-216...@n4.nabble.com a écrit : I have couple of steps in my IWizard application. I have Save button on my interim steps. I have to save the object in this state before the confirmation step but I do not know how to do? Can you give any suggestion? With my best regards. Developer Wicket Java JSP If you reply to this email, your message will be added to the discussion below: http://apache-wicket.1842946.n4.nabble.com/Saving-data-in-interim-states-of-IWizard-tp3354469p3354469.html To start a new topic under Users forum, email ml-node+1842947-98389252-216...@n4.nabble.com To unsubscribe from Users forum, click here http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=1842947code=cmNvcXVldWduaW90QGdtYWlsLmNvbXwxODQyOTQ3fDE1MTA1ODc1MTA=. -- R -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Saving-data-in-interim-states-of-IWizard-tp3354469p3355935.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: New Wicket tutorial series
Hi, Thank you for tutorials. Someone with less knowledge (like me :-) can find them useful. I think it would be easier to follow tutorials if it were made by something like wink (especially where you have longer code with 6-7 points that are referenced) But, I can understand that it would be much less SEO friendly... One thing that comes regularly - some getting started Authentication Authorization ? Thank you and regards, Igor 2011/3/14 Tomasz Dziurko tdziu...@gmail.com But maybe some hints what could be improved/added/changed :) I would be happy for any of these kind of comments. -- Best regards, Tomasz Dziurko http://www.programatico.pl/
Re: Checking the checkboxes of CheckBoxMultipleChoice
Hi, this code is weird: listChoice.setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setModelObject(locationsInput.listAsSet()); because CompoundPropertyModel is useful to use nested components id as property expressions If details in form submit code is an LocationsInput, then the user input will never be considered. At listAsSet an new collection is created and passed as parameter to listChoice: class LocationsInput { public HashSetLocation listAsSet(){ return new HashSetLocation(locations); } } And a new one is used to be persisted: onSubmit{ details.setLocations(locationsInput.listAsSet()); up.persist(details); } On Mon, Mar 14, 2011 at 2:53 PM, Sjoerd Smeets ssme...@gmail.com wrote: Hi, I'm facing an issue where I'm not able to check the checkboxes of a list of Locations that are already have been persisted in the Details object (similar like the preselection of checkboxes). I followed the CheckBoxMultipleChoicePage example (example http://wicketstuff.org/wicket13/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.CheckBoxMultipleChoicePage ). So basically when a user wants to edit their detail page, it should select the checkboxes of the locations the user already selected. saving the form works fine, so when I select locations, it is persisted correctly to the details object. Could someone indicate what I am missing? I have the following code: public class DetailsPage extends Panel { private final ListLocation LOCATIONS = getLocs(); public void generateForm(){ final LocationsInput locationsInput = new LocationsInput(details); add(new FeedbackPanel(feedBack)); Form editDetails = new Form(detailsForm){ protected void onSubmit() { detailsPersistence up = new detailsPersistence(); details.setLocations(locationsInput.listAsSet()); logger.info(Saving the following locs: {},locationsInput.toString()); if(newdetails){ up.editDetails(details); } else { up.updatedetails(details); } setResponsePage(OverViewDetailssPage.class); } }; ... CheckBoxMultipleChoiceLocation listChoice = new CheckBoxMultipleChoiceLocation(locations, LOCATIONS); listChoice.setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setModelObject(locationsInput.listAsSet()); editDetails.add(listChoice); add(editDetails); } private static class LocationsInput implements IClusterable { /** the selected sites. */ public ListLocation locations = new ArrayList(); public LocationsInput(){ Location roermond = new Location(); roermond.setName(Roermond); locations.add(roermond); } /** adds pre-selected items to the choices list */ public LocationsInput(details details) { SetLocation locs = details.getLocations(); for(Location loc : locs){ logger.info(details has {} as a location.,loc.getName()); locations.add(loc); } } @Override public String toString(){ return locations = + listAsString(locations); } private String listAsString(ListLocation list){ StringBuffer b = new StringBuffer(); for (IteratorLocation i = list.iterator(); i.hasNext();){ b.append(i.next().getName()); if(i.hasNext()){ b.append(, ); } } return b.toString(); } public String[] listAsStringArray(){ String[] locNames = new String[locations.size()]; int i =0; for(Location loc : locations){ locNames[i] = loc.getName(); i++; } for(String l : locNames){ logger.info(String array: {},l); } return locNames; } public HashSetLocation listAsSet(){ return new HashSetLocation(locations); } } private ListLocation getLocs(){ LocationPersistence up4 = new LocationPersistence(); return up4.getAllLocations(); } } -- Pedro Henrique Oliveira dos Santos
Re: Wicket Wizard Step iComplete and Validation
Hi, while validators are being tested the form is not fully processed, so it is not a good place to test if the wizard step is complete. On Wed, Mar 9, 2011 at 3:20 PM, xFlasH rcoqueugn...@gmail.com wrote: Hi everyone, In a quite complex wizard Wicket based application, I have filled a WizardModel with many steps. Each of those steps required some mandatories inputs, which are validated against Wicket IValidator mechanism. The overview component of the Wizard is implemented with a custom WizardNavigator which list the wizard steps with their complete attribute (checkbox). Would it be possible to map the isComplete attribute of one Step with the wicket validation engine result ? Thanks a lot for your answer and for the great piece of code Wicket is ! R -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Wizard-Step-iComplete-and-Validation-tp3344208p3344208.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos
update label using (Ajax)Link
Hi, I try to update a component (vorname within my example) once the user click on a link within a table. (In fact it doesn't matter if it is an ajax link or a normal one. My example is using an ajax link.) This im my JAVA code: public class Test extends WebPage { private Eintrag selectedEintrag = new Eintrag(); public Test( PageParameters parameters ) { ArrayList listEintraege = ladeEintraege( parameters ); final Label vorname = new Label( Vorname, selectedEintrag.getVorname() ); //just empty in first instance auswahlVorname.setOutputMarkupId( true ); add( auswahlVorname ); add( new ListView( List, listEintraege ) { protected void populateItem( final ListItem item ) { Eintrag eintrag = item.getModelObject(); item.add( new Label( Info, eintrag.getInfo() ) ); item.add(new AjaxFallbackLink(Details_Link){ @Override public void onClick( AjaxRequestTarget target ) { selectedEintrag = item.getModelObject(); target.addComponent( vorname ); } }); } }); } } Can anybody provide me some information's why this is not working (no update at all)? Isn't it possible to bind my Label component to a private property and update this property during the onclick method? Thanks in advance. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/update-label-using-Ajax-Link-tp3356575p3356575.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Set FormComponent Type and EmailValidator
After submitting a form: add(new Form(form) // .add(new TextField(text, new Model(), String.class) // .add(EmailAddressValidator.getInstance( with empty field the fallowing error occur:('' is not a valid email address.) Without setting type for TextField - all fine -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Set-FormComponent-Type-and-EmailValidator-tp3356588p3356588.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Checking the checkboxes of CheckBoxMultipleChoice
Hi Pedro, Thanks for your reply. I'm not sure if I understand what you mean with use nested components id as property expressions. The persisting part works fine with this code, however checking the correct boxes when the details page opens does not work. I have tried the following: setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setModelObject(locationsInput.listAsSet()); and they all persist the check checkboxes correctly when the user hits the submit button, but when reopening the page, the checkboxes are not checked. What is the easiest way to do this? Thanks again, Sjoerd On Tue, Mar 15, 2011 at 7:40 AM, Pedro Santos pedros...@gmail.com wrote: Hi, this code is weird: listChoice.setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setModelObject(locationsInput.listAsSet()); because CompoundPropertyModel is useful to use nested components id as property expressions If details in form submit code is an LocationsInput, then the user input will never be considered. At listAsSet an new collection is created and passed as parameter to listChoice: class LocationsInput { public HashSetLocation listAsSet(){ return new HashSetLocation(locations); } } And a new one is used to be persisted: onSubmit{ details.setLocations(locationsInput.listAsSet()); up.persist(details); } On Mon, Mar 14, 2011 at 2:53 PM, Sjoerd Smeets ssme...@gmail.com wrote: Hi, I'm facing an issue where I'm not able to check the checkboxes of a list of Locations that are already have been persisted in the Details object (similar like the preselection of checkboxes). I followed the CheckBoxMultipleChoicePage example (example http://wicketstuff.org/wicket13/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.CheckBoxMultipleChoicePage ). So basically when a user wants to edit their detail page, it should select the checkboxes of the locations the user already selected. saving the form works fine, so when I select locations, it is persisted correctly to the details object. Could someone indicate what I am missing? I have the following code: public class DetailsPage extends Panel { private final ListLocation LOCATIONS = getLocs(); public void generateForm(){ final LocationsInput locationsInput = new LocationsInput(details); add(new FeedbackPanel(feedBack)); Form editDetails = new Form(detailsForm){ protected void onSubmit() { detailsPersistence up = new detailsPersistence(); details.setLocations(locationsInput.listAsSet()); logger.info(Saving the following locs: {},locationsInput.toString()); if(newdetails){ up.editDetails(details); } else { up.updatedetails(details); } setResponsePage(OverViewDetailssPage.class); } }; ... CheckBoxMultipleChoiceLocation listChoice = new CheckBoxMultipleChoiceLocation(locations, LOCATIONS); listChoice.setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setModelObject(locationsInput.listAsSet()); editDetails.add(listChoice); add(editDetails); } private static class LocationsInput implements IClusterable { /** the selected sites. */ public ListLocation locations = new ArrayList(); public LocationsInput(){ Location roermond = new Location(); roermond.setName(Roermond); locations.add(roermond); } /** adds pre-selected items to the choices list */ public LocationsInput(details details) { SetLocation locs = details.getLocations(); for(Location loc : locs){ logger.info(details has {} as a location.,loc.getName()); locations.add(loc); } } @Override public String toString(){ return locations = + listAsString(locations); } private String listAsString(ListLocation list){ StringBuffer b = new StringBuffer(); for (IteratorLocation i = list.iterator(); i.hasNext();){ b.append(i.next().getName()); if(i.hasNext()){ b.append(, ); } } return b.toString(); } public String[] listAsStringArray(){ String[] locNames = new String[locations.size()]; int i =0; for(Location loc : locations){ locNames[i] = loc.getName();
Re: update label using (Ajax)Link
I think you label model is never updated.Can you try final Label vorname = new Label( Vorname, new AbstractReadOnlyModelString() { private static final long serialVersionUID = 1L; public String getObject() { return selectedEintrag.getVorname()); }; }); or final Label vorname = new Label( Vorname, new PropertyModelString(selectedEintrag, vorname)); Regards, Ernesto On Tue, Mar 15, 2011 at 2:34 PM, hrbaer herber.m...@gmail.com wrote: Hi, I try to update a component (vorname within my example) once the user click on a link within a table. (In fact it doesn't matter if it is an ajax link or a normal one. My example is using an ajax link.) This im my JAVA code: public class Test extends WebPage { private Eintrag selectedEintrag = new Eintrag(); public Test( PageParameters parameters ) { ArrayList listEintraege = ladeEintraege( parameters ); final Label vorname = new Label( Vorname, selectedEintrag.getVorname() ); //just empty in first instance auswahlVorname.setOutputMarkupId( true ); add( auswahlVorname ); add( new ListView( List, listEintraege ) { protected void populateItem( final ListItem item ) { Eintrag eintrag = item.getModelObject(); item.add( new Label( Info, eintrag.getInfo() ) ); item.add(new AjaxFallbackLink(Details_Link){ @Override public void onClick( AjaxRequestTarget target ) { selectedEintrag = item.getModelObject(); target.addComponent( vorname ); } }); } }); } } Can anybody provide me some information's why this is not working (no update at all)? Isn't it possible to bind my Label component to a private property and update this property during the onclick method? Thanks in advance. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/update-label-using-Ajax-Link-tp3356575p3356575.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
wicket 1.5-rc2 and aggregate jar for osgi
Hi, I'm using wicket 1.5-RC1 in an OSGi container. There was an issue when upgrading related to package names (https://issues.apache.org/jira/browse/WICKET-3088) Now I tried upgrading to 1.5-rc2 and found that there is no aggregate jar file anymore. I then read the discussion-thread [discuss] How to resolve wicket aggregate classes / sources jar issues. (nabble: http://apache-wicket.1842946.n4.nabble.com/discuss-How-to-resolve-wicket-aggregate-classes-sources-jar-issues-td3234420.html ) As it states, the aggregate jar has been removed from the wicket distribution. Now, this introduces the very same issues described in WICKET-3088 again. While I can just repackage wicket myself and create a aggregate jar to feed the osgi container, it is first more inconvenient :) and secondly, there is then no real reason to have the wicket-xxx jars export packages, as they won't work in an OSGi container one by one anyways. I cannot add all single jars to the osgi container, because of the clashes in export-package. so in summary, there is another use case where the aggregate jar is really helpful: when using wicket with osgi. But it only is, because the single wicket jars export the same packages (for example, wicket-request and wicket-core both export org.apache.wicket.request.handler). Are there any thoughts of adding this aggregate jar to the distribution back again? kind regards, eike - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
WiQuery DatePicker and Ajax Request
Hi, guys. Here is a problem I met today: When I use DatePicker and I change it's model when ajax request received, on client side date picker's button image doubles. It happens because on every request date picker is initialized again and renders new image every time, but old one doesn't disappear, so user can see several button images. Here is simple code snippet for testing: FormVoid form = new FormVoid( form ); add( form ); DatePickerDate datePicker = new DatePickerDate( datepicker, new ModelDate(), Date.class ); datePicker.setButtonImageOnly( true ); datePicker.setShowOn( ShowOnEnum.BUTTON ); datePicker.setOutputMarkupPlaceholderTag( true ); form.add( datePicker ); FormComponentString submitBtn = new AjaxButton( submit, new ModelString( Submit ), form ) { @Override protected void onSubmit( AjaxRequestTarget target, Form? form ) { Component datePicker = getForm().get( datepicker ); datePicker.setDefaultModelObject( null ); target.addComponent( datePicker ); } }; form.add( submitBtn ); Here is markup: form wicket:id=form input type=text wicket:id=datepicker/ input type=button wicket:id=submit/ /form Is there any solution? Best regards, Alexander. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WiQuery DatePicker and Ajax Request
Hi, This is typically a jquery ui problem. Indeed, it creates a div element after the input field So, each time you refresh the input, a new div will be inserted. The best workaround is to wrap the input into a div / span element which will be used to refresh the input. With this approach, we flush the input and the additionnal div created by the datepicker js plugin. So, you will have: form wicket:id=form span wicket:id=datepickercontainerinput type=text wicket:id=datepicker//span input type=button wicket:id=submit/ /form and FormVoid form = new FormVoid( form ); add( form ); WebMarkupContainer datepickercontainer = new WebMarkupContainer(datepickercontainer); datepickercontainer.setOutputMarkupId(true); form.add( datepickercontainer ); DatePickerDate datePicker = new DatePickerDate( datepicker, new ModelDate(), Date.class ); datePicker.setButtonImageOnly( true ); datePicker.setShowOn( ShowOnEnum.BUTTON ); datePicker. setOutputMarkupPlaceholderTag( true ); datepickercontainer .add( datePicker ); FormComponentString submitBtn = new AjaxButton( submit, new ModelString( Submit ), form ) { @Override protected void onSubmit( AjaxRequestTarget target, Form? form ) { Component datePicker = getForm().get( datepicker ); datePicker.setDefaultModelObject( null ); target.addComponent( datepickercontainer ); } }; form.add( submitBtn ); Best regards Julien Roche On Tue, Mar 15, 2011 at 3:19 PM, Alexander Monakhov domin...@gmail.comwrote: Hi, guys. Here is a problem I met today: When I use DatePicker and I change it's model when ajax request received, on client side date picker's button image doubles. It happens because on every request date picker is initialized again and renders new image every time, but old one doesn't disappear, so user can see several button images. Here is simple code snippet for testing: FormVoid form = new FormVoid( form ); add( form ); DatePickerDate datePicker = new DatePickerDate( datepicker, new ModelDate(), Date.class ); datePicker.setButtonImageOnly( true ); datePicker.setShowOn( ShowOnEnum.BUTTON ); datePicker.setOutputMarkupPlaceholderTag( true ); form.add( datePicker ); FormComponentString submitBtn = new AjaxButton( submit, new ModelString( Submit ), form ) { @Override protected void onSubmit( AjaxRequestTarget target, Form? form ) { Component datePicker = getForm().get( datepicker ); datePicker.setDefaultModelObject( null ); target.addComponent( datePicker ); } }; form.add( submitBtn ); Here is markup: form wicket:id=form input type=text wicket:id=datepicker/ input type=button wicket:id=submit/ /form Is there any solution? Best regards, Alexander. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WiQuery DatePicker and Ajax Request
Thanks for this fast reply! Best regards, Alexander. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: update label using (Ajax)Link
Ernesto Reinaldo Barreiro-4 wrote: final Label vorname = new Label( Vorname, new PropertyModel(selectedEintrag, vorname)); This option will not work because: selectedEintrag = item.getModelObject(); The reference selectedEintrag is overwritten. - -- Regards, Hans http://cantaa.de -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/update-label-using-Ajax-Link-tp3356575p3356751.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: update label using (Ajax)Link
Thanks Ernesto for you quick reply. Unfortunatelly this is not working :( But if I debug within the onClick method of my AjaxLink item.getModelObject() returns null? Any idea why this happens? Or is this just a problem with my debugging configuration of eclipse? I would expect I can access Eintrag within the onClick method by using item.getModelObject()? Thanks in advance. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/update-label-using-Ajax-Link-tp3356575p3356755.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: update label using (Ajax)Link
Sorry @ all, I just forgot to restart the server so the approach with the AbstractReadOnlyModel is working! Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/update-label-using-Ajax-Link-tp3356575p3356773.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Modalwindow showing content from external URL
Hello, Is there a way to open an external page inside a modalwindow? The reason why I ask is to avoid popup-blokkers... Or should i just put an iframe on my modalwindow? Thanks, Marieke Vandamme -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Modalwindow-showing-content-from-external-URL-tp3356798p3356798.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: update label using (Ajax)Link
Yes you are right... but I think new PropertyModel(this, selectedEintrag.vorname) will work I guess. Ernesto On Tue, Mar 15, 2011 at 3:30 PM, Hans Lesmeister 2 hans.lesmeis...@lessy-software.de wrote: Ernesto Reinaldo Barreiro-4 wrote: final Label vorname = new Label( Vorname, new PropertyModel(selectedEintrag, vorname)); This option will not work because: selectedEintrag = item.getModelObject(); The reference selectedEintrag is overwritten. - -- Regards, Hans http://cantaa.de -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/update-label-using-Ajax-Link-tp3356575p3356751.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Modalwindow showing content from external URL
You can use an ModalWindow.PageCreator see: http://wicket.apache.org/apidocs/1.4/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.html#setPageCreator(org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.PageCreator) http://wicket.apache.org/apidocs/1.4/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.html#setPageCreator(org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.PageCreator) On Tue, Mar 15, 2011 at 11:48 AM, Marieke Vandamme marieke.vanda...@tvh.bewrote: Hello, Is there a way to open an external page inside a modalwindow? The reason why I ask is to avoid popup-blokkers... Or should i just put an iframe on my modalwindow? Thanks, Marieke Vandamme -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Modalwindow-showing-content-from-external-URL-tp3356798p3356798.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos
Re: Modalwindow showing content from external URL
ops, u saind external link, yes, just put an iframe is fine On Tue, Mar 15, 2011 at 12:24 PM, Pedro Santos pedros...@gmail.com wrote: You can use an ModalWindow.PageCreator see: http://wicket.apache.org/apidocs/1.4/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.html#setPageCreator(org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.PageCreator) http://wicket.apache.org/apidocs/1.4/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.html#setPageCreator(org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.PageCreator) On Tue, Mar 15, 2011 at 11:48 AM, Marieke Vandamme marieke.vanda...@tvh.be wrote: Hello, Is there a way to open an external page inside a modalwindow? The reason why I ask is to avoid popup-blokkers... Or should i just put an iframe on my modalwindow? Thanks, Marieke Vandamme -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Modalwindow-showing-content-from-external-URL-tp3356798p3356798.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos -- Pedro Henrique Oliveira dos Santos
Re: Checking the checkboxes of CheckBoxMultipleChoice
Hi Pedro, I've changed the code as you suggested and the result is the same. The data is persisted correctly (as it was in previous cases as well), however the check boxes are not checked when the page is reopened. Just to be clear, the locations variable of LocationsInput is set properly when final LocationsInput locationsInput = new LocationsInput(details); is being called. I can also confirm this when I check the variables is debug mode and when I add some extra logging. Am I correct that the checkboxes should be checked when setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); is called? I understand the purpose of CompoundPropertyModels and PropertyModels. In the example code (examplehttp://wicketstuff.org/wicket13/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.CheckBoxMultipleChoicePage), the CompoundPropertyModel is used, but it is not exactly clear why to me. Could it be that the problem is that in the example an ArrayList of Strings is returned and in my code an ArrayList of Locations is returned by the LocationInput class? Alternatively, is there an other way to manually check the checkboxes via loop or something? Performance is of less concern. Thanks again, Sjoerd On Tue, Mar 15, 2011 at 11:03 AM, Pedro Santos pedros...@gmail.com wrote: Your code is not saving the collection of checked locations, change details.setLocations(locationsInput.listAsSet()); ... up.persist(details); to details.setLocations(listChoice.getModelObject()) ... up.persist(details); and it will start to use the collection in the CheckBoxMultipleChoice model, so the persisted data will be the user input, and not an new collection created inside the listAsSet method. there is good info about CPM in: https://cwiki.apache.org/WICKET/working-with-wicket-models.html#WorkingwithWicketmodels-CompoundPropertyModels On Tue, Mar 15, 2011 at 10:54 AM, Sjoerd Smeets ssme...@gmail.com wrote: Hi Pedro, Thanks for your reply. I'm not sure if I understand what you mean with use nested components id as property expressions. The persisting part works fine with this code, however checking the correct boxes when the details page opens does not work. I have tried the following: setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setModelObject(locationsInput.listAsSet()); and they all persist the check checkboxes correctly when the user hits the submit button, but when reopening the page, the checkboxes are not checked. What is the easiest way to do this? Thanks again, Sjoerd On Tue, Mar 15, 2011 at 7:40 AM, Pedro Santos pedros...@gmail.comwrote: Hi, this code is weird: listChoice.setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setModelObject(locationsInput.listAsSet()); because CompoundPropertyModel is useful to use nested components id as property expressions If details in form submit code is an LocationsInput, then the user input will never be considered. At listAsSet an new collection is created and passed as parameter to listChoice: class LocationsInput { public HashSetLocation listAsSet(){ return new HashSetLocation(locations); } } And a new one is used to be persisted: onSubmit{ details.setLocations(locationsInput.listAsSet()); up.persist(details); } On Mon, Mar 14, 2011 at 2:53 PM, Sjoerd Smeets ssme...@gmail.comwrote: Hi, I'm facing an issue where I'm not able to check the checkboxes of a list of Locations that are already have been persisted in the Details object (similar like the preselection of checkboxes). I followed the CheckBoxMultipleChoicePage example (example http://wicketstuff.org/wicket13/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.CheckBoxMultipleChoicePage ). So basically when a user wants to edit their detail page, it should select the checkboxes of the locations the user already selected. saving the form works fine, so when I select locations, it is persisted correctly to the details object. Could someone indicate what I am missing? I have the following code: public class DetailsPage extends Panel { private final ListLocation LOCATIONS = getLocs(); public void generateForm(){ final LocationsInput locationsInput = new LocationsInput(details); add(new FeedbackPanel(feedBack)); Form editDetails = new Form(detailsForm){ protected void onSubmit() { detailsPersistence up = new detailsPersistence(); details.setLocations(locationsInput.listAsSet()); logger.info(Saving the following locs: {},locationsInput.toString());
Re: update label using (Ajax)Link
Ernesto Reinaldo Barreiro-4 wrote: Yes you are right... but I think new PropertyModel(this, selectedEintrag.vorname) will work I guess. I guess you are right. That will work, but it is not very elegant to put a reference to the page or panel into the model. He probably should not overwrite the reference on selectedEintrag or use the readonly model you suggested. I think I would put a new Model() into the label and then, instead of overwriting the variable selectedEintrag, call label.setModelObject(item.getModelObject().getVorname()) - -- Regards, Hans http://cantaa.de -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/update-label-using-Ajax-Link-tp3356575p3357001.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Checking the checkboxes of CheckBoxMultipleChoice
Hi Sjoerd, double check the listChoice. If you want it presenting the persisted data, you should use an model containg it, does the locationsInput.listAsSet() give you that? change listChoice.setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setModelObject(locationsInput.listAsSet()); to listChoice.setDefaultModel(modelContainingCollectionOfPersistedData); In the example the Input type has an instance variable named: sites. This is exactly the wicket id of the CheckBoxMultipleChoice. class Input { public List sites = new ArrayList(); } final Input input = new Input(); setModel(new CompoundPropertyModel(input)); CheckBoxMultipleChoice listChoice = new CheckBoxMultipleChoice(sites, SITES); -- the model object of thi component will be the sites list at the Input On Tue, Mar 15, 2011 at 1:00 PM, Sjoerd Smeets ssme...@gmail.com wrote: Hi Pedro, I've changed the code as you suggested and the result is the same. The data is persisted correctly (as it was in previous cases as well), however the check boxes are not checked when the page is reopened. Just to be clear, the locations variable of LocationsInput is set properly when final LocationsInput locationsInput = new LocationsInput(details); is being called. I can also confirm this when I check the variables is debug mode and when I add some extra logging. Am I correct that the checkboxes should be checked when setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); is called? I understand the purpose of CompoundPropertyModels and PropertyModels. In the example code (examplehttp://wicketstuff.org/wicket13/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.CheckBoxMultipleChoicePage), the CompoundPropertyModel is used, but it is not exactly clear why to me. Could it be that the problem is that in the example an ArrayList of Strings is returned and in my code an ArrayList of Locations is returned by the LocationInput class? Alternatively, is there an other way to manually check the checkboxes via loop or something? Performance is of less concern. Thanks again, Sjoerd On Tue, Mar 15, 2011 at 11:03 AM, Pedro Santos pedros...@gmail.comwrote: Your code is not saving the collection of checked locations, change details.setLocations(locationsInput.listAsSet()); ... up.persist(details); to details.setLocations(listChoice.getModelObject()) ... up.persist(details); and it will start to use the collection in the CheckBoxMultipleChoice model, so the persisted data will be the user input, and not an new collection created inside the listAsSet method. there is good info about CPM in: https://cwiki.apache.org/WICKET/working-with-wicket-models.html#WorkingwithWicketmodels-CompoundPropertyModels On Tue, Mar 15, 2011 at 10:54 AM, Sjoerd Smeets ssme...@gmail.comwrote: Hi Pedro, Thanks for your reply. I'm not sure if I understand what you mean with use nested components id as property expressions. The persisting part works fine with this code, however checking the correct boxes when the details page opens does not work. I have tried the following: setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setModelObject(locationsInput.listAsSet()); and they all persist the check checkboxes correctly when the user hits the submit button, but when reopening the page, the checkboxes are not checked. What is the easiest way to do this? Thanks again, Sjoerd On Tue, Mar 15, 2011 at 7:40 AM, Pedro Santos pedros...@gmail.comwrote: Hi, this code is weird: listChoice.setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setModelObject(locationsInput.listAsSet()); because CompoundPropertyModel is useful to use nested components id as property expressions If details in form submit code is an LocationsInput, then the user input will never be considered. At listAsSet an new collection is created and passed as parameter to listChoice: class LocationsInput { public HashSetLocation listAsSet(){ return new HashSetLocation(locations); } } And a new one is used to be persisted: onSubmit{ details.setLocations(locationsInput.listAsSet()); up.persist(details); } On Mon, Mar 14, 2011 at 2:53 PM, Sjoerd Smeets ssme...@gmail.comwrote: Hi, I'm facing an issue where I'm not able to check the checkboxes of a list of Locations that are already have been persisted in the Details object (similar like the preselection of checkboxes). I followed the CheckBoxMultipleChoicePage example (example http://wicketstuff.org/wicket13/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.CheckBoxMultipleChoicePage ). So
RE: mountSharedResource() on huge amount of images
Imagine this situation: users have accounts on photo album where they upload images. System from uploaded images create thumbnails. Users can browse their photo - there is combo show 25, show 50... show all images. On page I render thumbnails on a page which are shadowbox clickable images. All images (show all) I do in way described below. Works fine but in extreme situation there is user with more than 3.000 images in one photoalbum. Or -how to do it better way? Thanks, Laco -Original Message- From: Bas Gooren [mailto:b...@iswd.nl] Sent: Thursday, March 10, 2011 11:32 PM To: users@wicket.apache.org Subject: Re: mountSharedResource() on huge amount of images The general idea is to mount a single handler, which takes the filename from the url. There is no reason to mount all images by such a handler one-by-one. Bas Op 10-3-2011 23:01, Ladislav DANKO schreef: Hi all, what is the recommended way to mount huge amount of an images (thousands) in app? Does mountSharedResource() has any bottleneck? Simplified code look like: Folder folder = ((Start) Application.get()).getUploadFolder(); File[] files = folder.getFiles(); ListFile lList = Arrays.asList(files); Collections.sort(lList); int i = 0; IteratorFile iterator = lList.iterator(); while(iterator.hasNext()) { iterator.next(); String fileName = lList.get(i).getName(); mountSharedResource(/images/ + fileName, new ResourceReference(Images.class, fileName).getSharedResourceKey()); i++; } But what if in folder is for example 100.000 photos? Thanks for pointing, -- Ladislav DANKO - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Checking the checkboxes of CheckBoxMultipleChoice
Hi Pedro, Thanks for all your help so far. locationsInput.listAsSet() indeed returns the data that is persisted. To try something else, I have created an IModel class called LocationsModel as below and I've changed the concerning bit to: listChoice.setDefaultModel(new LocationsModel(new Model(details),details.getLocations())); //listChoice.setModelObject(locationsInput.listAsSet()); Unfortunately the result is the same: the data is persisted correctly into my database, but the checkboxes are not checked when the page is reloaded or reopened. I can confirm that details.getLocations() contains all the locations. Btw, details.getlocations returns a HasSet. private static class LocationsModel implements IModel { /** the selected sites. */ private IModel locationContainingModel; private SetLocation locations; public LocationsModel(IModel locationContainingModel, SetLocation locations){ this.locationContainingModel = locationContainingModel; this.locations = locations; } public Object getObject() { Details details = (Details) locationContainingModel.getObject(); return details.getLocations(); } public void setObject(Object object) { Details details = (Details) locationContainingModel.getObject(); details.setLocations((SetLocation)object); } public void detach() { locationContainingModel.detach(); } } On Tue, Mar 15, 2011 at 12:22 PM, Pedro Santos pedros...@gmail.com wrote: Hi Sjoerd, double check the listChoice. If you want it presenting the persisted data, you should use an model containg it, does the locationsInput.listAsSet() give you that? change listChoice.setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setModelObject(locationsInput.listAsSet()); to listChoice.setDefaultModel(modelContainingCollectionOfPersistedData); In the example the Input type has an instance variable named: sites. This is exactly the wicket id of the CheckBoxMultipleChoice. class Input { public List sites = new ArrayList(); } final Input input = new Input(); setModel(new CompoundPropertyModel(input)); CheckBoxMultipleChoice listChoice = new CheckBoxMultipleChoice(sites, SITES); -- the model object of thi component will be the sites list at the Input On Tue, Mar 15, 2011 at 1:00 PM, Sjoerd Smeets ssme...@gmail.com wrote: Hi Pedro, I've changed the code as you suggested and the result is the same. The data is persisted correctly (as it was in previous cases as well), however the check boxes are not checked when the page is reopened. Just to be clear, the locations variable of LocationsInput is set properly when final LocationsInput locationsInput = new LocationsInput(details); is being called. I can also confirm this when I check the variables is debug mode and when I add some extra logging. Am I correct that the checkboxes should be checked when setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); is called? I understand the purpose of CompoundPropertyModels and PropertyModels. In the example code (examplehttp://wicketstuff.org/wicket13/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.CheckBoxMultipleChoicePage), the CompoundPropertyModel is used, but it is not exactly clear why to me. Could it be that the problem is that in the example an ArrayList of Strings is returned and in my code an ArrayList of Locations is returned by the LocationInput class? Alternatively, is there an other way to manually check the checkboxes via loop or something? Performance is of less concern. Thanks again, Sjoerd On Tue, Mar 15, 2011 at 11:03 AM, Pedro Santos pedros...@gmail.comwrote: Your code is not saving the collection of checked locations, change details.setLocations(locationsInput.listAsSet()); ... up.persist(details); to details.setLocations(listChoice.getModelObject()) ... up.persist(details); and it will start to use the collection in the CheckBoxMultipleChoice model, so the persisted data will be the user input, and not an new collection created inside the listAsSet method. there is good info about CPM in: https://cwiki.apache.org/WICKET/working-with-wicket-models.html#WorkingwithWicketmodels-CompoundPropertyModels On Tue, Mar 15, 2011 at 10:54 AM, Sjoerd Smeets ssme...@gmail.comwrote: Hi Pedro, Thanks for your reply. I'm not sure if I understand what you mean with use nested components id as property expressions. The persisting part works fine with this code, however checking the correct boxes when the details page opens does not work. I have tried the following: setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setDefaultModel(new
RE: mountSharedResource() on huge amount of images
For that many photos I would suggest storing them in a database. Storing that many images on the file system is cumbersome and inefficient in my opinion. You might run into many headaches especially around backups, deploys, upgrades, performance, file names, storage space, etc... From: Ladislav DANKO em...@1ac0.net To: users@wicket.apache.org Date: 03/15/2011 01:01 PM Subject:RE: mountSharedResource() on huge amount of images Imagine this situation: users have accounts on photo album where they upload images. System from uploaded images create thumbnails. Users can browse their photo - there is combo show 25, show 50... show all images. On page I render thumbnails on a page which are shadowbox clickable images. All images (show all) I do in way described below. Works fine but in extreme situation there is user with more than 3.000 images in one photoalbum. Or -how to do it better way? Thanks, Laco -Original Message- From: Bas Gooren [mailto:b...@iswd.nl] Sent: Thursday, March 10, 2011 11:32 PM To: users@wicket.apache.org Subject: Re: mountSharedResource() on huge amount of images The general idea is to mount a single handler, which takes the filename from the url. There is no reason to mount all images by such a handler one-by-one. Bas Op 10-3-2011 23:01, Ladislav DANKO schreef: Hi all, what is the recommended way to mount huge amount of an images (thousands) in app? Does mountSharedResource() has any bottleneck? Simplified code look like: Folder folder = ((Start) Application.get()).getUploadFolder(); File[] files = folder.getFiles(); ListFile lList = Arrays.asList(files); Collections.sort(lList); int i = 0; IteratorFile iterator = lList.iterator(); while(iterator.hasNext()) { iterator.next(); String fileName = lList.get(i).getName(); mountSharedResource(/images/ + fileName, new ResourceReference(Images.class, fileName).getSharedResourceKey()); i++; } But what if in folder is for example 100.000 photos? Thanks for pointing, -- Ladislav DANKO - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org Notice: This communication, including any attachments, is intended solely for the use of the individual or entity to which it is addressed. This communication may contain information that is protected from disclosure under State and/or Federal law. Please notify the sender immediately if you have received this communication in error and delete this email from your system. If you are not the intended recipient, you are requested not to disclose, copy, distribute or take any action in reliance on the contents of this information.
Re: mountSharedResource() on huge amount of images
Now you're talking about rendering them, which is a different topic than mounting a resource which serves said images. You'll only need to mount a single shared resource which serves all the images. However, given the amount of images you can consider allowing your front-end (e.g. apache httd) or a dedicated webserver serve the images. Since you mention that the amount of images can be potentially large (250), I'd suggest removing the show all option, or using an ajax viewport (max 20-50 images on-screen at a time, when the user scrolls you load new images over ajax). Someone else just suggested storing images in the database. While there is usually heated debate about this topic (files on disk vs in the database), let me just say that simply having lots of images is no reason to move images into the database. For starters, you can always store your files in a hashed folder structure, e.g. when the ID is 1234, store the image in a file/folder called /1/2/3/4.jpg Bas Op 15-3-2011 18:00, Ladislav DANKO schreef: Imagine this situation: users have accounts on photo album where they upload images. System from uploaded images create thumbnails. Users can browse their photo - there is combo show 25, show 50... show all images. On page I render thumbnails on a page which are shadowbox clickable images. All images (show all) I do in way described below. Works fine but in extreme situation there is user with more than 3.000 images in one photoalbum. Or -how to do it better way? Thanks, Laco -Original Message- From: Bas Gooren [mailto:b...@iswd.nl] Sent: Thursday, March 10, 2011 11:32 PM To: users@wicket.apache.org Subject: Re: mountSharedResource() on huge amount of images The general idea is to mount a single handler, which takes the filename from the url. There is no reason to mount all images by such a handler one-by-one. Bas Op 10-3-2011 23:01, Ladislav DANKO schreef: Hi all, what is the recommended way to mount huge amount of an images (thousands) in app? Does mountSharedResource() has any bottleneck? Simplified code look like: Folder folder = ((Start) Application.get()).getUploadFolder(); File[] files = folder.getFiles(); ListFile lList = Arrays.asList(files); Collections.sort(lList); int i = 0; IteratorFile iterator = lList.iterator(); while(iterator.hasNext()) { iterator.next(); String fileName = lList.get(i).getName(); mountSharedResource(/images/ + fileName, new ResourceReference(Images.class, fileName).getSharedResourceKey()); i++; } But what if in folder is for example 100.000 photos? Thanks for pointing, -- Ladislav DANKO - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: mountSharedResource() on huge amount of images
No offense Bas but that seems like a major hassle, especially considering with an ORM its a simple update/delete/find. When it comes time to build out new servers now you have to shuffle around 300k photos instead of simply replicating a database. Also sounds like it would make debugging more difficult when your images are three or more folders deep. And what if you want to store attributes along with the photos? Like say user comments, or flag them for inappropriate content, copyright infringement, etc. What if there is an open file handle when you try to delete the image? Just seems to me a much smoother solution to put in a db. But with that I'm bowing out because as you said it's a heated debate and comes down to personal preference. From: Bas Gooren b...@iswd.nl To: users@wicket.apache.org Date: 03/15/2011 02:10 PM Subject:Re: mountSharedResource() on huge amount of images Now you're talking about rendering them, which is a different topic than mounting a resource which serves said images. You'll only need to mount a single shared resource which serves all the images. However, given the amount of images you can consider allowing your front-end (e.g. apache httd) or a dedicated webserver serve the images. Since you mention that the amount of images can be potentially large (250), I'd suggest removing the show all option, or using an ajax viewport (max 20-50 images on-screen at a time, when the user scrolls you load new images over ajax). Someone else just suggested storing images in the database. While there is usually heated debate about this topic (files on disk vs in the database), let me just say that simply having lots of images is no reason to move images into the database. For starters, you can always store your files in a hashed folder structure, e.g. when the ID is 1234, store the image in a file/folder called /1/2/3/4.jpg Bas Op 15-3-2011 18:00, Ladislav DANKO schreef: Imagine this situation: users have accounts on photo album where they upload images. System from uploaded images create thumbnails. Users can browse their photo - there is combo show 25, show 50... show all images. On page I render thumbnails on a page which are shadowbox clickable images. All images (show all) I do in way described below. Works fine but in extreme situation there is user with more than 3.000 images in one photoalbum. Or -how to do it better way? Thanks, Laco -Original Message- From: Bas Gooren [mailto:b...@iswd.nl] Sent: Thursday, March 10, 2011 11:32 PM To: users@wicket.apache.org Subject: Re: mountSharedResource() on huge amount of images The general idea is to mount a single handler, which takes the filename from the url. There is no reason to mount all images by such a handler one-by-one. Bas Op 10-3-2011 23:01, Ladislav DANKO schreef: Hi all, what is the recommended way to mount huge amount of an images (thousands) in app? Does mountSharedResource() has any bottleneck? Simplified code look like: Folder folder = ((Start) Application.get()).getUploadFolder(); File[] files = folder.getFiles(); ListFile lList = Arrays.asList(files); Collections.sort(lList); int i = 0; IteratorFile iterator = lList.iterator(); while(iterator.hasNext()) { iterator.next(); String fileName = lList.get(i).getName(); mountSharedResource(/images/ + fileName, new ResourceReference(Images.class, fileName).getSharedResourceKey()); i++; } But what if in folder is for example 100.000 photos? Thanks for pointing, -- Ladislav DANKO - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org Notice: This communication, including any attachments, is intended solely for the use of the individual or entity to which it is addressed. This communication may contain information that is protected from disclosure under State and/or Federal law. Please notify the sender immediately if you have received this communication in error and delete this email from your system. If you are not the intended recipient, you are requested not to disclose, copy, distribute or take any action in reliance on the contents of this information.
[1.5RC2] image..
Hi I had a problem where Image always added the anticache on ajax calls, in my case we actually wanted the pictures to be read from cache (that way we can avoid flickering). However it is not possible with Image to specify that you do not want the anti cache appended.. Could we either have an option to tell image that we don't want anti cache or at least have a mechanism so we can override the appropriate parts.. Should I do an RFE? regards Nino
Re: Checking the checkboxes of CheckBoxMultipleChoice
Hi Pedro, I've created a quickstart and put it in a ticket. https://issues.apache.org/jira/browse/WICKET-3538 https://issues.apache.org/jira/browse/WICKET-3538Thanks for your help, Sjoerd On Tue, Mar 15, 2011 at 1:12 PM, Pedro Santos pedros...@gmail.com wrote: double check the Location hash/equals implementation, if it keeps not working send us a quickstart On Tue, Mar 15, 2011 at 2:04 PM, Sjoerd Smeets ssme...@gmail.com wrote: Hi Pedro, Thanks for all your help so far. locationsInput.listAsSet() indeed returns the data that is persisted. To try something else, I have created an IModel class called LocationsModel as below and I've changed the concerning bit to: listChoice.setDefaultModel(new LocationsModel(new Model(details),details.getLocations())); //listChoice.setModelObject(locationsInput.listAsSet()); Unfortunately the result is the same: the data is persisted correctly into my database, but the checkboxes are not checked when the page is reloaded or reopened. I can confirm that details.getLocations() contains all the locations. Btw, details.getlocations returns a HasSet. private static class LocationsModel implements IModel { /** the selected sites. */ private IModel locationContainingModel; private SetLocation locations; public LocationsModel(IModel locationContainingModel, SetLocation locations){ this.locationContainingModel = locationContainingModel; this.locations = locations; } public Object getObject() { Details details = (Details) locationContainingModel.getObject(); return details.getLocations(); } public void setObject(Object object) { Details details = (Details) locationContainingModel.getObject(); details.setLocations((SetLocation)object); } public void detach() { locationContainingModel.detach(); } } On Tue, Mar 15, 2011 at 12:22 PM, Pedro Santos pedros...@gmail.comwrote: Hi Sjoerd, double check the listChoice. If you want it presenting the persisted data, you should use an model containg it, does the locationsInput.listAsSet() give you that? change listChoice.setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); listChoice.setModelObject(locationsInput.listAsSet()); to listChoice.setDefaultModel(modelContainingCollectionOfPersistedData); In the example the Input type has an instance variable named: sites. This is exactly the wicket id of the CheckBoxMultipleChoice. class Input { public List sites = new ArrayList(); } final Input input = new Input(); setModel(new CompoundPropertyModel(input)); CheckBoxMultipleChoice listChoice = new CheckBoxMultipleChoice(sites, SITES); -- the model object of thi component will be the sites list at the Input On Tue, Mar 15, 2011 at 1:00 PM, Sjoerd Smeets ssme...@gmail.comwrote: Hi Pedro, I've changed the code as you suggested and the result is the same. The data is persisted correctly (as it was in previous cases as well), however the check boxes are not checked when the page is reopened. Just to be clear, the locations variable of LocationsInput is set properly when final LocationsInput locationsInput = new LocationsInput(details); is being called. I can also confirm this when I check the variables is debug mode and when I add some extra logging. Am I correct that the checkboxes should be checked when setDefaultModel(new CompoundPropertyModelLocationsInput(locationsInput)); is called? I understand the purpose of CompoundPropertyModels and PropertyModels. In the example code (examplehttp://wicketstuff.org/wicket13/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.CheckBoxMultipleChoicePage), the CompoundPropertyModel is used, but it is not exactly clear why to me. Could it be that the problem is that in the example an ArrayList of Strings is returned and in my code an ArrayList of Locations is returned by the LocationInput class? Alternatively, is there an other way to manually check the checkboxes via loop or something? Performance is of less concern. Thanks again, Sjoerd On Tue, Mar 15, 2011 at 11:03 AM, Pedro Santos pedros...@gmail.comwrote: Your code is not saving the collection of checked locations, change details.setLocations(locationsInput.listAsSet()); ... up.persist(details); to details.setLocations(listChoice.getModelObject()) ... up.persist(details); and it will start to use the collection in the CheckBoxMultipleChoice model, so the persisted data will be the user input, and not an new collection created inside the listAsSet method. there is good info about CPM in: https://cwiki.apache.org/WICKET/working-with-wicket-models.html#WorkingwithWicketmodels-CompoundPropertyModels On Tue, Mar 15, 2011 at 10:54 AM, Sjoerd Smeets ssme...@gmail.comwrote: Hi Pedro, Thanks for your reply. I'm not sure if I
Re: [1.5RC2] image..
Why do you put the image in the AjaxRequestTarget if you don't want to repaint it ? On Tue, Mar 15, 2011 at 7:33 PM, nino martinez wael nino.martinez.w...@gmail.com wrote: Hi I had a problem where Image always added the anticache on ajax calls, in my case we actually wanted the pictures to be read from cache (that way we can avoid flickering). However it is not possible with Image to specify that you do not want the anti cache appended.. Could we either have an option to tell image that we don't want anti cache or at least have a mechanism so we can override the appropriate parts.. Should I do an RFE? regards Nino -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: wicket 1.5-rc2 and aggregate jar for osgi
Hi Eike, Sorry that we broke OSGi support again. The problem was that many users wanted -sources and -javadoc for the aggregate .jar and it became a bit complex and confusing. I think we can add wicket-osgi project in wicketstuff/core repository that will do the same we did initially in WICKET-3088 and then you will use org.wicketstuff:wicket-osgi dependency instead. We release wicketstuff core projects few days after Wicket releases. Other opinions/suggestions ? martin-g On Tue, Mar 15, 2011 at 3:05 PM, Eike Kettner n...@eknet.org wrote: Hi, I'm using wicket 1.5-RC1 in an OSGi container. There was an issue when upgrading related to package names (https://issues.apache.org/jira/browse/WICKET-3088) Now I tried upgrading to 1.5-rc2 and found that there is no aggregate jar file anymore. I then read the discussion-thread [discuss] How to resolve wicket aggregate classes / sources jar issues. (nabble: http://apache-wicket.1842946.n4.nabble.com/discuss-How-to-resolve-wicket-aggregate-classes-sources-jar-issues-td3234420.html) As it states, the aggregate jar has been removed from the wicket distribution. Now, this introduces the very same issues described in WICKET-3088 again. While I can just repackage wicket myself and create a aggregate jar to feed the osgi container, it is first more inconvenient :) and secondly, there is then no real reason to have the wicket-xxx jars export packages, as they won't work in an OSGi container one by one anyways. I cannot add all single jars to the osgi container, because of the clashes in export-package. so in summary, there is another use case where the aggregate jar is really helpful: when using wicket with osgi. But it only is, because the single wicket jars export the same packages (for example, wicket-request and wicket-core both export org.apache.wicket.request.handler). Are there any thoughts of adding this aggregate jar to the distribution back again? kind regards, eike - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: Set FormComponent Type and EmailValidator
On behalf of Pedro Sans: Are u using the Wicket 1.4? I think it is related to https://issues.apache.org/jira/browse/WICKET-3269 We improved text components to respect the convertEmptyInputStringToNull property regardless of the form component type in 1.5 On Tue, Mar 15, 2011 at 2:40 PM, vov vov...@mail.ru wrote: After submitting a form: add(new Form(form) // .add(new TextField(text, new Model(), String.class) // .add(EmailAddressValidator.getInstance( with empty field the fallowing error occur:('' is not a valid email address.) Without setting type for TextField - all fine -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Set-FormComponent-Type-and-EmailValidator-tp3356588p3356588.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: wicket 1.5-rc2 and aggregate jar for osgi
Hi Martin, thanks for your response and no need to apologize! It's good to have rcX candidate releases to play with so issues can be found. For me a wicket-osgi dependency would be great! And I really don't care about where to download :) I don't think that providing it from wicketstuff would bother users... If you decide to not support osgi out-of-the-box, it's still no problem to create an aggregate jar myself. I'd think most osgi users have to do this (unfortunately) quite often to add other no-bundle-jars. But with a distributed jar, it's of course a lot easier - I would appreciate it (as probably other osgi users would). regards, Eike On [Tue, 15.03.2011 20:43], Martin Grigorov wrote: Hi Eike, Sorry that we broke OSGi support again. The problem was that many users wanted -sources and -javadoc for the aggregate .jar and it became a bit complex and confusing. I think we can add wicket-osgi project in wicketstuff/core repository that will do the same we did initially in WICKET-3088 and then you will use org.wicketstuff:wicket-osgi dependency instead. We release wicketstuff core projects few days after Wicket releases. Other opinions/suggestions ? martin-g On Tue, Mar 15, 2011 at 3:05 PM, Eike Kettner n...@eknet.org wrote: Hi, I'm using wicket 1.5-RC1 in an OSGi container. There was an issue when upgrading related to package names (https://issues.apache.org/jira/browse/WICKET-3088) Now I tried upgrading to 1.5-rc2 and found that there is no aggregate jar file anymore. I then read the discussion-thread [discuss] How to resolve wicket aggregate classes / sources jar issues. (nabble: http://apache-wicket.1842946.n4.nabble.com/discuss-How-to-resolve-wicket-aggregate-classes-sources-jar-issues-td3234420.html) As it states, the aggregate jar has been removed from the wicket distribution. Now, this introduces the very same issues described in WICKET-3088 again. While I can just repackage wicket myself and create a aggregate jar to feed the osgi container, it is first more inconvenient :) and secondly, there is then no real reason to have the wicket-xxx jars export packages, as they won't work in an OSGi container one by one anyways. I cannot add all single jars to the osgi container, because of the clashes in export-package. so in summary, there is another use case where the aggregate jar is really helpful: when using wicket with osgi. But it only is, because the single wicket jars export the same packages (for example, wicket-request and wicket-core both export org.apache.wicket.request.handler). Are there any thoughts of adding this aggregate jar to the distribution back again? kind regards, eike - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ -- email: e...@eknet.org https://www.eknet.org pgp: 481161A0 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: mountSharedResource() on huge amount of images
Well, exactly. It's usually a debate where both parties have solid arguments and it boils down to preference. I work with both options in medium-sized installations and in the end see the benefits of both options, but prefer disk-based file storage. For most applications though, a CDN or something like Amazon S3 is a great option if you don't want the storage hassle. I say hassle because managing hash-based storage is (imho) easy. It's only a matter of adding a layer of abstraction between file access in the app and actual file storage. Which is something I would always recommend to be able to switch storage if required/desired. This layer of abstraction can then either store files in the db, on disk, both. It can also perform de-duplication, indexing, calculate a hash for hash-based storage, store the file on S3, etc. So to the original author: either way works, pick what you prefer and suits your project best. Bas Op 15-3-2011 19:27, mzem...@osc.state.ny.us schreef: No offense Bas but that seems like a major hassle, especially considering with an ORM its a simple update/delete/find. When it comes time to build out new servers now you have to shuffle around 300k photos instead of simply replicating a database. Also sounds like it would make debugging more difficult when your images are three or more folders deep. And what if you want to store attributes along with the photos? Like say user comments, or flag them for inappropriate content, copyright infringement, etc. What if there is an open file handle when you try to delete the image? Just seems to me a much smoother solution to put in a db. But with that I'm bowing out because as you said it's a heated debate and comes down to personal preference. From: Bas Goorenb...@iswd.nl To: users@wicket.apache.org Date: 03/15/2011 02:10 PM Subject:Re: mountSharedResource() on huge amount of images Now you're talking about rendering them, which is a different topic than mounting a resource which serves said images. You'll only need to mount a single shared resource which serves all the images. However, given the amount of images you can consider allowing your front-end (e.g. apache httd) or a dedicated webserver serve the images. Since you mention that the amount of images can be potentially large (250), I'd suggest removing the show all option, or using an ajax viewport (max 20-50 images on-screen at a time, when the user scrolls you load new images over ajax). Someone else just suggested storing images in the database. While there is usually heated debate about this topic (files on disk vs in the database), let me just say that simply having lots of images is no reason to move images into the database. For starters, you can always store your files in a hashed folder structure, e.g. when the ID is 1234, store the image in a file/folder called /1/2/3/4.jpg Bas Op 15-3-2011 18:00, Ladislav DANKO schreef: Imagine this situation: users have accounts on photo album where they upload images. System from uploaded images create thumbnails. Users can browse their photo - there is combo show 25, show 50... show all images. On page I render thumbnails on a page which are shadowbox clickable images. All images (show all) I do in way described below. Works fine but in extreme situation there is user with more than 3.000 images in one photoalbum. Or -how to do it better way? Thanks, Laco -Original Message- From: Bas Gooren [mailto:b...@iswd.nl] Sent: Thursday, March 10, 2011 11:32 PM To: users@wicket.apache.org Subject: Re: mountSharedResource() on huge amount of images The general idea is to mount a single handler, which takes the filename from the url. There is no reason to mount all images by such a handler one-by-one. Bas Op 10-3-2011 23:01, Ladislav DANKO schreef: Hi all, what is the recommended way to mount huge amount of an images (thousands) in app? Does mountSharedResource() has any bottleneck? Simplified code look like: Folder folder = ((Start) Application.get()).getUploadFolder(); File[] files = folder.getFiles(); ListFilelList = Arrays.asList(files); Collections.sort(lList); int i = 0; IteratorFileiterator = lList.iterator(); while(iterator.hasNext()) { iterator.next(); String fileName = lList.get(i).getName(); mountSharedResource(/images/ + fileName, new ResourceReference(Images.class, fileName).getSharedResourceKey()); i++; } But what if in folder is for example 100.000 photos? Thanks for pointing, -- Ladislav DANKO - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org Notice:
Fwd: wicket 1.5-rc2 and aggregate jar for osgi
Well, wicketstuff is hosted at GitHub and any user can contribute. If you have some time and willing to share your work with the community you can do it yourself. Otherwise just create a ticket in wicketstuff's issue tracking system and someone of us will do it when we have some time. Thanks for testing the RCs ! ;-) On Tue, Mar 15, 2011 at 9:21 PM, Eike Kettner n...@eknet.org wrote: Hi Martin, thanks for your response and no need to apologize! It's good to have rcX candidate releases to play with so issues can be found. For me a wicket-osgi dependency would be great! And I really don't care about where to download :) I don't think that providing it from wicketstuff would bother users... If you decide to not support osgi out-of-the-box, it's still no problem to create an aggregate jar myself. I'd think most osgi users have to do this (unfortunately) quite often to add other no-bundle-jars. But with a distributed jar, it's of course a lot easier - I would appreciate it (as probably other osgi users would). regards, Eike On [Tue, 15.03.2011 20:43], Martin Grigorov wrote: Hi Eike, Sorry that we broke OSGi support again. The problem was that many users wanted -sources and -javadoc for the aggregate .jar and it became a bit complex and confusing. I think we can add wicket-osgi project in wicketstuff/core repository that will do the same we did initially in WICKET-3088 and then you will use org.wicketstuff:wicket-osgi dependency instead. We release wicketstuff core projects few days after Wicket releases. Other opinions/suggestions ? martin-g On Tue, Mar 15, 2011 at 3:05 PM, Eike Kettner n...@eknet.org wrote: Hi, I'm using wicket 1.5-RC1 in an OSGi container. There was an issue when upgrading related to package names (https://issues.apache.org/jira/browse/WICKET-3088) Now I tried upgrading to 1.5-rc2 and found that there is no aggregate jar file anymore. I then read the discussion-thread [discuss] How to resolve wicket aggregate classes / sources jar issues. (nabble: http://apache-wicket.1842946.n4.nabble.com/discuss-How-to-resolve-wicket-aggregate-classes-sources-jar-issues-td3234420.html ) As it states, the aggregate jar has been removed from the wicket distribution. Now, this introduces the very same issues described in WICKET-3088 again. While I can just repackage wicket myself and create a aggregate jar to feed the osgi container, it is first more inconvenient :) and secondly, there is then no real reason to have the wicket-xxx jars export packages, as they won't work in an OSGi container one by one anyways. I cannot add all single jars to the osgi container, because of the clashes in export-package. so in summary, there is another use case where the aggregate jar is really helpful: when using wicket with osgi. But it only is, because the single wicket jars export the same packages (for example, wicket-request and wicket-core both export org.apache.wicket.request.handler). Are there any thoughts of adding this aggregate jar to the distribution back again? kind regards, eike - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ -- email: e...@eknet.org https://www.eknet.org pgp: 481161A0 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: Wicket in Action: problem with redirection
I think I've got the same situation happening. It's a login link on my home page, whose onClick uses the usual: throw new RestartResponseAtInterceptPageException( AuctionApplication.get().getSignInPageClass()); I've stepped thru this a bit, and I find a problematic point in: RestartResponseAtInterceptPageException.InterceptData.set() where it captures what I think is supposed to be the home page url, which it is saving as follows: ... data.originalUrl = request.getOriginalUrl(); However, in my debugger, this is instead the Url of the link: http://localhost:8080/myapp/wicket/page?0-1.ILinkListener-userPanel-signIn If I manually change it in the debugger to just my home page Url, it seems to work fine. This was working last for me in 1.5-M3, and now in 1.5-RC1 it appears to have broken. Hope this helps narrow the search... Thanks, -- Jim. On Thu, Mar 10, 2011 at 1:50 PM, Jeremy Thomerson jer...@wickettraining.com wrote: On Thu, Mar 10, 2011 at 12:36 PM, Jim Goodwin sophin...@comcast.net wrote: I'm a Wicket newbie, working my way through /Wicket in Action. /I don't understand redirection too clearly yet, but there is an example in the book which doesn't work right when I try it and I'd like to ask if the book example code makes sense to more experienced folks. Page 271 Listing 11.3 line 4: The onSubmit() method calls !continueToOriginalDestination(). continueToOriginalDestination() lets the user continue on to the place they were going before being interrupted by the security mechanism if they aren't logged in. i.e: user on home page user clicks restricted page link security strategy says can't go there without being logged in as X, redirects user to login page user logs in, and continueToOriginalDestination() redirects to restricted page (original dest) and returns true. another example: user clicks bookmarked link in a new tab in their browser to login page (or goes to unrestricted home page and clicks link for login page) user logs in, and continueToOriginalDestination() can't redirect them anywhere, because there is no original destination that was interrupted Page 272 Listing 11.4 , new Link(...){ ... method onClick(): throws new RestartResponseAtInterceptPageException(signInPage) This is a way to stop processing at ANY point in your application and redirect the user to a certain page. How is this supposed to work? Suppose the user is on the Home page, and the Home Page has a UserPanel, and the user clicks on the Sign In link. Then the link itself sets an intercept to the sign-in page (that is how the link arranges to take you there, as far as I can understand). But then, when the user enters name/password and submits, and the submit method calls continueToOriginalDestination(), it will always succceed, and find the original destination to be the signIn page, regardless of where it really originated (the Home Page, in this case). You're a bit confused by original and destination. Since the user clicked the signin page link, the *destination* was the signin page - which is unrestricted, so the continueToOriginalDestination() method can not redirect them anywhere, and thus returns false. You now need to redirect them somewhere manually or the signin page will re-render. The *origin* was the home page - but that doesn't matter. Don't be thrown off by original (destination) and origin - which are two different things. :) For a while my code was working like that: Signing in worked, i.e. it did sign you in, but you were returned to a blank sign-in page. (My code doesn't work like that just this minute, but that is only because I've been enhancing it with other bugs.) Can anyone explain how the book-example is supposed to work? Thanks Jim -- Jeremy Thomerson http://wickettraining.com *Need a CMS for Wicket? Use Brix! http://brixcms.org*