Re: Set Double to more than 3 digits in AjaxEditableLabel
Yes, it should have been super.newNumberFormat(locale) On Fri, Aug 17, 2018, 09:27 vp143 wrote: > Thanks Martin, that worked great! > > Just for completeness, I needed to make a slight modification as I did not > find super.createNumberFormat > > DoubleConverter dc = new DoubleConverter() { > @Override > protected NumberFormat newNumberFormat(final Locale > locale) { > NumberFormat format = > NumberFormat.getInstance(locale); > format.setMaximumFractionDigits(12); > return format; > } > }; > > -- > Sent from: > http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Set Double to more than 3 digits in AjaxEditableLabel
Thanks Martin, that worked great! Just for completeness, I needed to make a slight modification as I did not find super.createNumberFormat DoubleConverter dc = new DoubleConverter() { @Override protected NumberFormat newNumberFormat(final Locale locale) { NumberFormat format = NumberFormat.getInstance(locale); format.setMaximumFractionDigits(12); return format; } }; -- Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Set Double to more than 3 digits in AjaxEditableLabel
Hi, The way you did this will mutate the singleton instance. The recommended way is to instantiate it yourself and override org.apache.wicket.util.convert.converter.AbstractDecimalConverter#newNumberFormat I.e. DoubleConverter dc = new DoubleConverter() { @Override protected NumberFormat newNumberFormat(final Locale locale) { NumberFormat format = super.createNumberFormat(getLocale()); format.setMaximumFractionDigits(12); return format; } } On Thu, Aug 16, 2018 at 10:26 AM Vishal Popat wrote: > Hi, > > In Wicket 6.29.0, I did the following within a class that extended > AjaxEditableLabel > > @Override > public IConverter getConverter(Class clazz) { > DoubleConverter converter = > (DoubleConverter)DoubleConverter.INSTANCE; > NumberFormat format = converter.getNumberFormat(getLocale()); > format.setMaximumFractionDigits(12); > converter.setNumberFormat(getLocale(), format); > return converter; > } > > In Wicket 7.10.0, converter.setNumberFormat no longer exists. I am not > sure what I need to do to increase the fraction digit to 12 as it is > currently set to 3. > > Any help would be appreciated. > > Vishal > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Set Double to more than 3 digits in AjaxEditableLabel
Hi, In Wicket 6.29.0, I did the following within a class that extended AjaxEditableLabel @Override public IConverter getConverter(Class clazz) { DoubleConverter converter = (DoubleConverter)DoubleConverter.INSTANCE; NumberFormat format = converter.getNumberFormat(getLocale()); format.setMaximumFractionDigits(12); converter.setNumberFormat(getLocale(), format); return converter; } In Wicket 7.10.0, converter.setNumberFormat no longer exists. I am not sure what I need to do to increase the fraction digit to 12 as it is currently set to 3. Any help would be appreciated. Vishal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Access to Dynamically Generated AjaxEditableLabel Value
Hi, You have to update the models, so you are doing it right! Please create a simple demo application and share it with us (e.g. at GitHub, BitBucket) and we will try to see where is the problem. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Thu, May 18, 2017 at 9:23 AM, Ehsan <e.amiryous...@gmail.com> wrote: > Hi Martin, > Thank you for your answer. > I changed the the Model of the AEL but still can not retrieve the values > which are entered in them. Could you please let me know how can I retrieve > these values for each row of table? > > > Thanks in advance > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/Access-to-Dynamically-Generated-AjaxEditableLabel-Value- > tp4677886p4677890.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: Access to Dynamically Generated AjaxEditableLabel Value
Hi Martin, Thank you for your answer. I changed the the Model of the AEL but still can not retrieve the values which are entered in them. Could you please let me know how can I retrieve these values for each row of table? Thanks in advance -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Access-to-Dynamically-Generated-AjaxEditableLabel-Value-tp4677886p4677890.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: Access to Dynamically Generated AjaxEditableLabel Value
Hi, You are using "cellItem.add(new AjaxEditableLabel(componentId)" i.e. the AEL has no its own model but uses IComponentInheritedModel from its parents. Try by using a model for AEL: cellItem.add(new AjaxEditableLabel(componentId, Model.of(0)) Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Wed, May 17, 2017 at 6:02 PM, Ehsan <e.amiryous...@gmail.com> wrote: > Hello every one, > I have recently started to work with Wicket. > Currently I am having a problem with AjaxEditableLabel. I am adding objects > from my defined class "TechnicalService" to an > AjaxFallBackDefaultDataTable. > This Object simply contains a String which is the first column of the > datatable. The second column is AjaxEditableLabel which I use to set a > number for each of technical services in the first column. Now the problem > I > am having is that I can not retrieve the values which are entered in each > of > the generated textFields. I tried to add them to a list in the bean object > by Overriding onSubmit method, but it does not work. Could any one help me > about this problem and let me know how to retrieve the values of the > dynamically generated AjaxEditableLabels? > > Here is my code: > > private class DataProvider extends SortableDataProvider<TechnicalService, > String> { > > /** > * > */ > private static final long serialVersionUID = > 7590206250581220823L; > > public DataProvider() { > super(); > this.setSort("id", > org.apache.wicket.extensions.markup.html.repeater.data. > sort.SortOrder.ASCENDING); > } > > public IModel model(TechnicalService > object) { > return Model.of(object); > } > > public Iterator iterator(long > offset, long > count) { > return searchForm.getTechnicalServices(). > iterator(); > } > > public long size() { > return searchForm.getTechnicalServices().size(); > } > } > > private List<IColumnTechnicalService, String>> getColumns() { > logger.debug("About to evaluate columns"); > > List<IColumnTechnicalService, String>> lReturn = new > LinkedList<IColumnTechnicalService, String>>(); > > lReturn.add(new PropertyColumn<TechnicalService, String>( > new > StringResourceModel("table.col.header.tecnicalServiceName", > this, > null), "ts", "ts")); > > lReturn.add(new PropertyColumn<TechnicalService, String>( > new > StringResourceModel("table.col.header.quantity", > this, null), > "technicalServiceNumber", > "technicalServiceNumber") { > private static final long serialVersionUID = > 8344520291257227470L; > > /** > * > */ > > @Override > public void populateItem(Item<ICellPopulator > TechnicalService>> > cellItem, String componentId, > IModel rowModel) > { > > final int index = cellItem.getIndex(); > > cellItem.add(new > AjaxEditableLabel(componentId) { > /** > * > */ > private static final long > serialVersionUID = -3528327724800319532L; > > TextField editor; > > @Override > protected FormComponent > newEditor(MarkupContainer parent, > String componentId, > IModel > model) { > editor = > (TextField) super.newEditor(parent, componentId, > model); > editor.setVisible(true); > return editor; > } > > @Override > protected Component > newLabel(
Access to Dynamically Generated AjaxEditableLabel Value
Hello every one, I have recently started to work with Wicket. Currently I am having a problem with AjaxEditableLabel. I am adding objects from my defined class "TechnicalService" to an AjaxFallBackDefaultDataTable. This Object simply contains a String which is the first column of the datatable. The second column is AjaxEditableLabel which I use to set a number for each of technical services in the first column. Now the problem I am having is that I can not retrieve the values which are entered in each of the generated textFields. I tried to add them to a list in the bean object by Overriding onSubmit method, but it does not work. Could any one help me about this problem and let me know how to retrieve the values of the dynamically generated AjaxEditableLabels? Here is my code: private class DataProvider extends SortableDataProvider<TechnicalService, String> { /** * */ private static final long serialVersionUID = 7590206250581220823L; public DataProvider() { super(); this.setSort("id", org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder.ASCENDING); } public IModel model(TechnicalService object) { return Model.of(object); } public Iterator iterator(long offset, long count) { return searchForm.getTechnicalServices().iterator(); } public long size() { return searchForm.getTechnicalServices().size(); } } private List<IColumnTechnicalService, String>> getColumns() { logger.debug("About to evaluate columns"); List<IColumnTechnicalService, String>> lReturn = new LinkedList<IColumnTechnicalService, String>>(); lReturn.add(new PropertyColumn<TechnicalService, String>( new StringResourceModel("table.col.header.tecnicalServiceName", this, null), "ts", "ts")); lReturn.add(new PropertyColumn<TechnicalService, String>( new StringResourceModel("table.col.header.quantity", this, null), "technicalServiceNumber", "technicalServiceNumber") { private static final long serialVersionUID = 8344520291257227470L; /** * */ @Override public void populateItem(Item<ICellPopulatorTechnicalService>> cellItem, String componentId, IModel rowModel) { final int index = cellItem.getIndex(); cellItem.add(new AjaxEditableLabel(componentId) { /** * */ private static final long serialVersionUID = -3528327724800319532L; TextField editor; @Override protected FormComponent newEditor(MarkupContainer parent, String componentId, IModel model) { editor = (TextField) super.newEditor(parent, componentId, model); editor.setVisible(true); return editor; } @Override protected Component newLabel(MarkupContainer parent, String componentId, IModel model) { return super.newLabel(parent, componentId, model).setVisible(false); } @Override protected void onSubmit(AjaxRequestTarget target) { super.onSubmit(target); rolloutBean.getListOfCells().set(index, getModelObject()); } }); } }); return lReturn; } I also attach the photo of the GUI: <http://apache-wicket.1842946.n4.nabble.com/file/n4677886/Screen_Shot_2017-05-17_at_18.png> -- View this message in context
Re: AjaxEditableLabel as Filter in FormFilter?
Hi Sebastien, Sorry - I should have written a bit more about what I'm trying to achieve. I want to have an AjaxEditableLabel as a Filter (column header), but just overriding getFilter and providing a filter class with an AjaxEditableLabel doesn't work for me. Here's my class: public class AjaxEditableLabelFilterT extends AbstractFilter { private final AjaxEditableLabelT filter; // This was a TextField before public AjaxEditableLabelFilter(final String id, final IModelT model, final FilterForm? form){ super(id, form); filter = new AjaxEditableLabelT(filter, model); // This was a TextField before add(filter); } public final AjaxEditableLabelT getFilter(){ return filter; // This returned a TextField before } } Any ideas? Thank you On 9 October 2013 19:32, Rodrigo Heffner rodrigo.heff...@gmail.com wrote: Hi Sebastien, I'll be able to check this tomorrow, when I have my laptop with me. Thank you very much for your response, I'll let you know how I get on. Best regards, Rodrigo On Oct 9, 2013 5:18 PM, Sebastien seb...@gmail.com wrote: Hi, I've got something like this, if it can helps... public abstract class EditableTextFilteredPropertyColumnT, F, S extends FilteredPropertyColumnT, S { private static final long serialVersionUID = 1L; public EditableTextFilteredPropertyColumn(IModelString displayModel, S sortProperty, String propertyExpression) { super(displayModel, sortProperty, propertyExpression); } public EditableTextFilteredPropertyColumn(IModelString displayModel, String propertyExpression) { super(displayModel, propertyExpression); } @Override public void populateItem(ItemICellPopulatorT cellItem, String componentId, IModelT rowModel) { cellItem.add(this.getEditableLabel(componentId, rowModel, new PropertyModelF(rowModel, getPropertyExpression(; } protected abstract AjaxEditableLabelF getEditableLabel(String componentId, IModelT rowModel, IModelF cellModel); @Override public Component getFilter(String componentId, FilterForm? form) { return new TextFilterF(componentId, this.getFilterModel(form), form); } protected IModelF getFilterModel(FilterForm? form) { return new PropertyModelF(form.getDefaultModel(), this.getPropertyExpression()); } } Best regards, Sebastien On Wed, Oct 9, 2013 at 5:53 PM, Rodrigo Heffner rodrigo.heff...@gmail.comwrote: Hello, In a FilterForm, I tried replace my TextFilteredPropertyColumn for an AjaxEditableLabelFilteredPropertyColumn, but didn't have much success. Has anyone tried something similar? Thank you -- Rodrigo H M Bezerra -- Rodrigo H M Bezerra
Re: AjaxEditableLabel as Filter in FormFilter?
Ok, so when I use an AjaxEditableLabel as a filter I come across these problems: 1) Incorrect state when I open a page with the AjaxEditableLabel as a FilterForm filter Expected: the column with an AjaxEditableLabel as a filter should display ... on it's header Actual: the column with an AjaxEditableLabel as a filter displays a textfield AND ... on it's header 2) Problem when clicking the ... label Expected: the ... should transform into a textfield Actual: clicking ... adds a new textfield under the same column. ... can still be clicked, adding more textfields to this column's header. If I click in any of these new textfields and then click on something else (onBlur), I get an Access Denied Page. On 10 October 2013 10:11, Martin Grigorov mgrigo...@apache.org wrote: On Thu, Oct 10, 2013 at 12:04 PM, Rodrigo Heffner rodrigo.heff...@gmail.com wrote: Hi Sebastien, Sorry - I should have written a bit more about what I'm trying to achieve. I want to have an AjaxEditableLabel as a Filter (column header), but just overriding getFilter and providing a filter class with an AjaxEditableLabel doesn't work for me. Here's my class: Unless we have better description of it doesn't work for me we have no idea how to fix/improve it. public class AjaxEditableLabelFilterT extends AbstractFilter { private final AjaxEditableLabelT filter; // This was a TextField before public AjaxEditableLabelFilter(final String id, final IModelT model, final FilterForm? form){ super(id, form); filter = new AjaxEditableLabelT(filter, model); // This was a TextField before add(filter); } public final AjaxEditableLabelT getFilter(){ return filter; // This returned a TextField before } } Any ideas? Thank you On 9 October 2013 19:32, Rodrigo Heffner rodrigo.heff...@gmail.com wrote: Hi Sebastien, I'll be able to check this tomorrow, when I have my laptop with me. Thank you very much for your response, I'll let you know how I get on. Best regards, Rodrigo On Oct 9, 2013 5:18 PM, Sebastien seb...@gmail.com wrote: Hi, I've got something like this, if it can helps... public abstract class EditableTextFilteredPropertyColumnT, F, S extends FilteredPropertyColumnT, S { private static final long serialVersionUID = 1L; public EditableTextFilteredPropertyColumn(IModelString displayModel, S sortProperty, String propertyExpression) { super(displayModel, sortProperty, propertyExpression); } public EditableTextFilteredPropertyColumn(IModelString displayModel, String propertyExpression) { super(displayModel, propertyExpression); } @Override public void populateItem(ItemICellPopulatorT cellItem, String componentId, IModelT rowModel) { cellItem.add(this.getEditableLabel(componentId, rowModel, new PropertyModelF(rowModel, getPropertyExpression(; } protected abstract AjaxEditableLabelF getEditableLabel(String componentId, IModelT rowModel, IModelF cellModel); @Override public Component getFilter(String componentId, FilterForm? form) { return new TextFilterF(componentId, this.getFilterModel(form), form); } protected IModelF getFilterModel(FilterForm? form) { return new PropertyModelF(form.getDefaultModel(), this.getPropertyExpression()); } } Best regards, Sebastien On Wed, Oct 9, 2013 at 5:53 PM, Rodrigo Heffner rodrigo.heff...@gmail.comwrote: Hello, In a FilterForm, I tried replace my TextFilteredPropertyColumn for an AjaxEditableLabelFilteredPropertyColumn, but didn't have much success. Has anyone tried something similar? Thank you -- Rodrigo H M Bezerra -- Rodrigo H M Bezerra -- Rodrigo H M Bezerra
Re: AjaxEditableLabel as Filter in FormFilter?
Please create a quickstart app or GitHub project so we can debug it. I have no idea why it behaves this way at the moment. On Thu, Oct 10, 2013 at 12:39 PM, Rodrigo Heffner rodrigo.heff...@gmail.com wrote: Ok, so when I use an AjaxEditableLabel as a filter I come across these problems: 1) Incorrect state when I open a page with the AjaxEditableLabel as a FilterForm filter Expected: the column with an AjaxEditableLabel as a filter should display ... on it's header Actual: the column with an AjaxEditableLabel as a filter displays a textfield AND ... on it's header 2) Problem when clicking the ... label Expected: the ... should transform into a textfield Actual: clicking ... adds a new textfield under the same column. ... can still be clicked, adding more textfields to this column's header. If I click in any of these new textfields and then click on something else (onBlur), I get an Access Denied Page. On 10 October 2013 10:11, Martin Grigorov mgrigo...@apache.org wrote: On Thu, Oct 10, 2013 at 12:04 PM, Rodrigo Heffner rodrigo.heff...@gmail.com wrote: Hi Sebastien, Sorry - I should have written a bit more about what I'm trying to achieve. I want to have an AjaxEditableLabel as a Filter (column header), but just overriding getFilter and providing a filter class with an AjaxEditableLabel doesn't work for me. Here's my class: Unless we have better description of it doesn't work for me we have no idea how to fix/improve it. public class AjaxEditableLabelFilterT extends AbstractFilter { private final AjaxEditableLabelT filter; // This was a TextField before public AjaxEditableLabelFilter(final String id, final IModelT model, final FilterForm? form){ super(id, form); filter = new AjaxEditableLabelT(filter, model); // This was a TextField before add(filter); } public final AjaxEditableLabelT getFilter(){ return filter; // This returned a TextField before } } Any ideas? Thank you On 9 October 2013 19:32, Rodrigo Heffner rodrigo.heff...@gmail.com wrote: Hi Sebastien, I'll be able to check this tomorrow, when I have my laptop with me. Thank you very much for your response, I'll let you know how I get on. Best regards, Rodrigo On Oct 9, 2013 5:18 PM, Sebastien seb...@gmail.com wrote: Hi, I've got something like this, if it can helps... public abstract class EditableTextFilteredPropertyColumnT, F, S extends FilteredPropertyColumnT, S { private static final long serialVersionUID = 1L; public EditableTextFilteredPropertyColumn(IModelString displayModel, S sortProperty, String propertyExpression) { super(displayModel, sortProperty, propertyExpression); } public EditableTextFilteredPropertyColumn(IModelString displayModel, String propertyExpression) { super(displayModel, propertyExpression); } @Override public void populateItem(ItemICellPopulatorT cellItem, String componentId, IModelT rowModel) { cellItem.add(this.getEditableLabel(componentId, rowModel, new PropertyModelF(rowModel, getPropertyExpression(; } protected abstract AjaxEditableLabelF getEditableLabel(String componentId, IModelT rowModel, IModelF cellModel); @Override public Component getFilter(String componentId, FilterForm? form) { return new TextFilterF(componentId, this.getFilterModel(form), form); } protected IModelF getFilterModel(FilterForm? form) { return new PropertyModelF(form.getDefaultModel(), this.getPropertyExpression()); } } Best regards, Sebastien On Wed, Oct 9, 2013 at 5:53 PM, Rodrigo Heffner rodrigo.heff...@gmail.comwrote: Hello, In a FilterForm, I tried replace my TextFilteredPropertyColumn for an AjaxEditableLabelFilteredPropertyColumn, but didn't have much success. Has anyone tried something similar? Thank you -- Rodrigo H M Bezerra -- Rodrigo H M Bezerra -- Rodrigo H M Bezerra
Re: AjaxEditableLabel as Filter in FormFilter?
AjaxEditableLabelFilter.html should be: wicket:panel xmlns:wicket=http://wicket.apache.org; div wicket:id=filter/div /wicket:panel AjaxEditableLabel is a Panel, not a TextField. On Thu, Oct 10, 2013 at 4:58 PM, Rodrigo Heffner rodrigo.heff...@gmail.comwrote: There you go. Thank you. On 10 October 2013 13:15, Martin Grigorov mgrigo...@apache.org wrote: Please create a quickstart app or GitHub project so we can debug it. I have no idea why it behaves this way at the moment. On Thu, Oct 10, 2013 at 12:39 PM, Rodrigo Heffner rodrigo.heff...@gmail.com wrote: Ok, so when I use an AjaxEditableLabel as a filter I come across these problems: 1) Incorrect state when I open a page with the AjaxEditableLabel as a FilterForm filter Expected: the column with an AjaxEditableLabel as a filter should display ... on it's header Actual: the column with an AjaxEditableLabel as a filter displays a textfield AND ... on it's header 2) Problem when clicking the ... label Expected: the ... should transform into a textfield Actual: clicking ... adds a new textfield under the same column. ... can still be clicked, adding more textfields to this column's header. If I click in any of these new textfields and then click on something else (onBlur), I get an Access Denied Page. On 10 October 2013 10:11, Martin Grigorov mgrigo...@apache.org wrote: On Thu, Oct 10, 2013 at 12:04 PM, Rodrigo Heffner rodrigo.heff...@gmail.com wrote: Hi Sebastien, Sorry - I should have written a bit more about what I'm trying to achieve. I want to have an AjaxEditableLabel as a Filter (column header), but just overriding getFilter and providing a filter class with an AjaxEditableLabel doesn't work for me. Here's my class: Unless we have better description of it doesn't work for me we have no idea how to fix/improve it. public class AjaxEditableLabelFilterT extends AbstractFilter { private final AjaxEditableLabelT filter; // This was a TextField before public AjaxEditableLabelFilter(final String id, final IModelT model, final FilterForm? form){ super(id, form); filter = new AjaxEditableLabelT(filter, model); // This was a TextField before add(filter); } public final AjaxEditableLabelT getFilter(){ return filter; // This returned a TextField before } } Any ideas? Thank you On 9 October 2013 19:32, Rodrigo Heffner rodrigo.heff...@gmail.com wrote: Hi Sebastien, I'll be able to check this tomorrow, when I have my laptop with me. Thank you very much for your response, I'll let you know how I get on. Best regards, Rodrigo On Oct 9, 2013 5:18 PM, Sebastien seb...@gmail.com wrote: Hi, I've got something like this, if it can helps... public abstract class EditableTextFilteredPropertyColumnT, F, S extends FilteredPropertyColumnT, S { private static final long serialVersionUID = 1L; public EditableTextFilteredPropertyColumn(IModelString displayModel, S sortProperty, String propertyExpression) { super(displayModel, sortProperty, propertyExpression); } public EditableTextFilteredPropertyColumn(IModelString displayModel, String propertyExpression) { super(displayModel, propertyExpression); } @Override public void populateItem(ItemICellPopulatorT cellItem, String componentId, IModelT rowModel) { cellItem.add(this.getEditableLabel(componentId, rowModel, new PropertyModelF(rowModel, getPropertyExpression(; } protected abstract AjaxEditableLabelF getEditableLabel(String componentId, IModelT rowModel, IModelF cellModel); @Override public Component getFilter(String componentId, FilterForm? form) { return new TextFilterF(componentId, this.getFilterModel(form), form); } protected IModelF getFilterModel(FilterForm? form) { return new PropertyModelF(form.getDefaultModel(), this.getPropertyExpression()); } } Best regards, Sebastien On Wed, Oct 9, 2013 at 5:53 PM, Rodrigo Heffner rodrigo.heff...@gmail.comwrote: Hello, In a FilterForm, I tried replace my TextFilteredPropertyColumn for an AjaxEditableLabelFilteredPropertyColumn, but didn't have much success. Has anyone tried something similar? Thank you -- Rodrigo H M Bezerra -- Rodrigo H M Bezerra -- Rodrigo H M Bezerra -- Rodrigo H M Bezerra
AjaxEditableLabel as Filter in FormFilter?
Hello, In a FilterForm, I tried replace my TextFilteredPropertyColumn for an AjaxEditableLabelFilteredPropertyColumn, but didn't have much success. Has anyone tried something similar? Thank you -- Rodrigo H M Bezerra
Re: AjaxEditableLabel as Filter in FormFilter?
Hi, I've got something like this, if it can helps... public abstract class EditableTextFilteredPropertyColumnT, F, S extends FilteredPropertyColumnT, S { private static final long serialVersionUID = 1L; public EditableTextFilteredPropertyColumn(IModelString displayModel, S sortProperty, String propertyExpression) { super(displayModel, sortProperty, propertyExpression); } public EditableTextFilteredPropertyColumn(IModelString displayModel, String propertyExpression) { super(displayModel, propertyExpression); } @Override public void populateItem(ItemICellPopulatorT cellItem, String componentId, IModelT rowModel) { cellItem.add(this.getEditableLabel(componentId, rowModel, new PropertyModelF(rowModel, getPropertyExpression(; } protected abstract AjaxEditableLabelF getEditableLabel(String componentId, IModelT rowModel, IModelF cellModel); @Override public Component getFilter(String componentId, FilterForm? form) { return new TextFilterF(componentId, this.getFilterModel(form), form); } protected IModelF getFilterModel(FilterForm? form) { return new PropertyModelF(form.getDefaultModel(), this.getPropertyExpression()); } } Best regards, Sebastien On Wed, Oct 9, 2013 at 5:53 PM, Rodrigo Heffner rodrigo.heff...@gmail.comwrote: Hello, In a FilterForm, I tried replace my TextFilteredPropertyColumn for an AjaxEditableLabelFilteredPropertyColumn, but didn't have much success. Has anyone tried something similar? Thank you -- Rodrigo H M Bezerra
Re: AjaxEditableLabel as Filter in FormFilter?
Hi Sebastien, I'll be able to check this tomorrow, when I have my laptop with me. Thank you very much for your response, I'll let you know how I get on. Best regards, Rodrigo On Oct 9, 2013 5:18 PM, Sebastien seb...@gmail.com wrote: Hi, I've got something like this, if it can helps... public abstract class EditableTextFilteredPropertyColumnT, F, S extends FilteredPropertyColumnT, S { private static final long serialVersionUID = 1L; public EditableTextFilteredPropertyColumn(IModelString displayModel, S sortProperty, String propertyExpression) { super(displayModel, sortProperty, propertyExpression); } public EditableTextFilteredPropertyColumn(IModelString displayModel, String propertyExpression) { super(displayModel, propertyExpression); } @Override public void populateItem(ItemICellPopulatorT cellItem, String componentId, IModelT rowModel) { cellItem.add(this.getEditableLabel(componentId, rowModel, new PropertyModelF(rowModel, getPropertyExpression(; } protected abstract AjaxEditableLabelF getEditableLabel(String componentId, IModelT rowModel, IModelF cellModel); @Override public Component getFilter(String componentId, FilterForm? form) { return new TextFilterF(componentId, this.getFilterModel(form), form); } protected IModelF getFilterModel(FilterForm? form) { return new PropertyModelF(form.getDefaultModel(), this.getPropertyExpression()); } } Best regards, Sebastien On Wed, Oct 9, 2013 at 5:53 PM, Rodrigo Heffner rodrigo.heff...@gmail.comwrote: Hello, In a FilterForm, I tried replace my TextFilteredPropertyColumn for an AjaxEditableLabelFilteredPropertyColumn, but didn't have much success. Has anyone tried something similar? Thank you -- Rodrigo H M Bezerra
Re: AjaxEditableLabel not saving after migration to 6.3
I believe this is a bug in wicket 6.3, because I switched to wicket 6.4 and it miraculously works again without code changes on my side. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxEditableLabel-not-saving-after-migration-to-6-3-tp4654769p4655314.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
AjaxEditableLabel not saving after migration to 6.3
Hi all, I recently migrated from 1.5.5 to 6.3. My objective is to display a list of group members with the ability to insert or update an expiration date for a specific member. It worked correctly before, but now I'm having problems with my AjaxEditableLabel nested in a PropertyColumn. I can click the label and type something, but on hitting enter, nothing changes and the onSubmit() is never called. As I said, it worked in 1.5. Below is a code excerpt. Any pointers would be appreciated, Natalie private class PersonTabPanel extends Panel { public PersonTabPanel(String id){ super(id); AjaxFallbackDefaultDataTable dataTable = new AjaxFallbackDefaultDataTable(memberTable, definePersonColumns(), new MemberDataProvider(currentGroup, MEMBER, PERSON), ELEMENTS_PER_PAGE); dataTable.setItemReuseStrategy(new DefaultItemReuseStrategy()); add(dataTable); } } public ListIColumnlt;MemberInterface, Object definePersonColumns(){ ListIColumnlt;MemberInterface, Object columns = new ArrayListIColumnlt;MemberInterface, Object(); columns.add(new PropertyColumnMemberInterface, Object(new ModelString(Last Name), lastname, lastname)); columns.add(new PropertyColumnMemberInterface, Object(new ModelString(First Name), displayedFirstName, displayedFirstName)); columns.add(new PropertyColumnMemberInterface, Object(new ModelString(Email Address), emailAddress, emailAddress)); if (isMemberEditAuthorized(currentGroup.getGroupCode()) ){ columns.add(new PropertyColumnMemberInterface, Object(new ModelString(Expiration (MM/DD/YY)), expirationDate, expirationDate) { @Override public void populateItem(ItemICellPopulatorlt;MemberInterface cellItem, String componentId, final IModelMemberInterface rowModel) { AjaxEditableLabelDate editableLabel = new AjaxEditableLabelDate(componentId, new PropertyModelDate(rowModel, expirationDate)){ @Override protected void onSubmit(AjaxRequestTarget target){ int groupCode = currentGroup.getGroupCode(); Date expiration = (Date) getDefaultModelObject(); if (expiration != null) expiration = new Date(expiration.getTime() + 86399000L); //expires at 23:59:59 on the given date MemberInterface selectedMember = (MemberInterface) rowModel.getObject(); int gidm = selectedMember.getGidm(); String memberType = selectedMember.getMemberType(); try { expireMember(sessionId, midm, groupCode, gidm, memberType, expiration); logger.debug({}:{}: Set a member expiration date to + expiration+ for GIDM +gidm, sessionId, midm); } catch (Exception e) { logger.error(Caught an exception while updating a group member expiration, e); error(An error occurred while updating the expiration date.); } getLabel().setVisible(true); getEditor().setVisible(false); target.add(this); target.appendJavaScript(window.status='';); target.add(feedback); } @Override protected String defaultNullLabel(){ return ([click to edit]); } @Override protected void onError(AjaxRequestTarget target){ target.add(feedback); } }; cellItem.add(editableLabel); } }); [Rest of code omitted] -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxEditableLabel-not-saving-after-migration-to-6-3-tp4654769.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: AjaxEditableLabel not saving after migration to 6.3
Hi, By default AEL submits on ENTER key press or blur event. Does it work with blur ? Check with Firebug or similar whether an Ajax call is made at all. Check whether http://www.wicket-library.com/wicket-examples-6.0.x/ajax/editable-labelhttp://www.wicket-library.com/wicket-examples-6.0.x/ajax/editable-label?0 works with your browser. On Thu, Dec 13, 2012 at 4:16 PM, N. Metzger nmetz...@odu.edu wrote: Hi all, I recently migrated from 1.5.5 to 6.3. My objective is to display a list of group members with the ability to insert or update an expiration date for a specific member. It worked correctly before, but now I'm having problems with my AjaxEditableLabel nested in a PropertyColumn. I can click the label and type something, but on hitting enter, nothing changes and the onSubmit() is never called. As I said, it worked in 1.5. Below is a code excerpt. Any pointers would be appreciated, Natalie private class PersonTabPanel extends Panel { public PersonTabPanel(String id){ super(id); AjaxFallbackDefaultDataTable dataTable = new AjaxFallbackDefaultDataTable(memberTable, definePersonColumns(), new MemberDataProvider(currentGroup, MEMBER, PERSON), ELEMENTS_PER_PAGE); dataTable.setItemReuseStrategy(new DefaultItemReuseStrategy()); add(dataTable); } } public ListIColumnlt;MemberInterface, Object definePersonColumns(){ ListIColumnlt;MemberInterface, Object columns = new ArrayListIColumnlt;MemberInterface, Object(); columns.add(new PropertyColumnMemberInterface, Object(new ModelString(Last Name), lastname, lastname)); columns.add(new PropertyColumnMemberInterface, Object(new ModelString(First Name), displayedFirstName, displayedFirstName)); columns.add(new PropertyColumnMemberInterface, Object(new ModelString(Email Address), emailAddress, emailAddress)); if (isMemberEditAuthorized(currentGroup.getGroupCode()) ){ columns.add(new PropertyColumnMemberInterface, Object(new ModelString(Expiration (MM/DD/YY)), expirationDate, expirationDate) { @Override public void populateItem(ItemICellPopulatorlt;MemberInterface cellItem, String componentId, final IModelMemberInterface rowModel) { AjaxEditableLabelDate editableLabel = new AjaxEditableLabelDate(componentId, new PropertyModelDate(rowModel, expirationDate)){ @Override protected void onSubmit(AjaxRequestTarget target){ int groupCode = currentGroup.getGroupCode(); Date expiration = (Date) getDefaultModelObject(); if (expiration != null) expiration = new Date(expiration.getTime() + 86399000L); //expires at 23:59:59 on the given date MemberInterface selectedMember = (MemberInterface) rowModel.getObject(); int gidm = selectedMember.getGidm(); String memberType = selectedMember.getMemberType(); try { expireMember(sessionId, midm, groupCode, gidm, memberType, expiration); logger.debug({}:{}: Set a member expiration date to + expiration+ for GIDM +gidm, sessionId, midm); } catch (Exception e) { logger.error(Caught an exception while updating a group member expiration, e); error(An error occurred while updating the expiration date.); } getLabel().setVisible(true); getEditor().setVisible(false); target.add(this); target.appendJavaScript(window.status='';); target.add(feedback); } @Override protected String defaultNullLabel(){ return ([click to edit]); } @Override protected void onError(AjaxRequestTarget target){ target.add(feedback); } }; cellItem.add(editableLabel); } }); [Rest of code omitted] -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxEditableLabel-not-saving-after-migration-to-6-3-tp4654769.html Sent from the Users forum mailing list
Re: Toggle AjaxEditableLabel from other component?
Hi, You can use something like: jQuery('editableLabel').triggerHandler('click') to switch it to edit mode, and 'keyup' + keyCode == 27 (simulate pressing of ESCAPE) to switch to view mode. On Mon, Oct 15, 2012 at 4:44 AM, Ondrej Zizka ozi...@redhat.com wrote: Hi all, I'd like to toggle AjaxEditableLabel into edit mode and back based on user's interaction with other components. How can I do that? Also, it seems that AEL switches the representing element between span and input. I would rather have it an input which only changes styles and gets disabled when not in edit mode. Is there some such alternative impl of AJAX editable label? And lastly, if there's not, I'd like make one. Can someone please post a link to a tutorial on binding Javascript handlers to AJAX requests? I've checked AEL's impl but I'd rather read some theory first. Thanks, Ondra -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Toggle AjaxEditableLabel from other component?
Hi all, I'd like to toggle AjaxEditableLabel into edit mode and back based on user's interaction with other components. How can I do that? Also, it seems that AEL switches the representing element between span and input. I would rather have it an input which only changes styles and gets disabled when not in edit mode. Is there some such alternative impl of AJAX editable label? And lastly, if there's not, I'd like make one. Can someone please post a link to a tutorial on binding Javascript handlers to AJAX requests? I've checked AEL's impl but I'd rather read some theory first. Thanks, Ondra
Re: Toggle AjaxEditableLabel from other component?
Just use a regular TextField and toggle its enabled status in the Ajax callback handler. Be sure to refresh the element (target.add( yourTextComponent ) ); or the containing form if you have multiple components to toggle. For custom bindings, take a look at AbstractDefaultAjaxBehavior and its subclasses (In Wicket 6.0 - might be called the same in earlier versions) N On Sun, Oct 14, 2012 at 10:44 PM, Ondrej Zizka ozi...@redhat.com wrote: Hi all, I'd like to toggle AjaxEditableLabel into edit mode and back based on user's interaction with other components. How can I do that? Also, it seems that AEL switches the representing element between span and input. I would rather have it an input which only changes styles and gets disabled when not in edit mode. Is there some such alternative impl of AJAX editable label? And lastly, if there's not, I'd like make one. Can someone please post a link to a tutorial on binding Javascript handlers to AJAX requests? I've checked AEL's impl but I'd rather read some theory first. Thanks, Ondra - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEditableLabel Issue (Application in Production Mode)
Hi, Something else breaks the behavior. Create a quickstart app and you will see that AjaxEditableLabel works fine in Production mode. On Wed, Sep 26, 2012 at 6:58 PM, Corbin, James jcor...@iqnavigator.com wrote: Hi Martin, Thanks for the feedback. What is a bit confusing to me is how the behavior changes when running wicket in Production Mode (doesn't work) vs. Development Mode (works). I don't see why the wicket application mode would cause this behavior to change. In our situation the AjaxEditableLabel component is nested in a table cell and the table itself is parented by a Form. I will look for JS errors as you suggest. Thanks, J.D. On 9/26/12 12:59 AM, Martin Grigorov mgrigo...@apache.org wrote: Hi, It sounds like a JavaScript related problem. It could be that there is blocked Ajax channel and the click cannot make it to the server. Or something similar happened once, this leaded to different state at the server and the client and since then it cannot re-synchronizes the states. Reload the page and look for JavaScript errors. In Firebug do: Wicket.Log.error = function(text) {console.log(text);} On Tue, Sep 25, 2012 at 9:25 PM, Corbin, James jcor...@iqnavigator.com wrote: I have an interesting issue that crept up in the use of the AjaxEditableLabel component in Wicket 1.4.13 (I know, ancient). The component stopped processing the click event that is supposed to cause the editor to render. I was seeing different behavior depending upon the mode of the Wicket Application and wondered if anyone might have a clue as to what was going on. With the exact same source code, when the Wicket Application was configured to run in Production Mode, the AjaxEditableLabel would not, when clicked, render the editor, but when in Development mode, it worked as expected. In the server log there is a warning that the component is either not visible or not enabled, which I know isn't true because it works perfectly fine when the Wicket Application is in Development Mode. The only behavior that is being overridden on the AjaxEditableLabel instance is the onSubmit. I searched the forums and google and could not find anything that would explain the different behavior of this component when the application mode was changed from development to production. Interesting enough, the AjaxEditableLabel does work fine in Production mode in other areas of the application when no behaviors are overridden. Not sure if that has anything whatsoever to do with this issue. Ideas? J.D. -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEditableLabel Issue (Application in Production Mode)
Hi, It sounds like a JavaScript related problem. It could be that there is blocked Ajax channel and the click cannot make it to the server. Or something similar happened once, this leaded to different state at the server and the client and since then it cannot re-synchronizes the states. Reload the page and look for JavaScript errors. In Firebug do: Wicket.Log.error = function(text) {console.log(text);} On Tue, Sep 25, 2012 at 9:25 PM, Corbin, James jcor...@iqnavigator.com wrote: I have an interesting issue that crept up in the use of the AjaxEditableLabel component in Wicket 1.4.13 (I know, ancient). The component stopped processing the click event that is supposed to cause the editor to render. I was seeing different behavior depending upon the mode of the Wicket Application and wondered if anyone might have a clue as to what was going on. With the exact same source code, when the Wicket Application was configured to run in Production Mode, the AjaxEditableLabel would not, when clicked, render the editor, but when in Development mode, it worked as expected. In the server log there is a warning that the component is either not visible or not enabled, which I know isn't true because it works perfectly fine when the Wicket Application is in Development Mode. The only behavior that is being overridden on the AjaxEditableLabel instance is the onSubmit. I searched the forums and google and could not find anything that would explain the different behavior of this component when the application mode was changed from development to production. Interesting enough, the AjaxEditableLabel does work fine in Production mode in other areas of the application when no behaviors are overridden. Not sure if that has anything whatsoever to do with this issue. Ideas? J.D. -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEditableLabel Issue (Application in Production Mode)
Hi Martin, Thanks for the feedback. What is a bit confusing to me is how the behavior changes when running wicket in Production Mode (doesn't work) vs. Development Mode (works). I don't see why the wicket application mode would cause this behavior to change. In our situation the AjaxEditableLabel component is nested in a table cell and the table itself is parented by a Form. I will look for JS errors as you suggest. Thanks, J.D. On 9/26/12 12:59 AM, Martin Grigorov mgrigo...@apache.org wrote: Hi, It sounds like a JavaScript related problem. It could be that there is blocked Ajax channel and the click cannot make it to the server. Or something similar happened once, this leaded to different state at the server and the client and since then it cannot re-synchronizes the states. Reload the page and look for JavaScript errors. In Firebug do: Wicket.Log.error = function(text) {console.log(text);} On Tue, Sep 25, 2012 at 9:25 PM, Corbin, James jcor...@iqnavigator.com wrote: I have an interesting issue that crept up in the use of the AjaxEditableLabel component in Wicket 1.4.13 (I know, ancient). The component stopped processing the click event that is supposed to cause the editor to render. I was seeing different behavior depending upon the mode of the Wicket Application and wondered if anyone might have a clue as to what was going on. With the exact same source code, when the Wicket Application was configured to run in Production Mode, the AjaxEditableLabel would not, when clicked, render the editor, but when in Development mode, it worked as expected. In the server log there is a warning that the component is either not visible or not enabled, which I know isn't true because it works perfectly fine when the Wicket Application is in Development Mode. The only behavior that is being overridden on the AjaxEditableLabel instance is the onSubmit. I searched the forums and google and could not find anything that would explain the different behavior of this component when the application mode was changed from development to production. Interesting enough, the AjaxEditableLabel does work fine in Production mode in other areas of the application when no behaviors are overridden. Not sure if that has anything whatsoever to do with this issue. Ideas? J.D. -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.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
AjaxEditableLabel Issue (Application in Production Mode)
I have an interesting issue that crept up in the use of the AjaxEditableLabel component in Wicket 1.4.13 (I know, ancient). The component stopped processing the click event that is supposed to cause the editor to render. I was seeing different behavior depending upon the mode of the Wicket Application and wondered if anyone might have a clue as to what was going on. With the exact same source code, when the Wicket Application was configured to run in Production Mode, the AjaxEditableLabel would not, when clicked, render the editor, but when in Development mode, it worked as expected. In the server log there is a warning that the component is either not visible or not enabled, which I know isn't true because it works perfectly fine when the Wicket Application is in Development Mode. The only behavior that is being overridden on the AjaxEditableLabel instance is the onSubmit. I searched the forums and google and could not find anything that would explain the different behavior of this component when the application mode was changed from development to production. Interesting enough, the AjaxEditableLabel does work fine in Production mode in other areas of the application when no behaviors are overridden. Not sure if that has anything whatsoever to do with this issue. Ideas? J.D.
Re: AjaxEditableLabel causes exceptions after session timeout
Martin Grigorov píše v Út 18. 09. 2012 v 10:02 +0300: Hi, See https://issues.apache.org/jira/browse/WICKET-4594 The problem is that Wicket cannot differentiate between page parameters and ajax request parameters Maybe Wicket could off-load some of the AJAX params to headers? xmlhttp.setRequestHeader(Wicket-AJAX-param,foo=bar); Disclaimer: Just an idea, might be nonsense. and in case of page re-creation all of them were used as page parameters for the new page instance. When a page is automatically re-created due to expiration the callback method (like onClick, onChange, etc) is not executed because the component/behavior may not be visible/enabled in the page's initial state. So the page is recreated and rendered in its initial state, no callbacks are executed at all. The whole thing started as simple feature request in WICKET-4014 but since then it causes only problems ... :-/ On Tue, Sep 18, 2012 at 4:49 AM, Ondrej Zizka ozi...@redhat.com wrote: Is there a mechanism to let the page be re-created with the original PageParameters? Maybe they could be kept within JS of the page and sent with the AJAX request? That would probably need a change in Wicket's AJAX code. (Wicket 1.5) That was the case until recently but there was no way to differentiate between original page parameters and custom request parameters for the Ajax request itself. So we took the safest way by dropping all parameters when a page is being auto-recreated. Could this be made optional? Because, in case the developer knows that the URL has all the data the page needs to be recreated, he could setSendPageParametersOnAjaxRequests(true) or such... That would make life with Ajax components easier... would it? :-) Or maybe I don't get this fully, as I don't know the Wicket internals... in which case, I believe you there was no way. If you have a minute, could you briefly explain that or point me to some wiki? Thanks. Ondra
Re: AjaxEditableLabel causes exceptions after session timeout
Hi, See https://issues.apache.org/jira/browse/WICKET-4594 The problem is that Wicket cannot differentiate between page parameters and ajax request parameters and in case of page re-creation all of them were used as page parameters for the new page instance. When a page is automatically re-created due to expiration the callback method (like onClick, onChange, etc) is not executed because the component/behavior may not be visible/enabled in the page's initial state. So the page is recreated and rendered in its initial state, no callbacks are executed at all. The whole thing started as simple feature request in WICKET-4014 but since then it causes only problems ... :-/ On Tue, Sep 18, 2012 at 4:49 AM, Ondrej Zizka ozi...@redhat.com wrote: Is there a mechanism to let the page be re-created with the original PageParameters? Maybe they could be kept within JS of the page and sent with the AJAX request? That would probably need a change in Wicket's AJAX code. (Wicket 1.5) That was the case until recently but there was no way to differentiate between original page parameters and custom request parameters for the Ajax request itself. So we took the safest way by dropping all parameters when a page is being auto-recreated. Could this be made optional? Because, in case the developer knows that the URL has all the data the page needs to be recreated, he could setSendPageParametersOnAjaxRequests(true) or such... That would make life with Ajax components easier... would it? :-) Or maybe I don't get this fully, as I don't know the Wicket internals... in which case, I believe you there was no way. If you have a minute, could you briefly explain that or point me to some wiki? Thanks. Ondra -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEditableLabel causes exceptions after session timeout
Hi, Usage of Wicket's Ajax behaviors make the page stateful, so there is no easy way to make it stateless. The easiest solution is to use org.apache.wicket.settings.IPageSettings#setRecreateMountedPagesAfterExpiry(false). This way you'll see the configured org.apache.wicket.settings.IApplicationSettings#getPageExpiredErrorPage() instead of a new instance of your page. On Mon, Sep 17, 2012 at 5:23 AM, Ondrej Zizka ozi...@redhat.com wrote: Hi, I use a AjaxEditableLabel with a PropertyModel which points to an object of the Page. But after the session expires, clicking on the label to edit it causes exception because the object of the page is empty (in my case, it results into HBN's NoResultException). What's the way to handle this? The page is mounted as /product/${name}/${version}, so the URL contains the information necessary to reload the entire page. So perhaps I could use some LoadableDetachableModel somehow? I've read about making the page stateless. Would that help? Thanks, Ondra -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEditableLabel causes exceptions after session timeout
Ok, thanks. I set this.getPageSettings().setRecreateMountedPagesAfterExpiry(false); in the app class. But, to my previous point: The page is mounted and reached with all the necessary data (to get the entity). But on AjaxEditableLabel interaction, the page is created with empty PageParameters. Last cause: No entity found for query WicketMessage: Can't instantiate page using constructor 'public org.jboss.essc.web.pages.ReleasePage(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument ''. Might be it doesn't exist, may be it is not visible (public). Is there a mechanism to let the page be re-created with the original PageParameters? Maybe they could be kept within JS of the page and sent with the AJAX request? That would probably need a change in Wicket's AJAX code. (Wicket 1.5) And also, this brings me to other question - how can I control session programatically? I have seen some pages, old ones, and mostly they do a timer-based ajax request on a page to keep the session alive. Is that a best practice? (Assuming I want to keep the session short for other pages). Thanks, Ondra On Mon, 2012-09-17 at 10:50 +0300, Martin Grigorov wrote: Hi, Usage of Wicket's Ajax behaviors make the page stateful, so there is no easy way to make it stateless. The easiest solution is to use org.apache.wicket.settings.IPageSettings#setRecreateMountedPagesAfterExpiry(false). This way you'll see the configured org.apache.wicket.settings.IApplicationSettings#getPageExpiredErrorPage() instead of a new instance of your page. On Mon, Sep 17, 2012 at 5:23 AM, Ondrej Zizka ozi...@redhat.com wrote: Hi, I use a AjaxEditableLabel with a PropertyModel which points to an object of the Page. But after the session expires, clicking on the label to edit it causes exception because the object of the page is empty (in my case, it results into HBN's NoResultException). What's the way to handle this? The page is mounted as /product/${name}/${version}, so the URL contains the information necessary to reload the entire page. So perhaps I could use some LoadableDetachableModel somehow? I've read about making the page stateless. Would that help? Thanks, Ondra
Re: AjaxEditableLabel causes exceptions after session timeout
On Mon, Sep 17, 2012 at 5:59 PM, Ondrej Zizka ozi...@redhat.com wrote: Ok, thanks. I set this.getPageSettings().setRecreateMountedPagesAfterExpiry(false); in the app class. But, to my previous point: The page is mounted and reached with all the necessary data (to get the entity). But on AjaxEditableLabel interaction, the page is created with empty PageParameters. Last cause: No entity found for query WicketMessage: Can't instantiate page using constructor 'public org.jboss.essc.web.pages.ReleasePage(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument ''. Might be it doesn't exist, may be it is not visible (public). Is there a mechanism to let the page be re-created with the original PageParameters? Maybe they could be kept within JS of the page and sent with the AJAX request? That would probably need a change in Wicket's AJAX code. (Wicket 1.5) That was the case until recently but there was no way to differentiate between original page parameters and custom request parameters for the Ajax request itself. So we took the safest way by dropping all parameters when a page is being auto-recreated. And also, this brings me to other question - how can I control session programatically? I have seen some pages, old ones, and mostly they do a timer-based ajax request on a page to keep the session alive. Is that a best practice? (Assuming I want to keep the session short for other pages). I am not aware of another way to do this. Thanks, Ondra On Mon, 2012-09-17 at 10:50 +0300, Martin Grigorov wrote: Hi, Usage of Wicket's Ajax behaviors make the page stateful, so there is no easy way to make it stateless. The easiest solution is to use org.apache.wicket.settings.IPageSettings#setRecreateMountedPagesAfterExpiry(false). This way you'll see the configured org.apache.wicket.settings.IApplicationSettings#getPageExpiredErrorPage() instead of a new instance of your page. On Mon, Sep 17, 2012 at 5:23 AM, Ondrej Zizka ozi...@redhat.com wrote: Hi, I use a AjaxEditableLabel with a PropertyModel which points to an object of the Page. But after the session expires, clicking on the label to edit it causes exception because the object of the page is empty (in my case, it results into HBN's NoResultException). What's the way to handle this? The page is mounted as /product/${name}/${version}, so the URL contains the information necessary to reload the entire page. So perhaps I could use some LoadableDetachableModel somehow? I've read about making the page stateless. Would that help? Thanks, Ondra -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEditableLabel causes exceptions after session timeout
Is there a mechanism to let the page be re-created with the original PageParameters? Maybe they could be kept within JS of the page and sent with the AJAX request? That would probably need a change in Wicket's AJAX code. (Wicket 1.5) That was the case until recently but there was no way to differentiate between original page parameters and custom request parameters for the Ajax request itself. So we took the safest way by dropping all parameters when a page is being auto-recreated. Could this be made optional? Because, in case the developer knows that the URL has all the data the page needs to be recreated, he could setSendPageParametersOnAjaxRequests(true) or such... That would make life with Ajax components easier... would it? :-) Or maybe I don't get this fully, as I don't know the Wicket internals... in which case, I believe you there was no way. If you have a minute, could you briefly explain that or point me to some wiki? Thanks. Ondra
AjaxEditableLabel causes exceptions after session timeout
Hi, I use a AjaxEditableLabel with a PropertyModel which points to an object of the Page. But after the session expires, clicking on the label to edit it causes exception because the object of the page is empty (in my case, it results into HBN's NoResultException). What's the way to handle this? The page is mounted as /product/${name}/${version}, so the URL contains the information necessary to reload the entire page. So perhaps I could use some LoadableDetachableModel somehow? I've read about making the page stateless. Would that help? Thanks, Ondra
Re: AjaxEditableLabel in Wicket 6.0.x
Hi, There was a problem in -beta2 which is fixed in 6.0-SNAPSHOT. On Wed, Jun 27, 2012 at 3:24 PM, Alexander Blum alexander.b...@gmail.com wrote: Hi, I am developing a web application where I use AjaxEditableLabels which work fine in Wicket 1.5.x. I tried upgrading to Wicket 6.0.x to play with websockets, but found out that AjaxEditableLabel and AjaxEditableMultiLabel stopped working (I tried multiple browsers on multiple devices). Breakpoints in onModelChanging or onModelChanged fail to trigger and the model is not updated. I tried searching the web to see if this is a known problem, but either I am bad at searching or nobody else seems to be having problems with it. You can see it on the samples page by comparing the 1.5.7 sample with the 6.0.x one: http://www.wicket-library.com/wicket-examples/ajax/editable-label http://www.wicket-library.com/wicket-examples-6.0.x/ajax/editable-label I know 6.0.x is still a beta, but is it a known problem that Ajax is broken or am I doing something wrong? Alex -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEditableLabel in Wicket 6.0.x
2012/6/27 Martin Grigorov mgrigo...@apache.org Hi, There was a problem in -beta2 which is fixed in 6.0-SNAPSHOT. I guess I will have to clone the git repository and compile it myself or wait for a new release tarball. Thanks a lot!
Re: AjaxEditableLabel in Wicket 6.0.x
Just use the snapshot repository. You can see it at the bottom of the produced pom.xml for a quickstart for 6.0-SNAPSHOT. On Wed, Jun 27, 2012 at 3:37 PM, Alexander Blum alexander.b...@gmail.com wrote: 2012/6/27 Martin Grigorov mgrigo...@apache.org Hi, There was a problem in -beta2 which is fixed in 6.0-SNAPSHOT. I guess I will have to clone the git repository and compile it myself or wait for a new release tarball. Thanks a lot! -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEditableLabel Missing setConvertEmptyInputStringToNull(...)?
Hi, Create a ticket in Jira with a patch. On Thu, Apr 12, 2012 at 6:47 PM, Aaron J. Garcia agar...@rentec.com wrote: I am wondering if AjaxEditableLabel is intentionally missing a setConvertEmptyInputStringToNull(...) method? I have a use case for it, and it seems like it would be reasonable to implement. For now, I have a work-around for this by overriding AjaxEditableLabel's newEditor(...) method. However, I don't like this solution because I need to cast the returned FormComponentT into a TextFieldT in order to get access to the setConvertEmptyInputStringToNull(...) method. If the underlying newEditor implementation is changed at some point, my code won't work. Can this functionality be added to AjaxEditableLabel? If so, how would I go about requesting it? Thanks a lot for your help. Regards, Aaron J. Garcia - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxEditableLabel Missing setConvertEmptyInputStringToNull(...)?
I am wondering if AjaxEditableLabel is intentionally missing a setConvertEmptyInputStringToNull(...) method? I have a use case for it, and it seems like it would be reasonable to implement. For now, I have a work-around for this by overriding AjaxEditableLabel's newEditor(...) method. However, I don't like this solution because I need to cast the returned FormComponentT into a TextFieldT in order to get access to the setConvertEmptyInputStringToNull(...) method. If the underlying newEditor implementation is changed at some point, my code won't work. Can this functionality be added to AjaxEditableLabel? If so, how would I go about requesting it? Thanks a lot for your help. Regards, Aaron J. Garcia - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Access Denied with AjaxEditableLabel ant AjaxEditableMultiLineLabel under chrome and safari #wicket1.5
I had this problem during the migration from wicket 1.4 to wicket 1.5 The problems occurs under chrome, safari and wicket 1.5 Scenario with an AjaxEditableMultiLineLabel : 1. The user puts the focus on the AjaxEditableMultiLineLabel and edit the field. 2. Without focusing out of the editable label, the user clicks on another tab of chrome. = coming back to the first tab, the browser shows an Access Denied Page. The log shows the warn : WARN - RequestListenerInterface - behavior not enabled; ignore call. Behavior org.apache.wicket.extensions.ajax.markup.html.AjaxEditableMultiLineLabel$5@18fa85at component [ [Component id = editor]] At that time, Martin proposed me a first workaround : http://markmail.org/message/uyjns2njjpo22xoj#query:+page:1+mid:laq7whb4urciyz6n+state:results The problem appeared again because of my migration to wicket 1.5.3. I tried to further analyze the problem. It seems that the AJAX call is done 2 times. When the user switches tabs chrome, the updating of the html triggers another onblur event and a new ajax call: Wicket.replaceOuterHtmlSafari = function(element, text) { // if we are replacing a single script element if (element.tagName == SCRIPT) { // create temporal div and add script as inner HTML var tempDiv = document.createElement(div); tempDiv.innerHTML = text; // try to get script content var script = tempDiv.childNodes[0].innerHTML; if (typeof(script) != string) { script = tempDiv.childNodes[0].text; } element.outerHTML = text; Trigger another blur event when the user has already changed of tab. try { eval(script); } catch (e) { Wicket.Log.error(Wicket.replaceOuterHtmlSafari: + e + : eval - + script); } return; }... As I'm not a javascript expert, does anybody know how to correct the problem in javascript instead of using a workaround? Thanks, Gaetan,
Re: AjaxEditableLabel inside of AjaxEditableLabel
See jQuery#stopPropagation() On Sun, Nov 20, 2011 at 8:02 PM, Alec Swan alecs...@gmail.com wrote: Anybody can help with stopping propagation of events from inner editable label to the outer editable label? Thanks On Fri, Nov 18, 2011 at 3:45 PM, Alec Swan alecs...@gmail.com wrote: I am not sure how to stop propagating the event. Could you please provide any pointers? Here is the relevant code: final String keypress = var kc=wicketKeyCode(event); if (kc==27) + cancelCall + else if (kc!=13) { return true; } else + saveCall; tag.put(onblur, saveCall); tag.put(onkeypress, if (Wicket.Browser.isSafari()) { return; }; + keypress); tag.put(onkeydown, if (!Wicket.Browser.isSafari()) { return; }; + keypress); On Fri, Nov 18, 2011 at 12:32 AM, Martin Grigorov mgrigo...@apache.org wrote: Hi, You'll need to stop the propagation of the event. To do that you'll have to override org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.EditorAjaxBehavior.onComponentTag(ComponentTag) On Fri, Nov 18, 2011 at 7:48 AM, Alec Swan alecs...@gmail.com wrote: Hello, I have two AjaxEditableLabel components. I use jQuery to place one component inside of another when the user views the page. The problem is that when the user clicks inside of the inner AjaxEditableLabel it goes into edit mode but right after that the outer AjaxEditableLabel goes into edit mode. How can I prevent the outer AjaxEditableLabel from going into edit mode? Thanks, Alec - 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 - 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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEditableLabel inside of AjaxEditableLabel
Anybody can help with stopping propagation of events from inner editable label to the outer editable label? Thanks On Fri, Nov 18, 2011 at 3:45 PM, Alec Swan alecs...@gmail.com wrote: I am not sure how to stop propagating the event. Could you please provide any pointers? Here is the relevant code: final String keypress = var kc=wicketKeyCode(event); if (kc==27) + cancelCall + else if (kc!=13) { return true; } else + saveCall; tag.put(onblur, saveCall); tag.put(onkeypress, if (Wicket.Browser.isSafari()) { return; }; + keypress); tag.put(onkeydown, if (!Wicket.Browser.isSafari()) { return; }; + keypress); On Fri, Nov 18, 2011 at 12:32 AM, Martin Grigorov mgrigo...@apache.org wrote: Hi, You'll need to stop the propagation of the event. To do that you'll have to override org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.EditorAjaxBehavior.onComponentTag(ComponentTag) On Fri, Nov 18, 2011 at 7:48 AM, Alec Swan alecs...@gmail.com wrote: Hello, I have two AjaxEditableLabel components. I use jQuery to place one component inside of another when the user views the page. The problem is that when the user clicks inside of the inner AjaxEditableLabel it goes into edit mode but right after that the outer AjaxEditableLabel goes into edit mode. How can I prevent the outer AjaxEditableLabel from going into edit mode? Thanks, Alec - 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 - 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: AjaxEditableLabel inside of AjaxEditableLabel
I am not sure how to stop propagating the event. Could you please provide any pointers? Here is the relevant code: final String keypress = var kc=wicketKeyCode(event); if (kc==27) + cancelCall + else if (kc!=13) { return true; } else + saveCall; tag.put(onblur, saveCall); tag.put(onkeypress, if (Wicket.Browser.isSafari()) { return; }; + keypress); tag.put(onkeydown, if (!Wicket.Browser.isSafari()) { return; }; + keypress); On Fri, Nov 18, 2011 at 12:32 AM, Martin Grigorov mgrigo...@apache.org wrote: Hi, You'll need to stop the propagation of the event. To do that you'll have to override org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.EditorAjaxBehavior.onComponentTag(ComponentTag) On Fri, Nov 18, 2011 at 7:48 AM, Alec Swan alecs...@gmail.com wrote: Hello, I have two AjaxEditableLabel components. I use jQuery to place one component inside of another when the user views the page. The problem is that when the user clicks inside of the inner AjaxEditableLabel it goes into edit mode but right after that the outer AjaxEditableLabel goes into edit mode. How can I prevent the outer AjaxEditableLabel from going into edit mode? Thanks, Alec - 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 - 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
AjaxEditableLabel inside of AjaxEditableLabel
Hello, I have two AjaxEditableLabel components. I use jQuery to place one component inside of another when the user views the page. The problem is that when the user clicks inside of the inner AjaxEditableLabel it goes into edit mode but right after that the outer AjaxEditableLabel goes into edit mode. How can I prevent the outer AjaxEditableLabel from going into edit mode? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEditableLabel inside of AjaxEditableLabel
Hi, You'll need to stop the propagation of the event. To do that you'll have to override org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.EditorAjaxBehavior.onComponentTag(ComponentTag) On Fri, Nov 18, 2011 at 7:48 AM, Alec Swan alecs...@gmail.com wrote: Hello, I have two AjaxEditableLabel components. I use jQuery to place one component inside of another when the user views the page. The problem is that when the user clicks inside of the inner AjaxEditableLabel it goes into edit mode but right after that the outer AjaxEditableLabel goes into edit mode. How can I prevent the outer AjaxEditableLabel from going into edit mode? Thanks, Alec - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Access Denied with AjaxEditableLabel ant AjaxEditableMultiLineLabel under chrome and safari #wicket1.5
So is it a bug or a regression (because it was working on W1.4)? Even, if the event is fired when leaving the tab, I don't understand why the server reacts differently. How can it knows that the component isn't visible anymoree??? Should I drop all these widget from my app? We use them a lot in my backoffice app. Gaetan, 2011/10/19 Martin Grigorov mgrigo...@apache.org Hi, The EditableLabel's editor (the text field/area) saves the value on 'blur' event. It is interesting when this event is fired - when the user leaves the first tab or when she comes back. On Wed, Oct 19, 2011 at 12:48 AM, Gaetan Zoritchak g.zoritc...@moncoachfinance.com wrote: The problems occurs under chrome, safari and wicket 1.5. Scenario with an AjaxEditableLabel : 1. The user puts the focus on the AjaxEditableLabel and edit the field. 2. Without focusing out of the editable label, the user clicks on another tab of chrome. = the value is not put in the model. Scenario with an AjaxEditableMultiLineLabel : 1. The user puts the focus on the AjaxEditableMultiLineLabel and edit the field. 2. Without focusing out of the editable label, the user clicks on another tab of chrome. = coming back to the first tab, the browser shows an Access Denied Page. The log shows the warn : WARN - RequestListenerInterface - behavior not enabled; ignore call. Behavior org.apache.wicket.extensions.ajax.markup.html.AjaxEditableMultiLineLabel$5@18fa85 at component [ [Component id = editor]] After some debugs it appears that under chrome the call on isVisibleInHierarchie() returns false. These scenario were ok with wicket 1.4 Gaetan, - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Access Denied with AjaxEditableLabel ant AjaxEditableMultiLineLabel under chrome and safari #wicket1.5
There is an improvement in Wicket 1.5 to not allow execution of invisible component or even worse on disabled behavior for security reasons. It is possible to extend AjaxEditableLabel and configure it to allow such executions. Override org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.newEditor(MarkupContainer, String, IModelT) and instead of adding org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.EditorAjaxBehavior you'll have to extend that Behavior and override its org.apache.wicket.behavior.Behavior.canCallListenerInterface(Component) On Thu, Oct 20, 2011 at 10:44 AM, Gaetan Zoritchak g.zoritc...@moncoachfinance.com wrote: So is it a bug or a regression (because it was working on W1.4)? Even, if the event is fired when leaving the tab, I don't understand why the server reacts differently. How can it knows that the component isn't visible anymoree??? Should I drop all these widget from my app? We use them a lot in my backoffice app. Gaetan, 2011/10/19 Martin Grigorov mgrigo...@apache.org Hi, The EditableLabel's editor (the text field/area) saves the value on 'blur' event. It is interesting when this event is fired - when the user leaves the first tab or when she comes back. On Wed, Oct 19, 2011 at 12:48 AM, Gaetan Zoritchak g.zoritc...@moncoachfinance.com wrote: The problems occurs under chrome, safari and wicket 1.5. Scenario with an AjaxEditableLabel : 1. The user puts the focus on the AjaxEditableLabel and edit the field. 2. Without focusing out of the editable label, the user clicks on another tab of chrome. = the value is not put in the model. Scenario with an AjaxEditableMultiLineLabel : 1. The user puts the focus on the AjaxEditableMultiLineLabel and edit the field. 2. Without focusing out of the editable label, the user clicks on another tab of chrome. = coming back to the first tab, the browser shows an Access Denied Page. The log shows the warn : WARN - RequestListenerInterface - behavior not enabled; ignore call. Behavior org.apache.wicket.extensions.ajax.markup.html.AjaxEditableMultiLineLabel$5@18fa85 at component [ [Component id = editor]] After some debugs it appears that under chrome the call on isVisibleInHierarchie() returns false. These scenario were ok with wicket 1.4 Gaetan, - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Access Denied with AjaxEditableLabel ant AjaxEditableMultiLineLabel under chrome and safari #wicket1.5
Thank you, It's working but the code is quite ugly (lot of duplication just to override the canCallListenerInterface() ). I still doesn't understand how wicket is able to know that the component is not visible in the browser. Furthermore, I find problematic the fact that the behavior depends on the browser implementation. Gaetan, 2011/10/20 Martin Grigorov mgrigo...@apache.org There is an improvement in Wicket 1.5 to not allow execution of invisible component or even worse on disabled behavior for security reasons. It is possible to extend AjaxEditableLabel and configure it to allow such executions. Override org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.newEditor(MarkupContainer, String, IModelT) and instead of adding org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.EditorAjaxBehavior you'll have to extend that Behavior and override its org.apache.wicket.behavior.Behavior.canCallListenerInterface(Component) On Thu, Oct 20, 2011 at 10:44 AM, Gaetan Zoritchak g.zoritc...@moncoachfinance.com wrote: So is it a bug or a regression (because it was working on W1.4)? Even, if the event is fired when leaving the tab, I don't understand why the server reacts differently. How can it knows that the component isn't visible anymoree??? Should I drop all these widget from my app? We use them a lot in my backoffice app. Gaetan, 2011/10/19 Martin Grigorov mgrigo...@apache.org Hi, The EditableLabel's editor (the text field/area) saves the value on 'blur' event. It is interesting when this event is fired - when the user leaves the first tab or when she comes back. On Wed, Oct 19, 2011 at 12:48 AM, Gaetan Zoritchak g.zoritc...@moncoachfinance.com wrote: The problems occurs under chrome, safari and wicket 1.5. Scenario with an AjaxEditableLabel : 1. The user puts the focus on the AjaxEditableLabel and edit the field. 2. Without focusing out of the editable label, the user clicks on another tab of chrome. = the value is not put in the model. Scenario with an AjaxEditableMultiLineLabel : 1. The user puts the focus on the AjaxEditableMultiLineLabel and edit the field. 2. Without focusing out of the editable label, the user clicks on another tab of chrome. = coming back to the first tab, the browser shows an Access Denied Page. The log shows the warn : WARN - RequestListenerInterface - behavior not enabled; ignore call. Behavior org.apache.wicket.extensions.ajax.markup.html.AjaxEditableMultiLineLabel$5@18fa85 at component [ [Component id = editor]] After some debugs it appears that under chrome the call on isVisibleInHierarchie() returns false. These scenario were ok with wicket 1.4 Gaetan, - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Access Denied with AjaxEditableLabel ant AjaxEditableMultiLineLabel under chrome and safari #wicket1.5
On Thu, Oct 20, 2011 at 4:17 PM, Gaetan Zoritchak g.zoritc...@moncoachfinance.com wrote: Thank you, It's working but the code is quite ugly (lot of duplication just to override the canCallListenerInterface() ). I still doesn't understand how wicket is able to know that the component is not visible in the browser. Wicket doesn't know that. Wicket knows the visibility at the server side and rejects any requests against invisible/disabled components/behaviors. Furthermore, I find problematic the fact that the behavior depends on the browser implementation. It seems Chrome sends the blur event differently than the other browsers when the tab/window is changed. Gaetan, 2011/10/20 Martin Grigorov mgrigo...@apache.org There is an improvement in Wicket 1.5 to not allow execution of invisible component or even worse on disabled behavior for security reasons. It is possible to extend AjaxEditableLabel and configure it to allow such executions. Override org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.newEditor(MarkupContainer, String, IModelT) and instead of adding org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.EditorAjaxBehavior you'll have to extend that Behavior and override its org.apache.wicket.behavior.Behavior.canCallListenerInterface(Component) On Thu, Oct 20, 2011 at 10:44 AM, Gaetan Zoritchak g.zoritc...@moncoachfinance.com wrote: So is it a bug or a regression (because it was working on W1.4)? Even, if the event is fired when leaving the tab, I don't understand why the server reacts differently. How can it knows that the component isn't visible anymoree??? Should I drop all these widget from my app? We use them a lot in my backoffice app. Gaetan, 2011/10/19 Martin Grigorov mgrigo...@apache.org Hi, The EditableLabel's editor (the text field/area) saves the value on 'blur' event. It is interesting when this event is fired - when the user leaves the first tab or when she comes back. On Wed, Oct 19, 2011 at 12:48 AM, Gaetan Zoritchak g.zoritc...@moncoachfinance.com wrote: The problems occurs under chrome, safari and wicket 1.5. Scenario with an AjaxEditableLabel : 1. The user puts the focus on the AjaxEditableLabel and edit the field. 2. Without focusing out of the editable label, the user clicks on another tab of chrome. = the value is not put in the model. Scenario with an AjaxEditableMultiLineLabel : 1. The user puts the focus on the AjaxEditableMultiLineLabel and edit the field. 2. Without focusing out of the editable label, the user clicks on another tab of chrome. = coming back to the first tab, the browser shows an Access Denied Page. The log shows the warn : WARN - RequestListenerInterface - behavior not enabled; ignore call. Behavior org.apache.wicket.extensions.ajax.markup.html.AjaxEditableMultiLineLabel$5@18fa85 at component [ [Component id = editor]] After some debugs it appears that under chrome the call on isVisibleInHierarchie() returns false. These scenario were ok with wicket 1.4 Gaetan, - 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 - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: Access Denied with AjaxEditableLabel ant AjaxEditableMultiLineLabel under chrome and safari #wicket1.5
I still doesn't understand how wicket is able to know that the component is not visible in the browser. We don't understand this either. Could you create a quickstart? Sven -Ursprüngliche Nachricht- Von: Gaetan Zoritchak [mailto:g.zoritc...@moncoachfinance.com] Gesendet: Donnerstag, 20. Oktober 2011 15:18 An: users@wicket.apache.org Betreff: Re: Access Denied with AjaxEditableLabel ant AjaxEditableMultiLineLabel under chrome and safari #wicket1.5 Thank you, It's working but the code is quite ugly (lot of duplication just to override the canCallListenerInterface() ). I still doesn't understand how wicket is able to know that the component is not visible in the browser. Furthermore, I find problematic the fact that the behavior depends on the browser implementation. Gaetan, 2011/10/20 Martin Grigorov mgrigo...@apache.org There is an improvement in Wicket 1.5 to not allow execution of invisible component or even worse on disabled behavior for security reasons. It is possible to extend AjaxEditableLabel and configure it to allow such executions. Override org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.newEditor(Ma rkupContainer, String, IModelT) and instead of adding org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.EditorAjaxBe havior you'll have to extend that Behavior and override its org.apache.wicket.behavior.Behavior.canCallListenerInterface(Component) On Thu, Oct 20, 2011 at 10:44 AM, Gaetan Zoritchak g.zoritc...@moncoachfinance.com wrote: So is it a bug or a regression (because it was working on W1.4)? Even, if the event is fired when leaving the tab, I don't understand why the server reacts differently. How can it knows that the component isn't visible anymoree??? Should I drop all these widget from my app? We use them a lot in my backoffice app. Gaetan, 2011/10/19 Martin Grigorov mgrigo...@apache.org Hi, The EditableLabel's editor (the text field/area) saves the value on 'blur' event. It is interesting when this event is fired - when the user leaves the first tab or when she comes back. On Wed, Oct 19, 2011 at 12:48 AM, Gaetan Zoritchak g.zoritc...@moncoachfinance.com wrote: The problems occurs under chrome, safari and wicket 1.5. Scenario with an AjaxEditableLabel : 1. The user puts the focus on the AjaxEditableLabel and edit the field. 2. Without focusing out of the editable label, the user clicks on another tab of chrome. = the value is not put in the model. Scenario with an AjaxEditableMultiLineLabel : 1. The user puts the focus on the AjaxEditableMultiLineLabel and edit the field. 2. Without focusing out of the editable label, the user clicks on another tab of chrome. = coming back to the first tab, the browser shows an Access Denied Page. The log shows the warn : WARN - RequestListenerInterface - behavior not enabled; ignore call. Behavior org.apache.wicket.extensions.ajax.markup.html.AjaxEditableMultiLineLabel$5@1 8fa85 at component [ [Component id = editor]] After some debugs it appears that under chrome the call on isVisibleInHierarchie() returns false. These scenario were ok with wicket 1.4 Gaetan, - 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 - 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 - 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: Access Denied with AjaxEditableLabel ant AjaxEditableMultiLineLabel under chrome and safari #wicket1.5
Hi, The EditableLabel's editor (the text field/area) saves the value on 'blur' event. It is interesting when this event is fired - when the user leaves the first tab or when she comes back. On Wed, Oct 19, 2011 at 12:48 AM, Gaetan Zoritchak g.zoritc...@moncoachfinance.com wrote: The problems occurs under chrome, safari and wicket 1.5. Scenario with an AjaxEditableLabel : 1. The user puts the focus on the AjaxEditableLabel and edit the field. 2. Without focusing out of the editable label, the user clicks on another tab of chrome. = the value is not put in the model. Scenario with an AjaxEditableMultiLineLabel : 1. The user puts the focus on the AjaxEditableMultiLineLabel and edit the field. 2. Without focusing out of the editable label, the user clicks on another tab of chrome. = coming back to the first tab, the browser shows an Access Denied Page. The log shows the warn : WARN - RequestListenerInterface - behavior not enabled; ignore call. Behavior org.apache.wicket.extensions.ajax.markup.html.AjaxEditableMultiLineLabel$5@18fa85 at component [ [Component id = editor]] After some debugs it appears that under chrome the call on isVisibleInHierarchie() returns false. These scenario were ok with wicket 1.4 Gaetan, - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Customize AjaxEditableLabel
Here are some code sniplets, perhaps you can see what's wrong - I definitely don't call super newEditor(). The next problem I will get is that the ContentEditorLabel closes when I click on an other field in the form. I would prefer a modal behaviour what means that I have to use the buttons to close the ne edit fields ... private class ContentEditorLabel extends AjaxEditableLabelString { private static final long serialVersionUID = 1L; public ContentEditorLabel(String id) { super(id); } @Override protected final FormComponentString newEditor( MarkupContainer parent, String componentId, IModelString model) { final SwiftFieldInput editor = new SwiftFieldInput(componentId, model){ private static final long serialVersionUID = 1L; @Override public IConverter getConverter(Class? type) { IConverter c = ContentEditorLabel.this.getConverter(type); return c != null ? c : super.getConverter(type); } @Override protected void onModelChanged() { super.onModelChanged(); ContentEditorLabel.this.onModelChanged(); } @Override protected void onModelChanging() { super.onModelChanging(); ContentEditorLabel.this.onModelChanging(); } }; editor.setOutputMarkupId(true); editor.setVisible(false); editor.add(new EditorAjaxBehavior()); return editor; } }; package com.csc.pts.web.panels.swift; import org.apache.wicket.markup.html.form.FormComponent; import org.apache.wicket.markup.html.form.FormComponentPanel; import org.apache.wicket.markup.html.form.TextArea; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; public class SwiftFieldInput extends FormComponentPanelString { private static final long serialVersionUID = 1L; private final FormComponentString contentArea; String test; public SwiftFieldInput(String id, IModelString model) { super(id,model); contentArea = new TextAreaString(contentarea,new ModelString()); add(contentArea); } @Override protected void onModelChanged() { super.onModelChanged(); String content = getModelObject(); if (content != null) contentArea.setModelObject(content); else contentArea.setModelObject(null); } } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Customize-AjaxEditableLabel-tp3643409p3645206.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: Customize AjaxEditableLabel
Check org.apache.wicket.extensions.ajax.markup.html.AjaxEditableMultiLineLabelT If this doesn't fit your needs then advise from org.apache.wicket.extensions.ajax.markup.html.AjaxEditableChoiceLabelT as well On Tue, Jul 5, 2011 at 8:38 AM, PDiefent pdief...@csc.com wrote: Here are some code sniplets, perhaps you can see what's wrong - I definitely don't call super newEditor(). The next problem I will get is that the ContentEditorLabel closes when I click on an other field in the form. I would prefer a modal behaviour what means that I have to use the buttons to close the ne edit fields ... private class ContentEditorLabel extends AjaxEditableLabelString { private static final long serialVersionUID = 1L; public ContentEditorLabel(String id) { super(id); } @Override protected final FormComponentString newEditor( MarkupContainer parent, String componentId, IModelString model) { final SwiftFieldInput editor = new SwiftFieldInput(componentId, model){ private static final long serialVersionUID = 1L; @Override public IConverter getConverter(Class? type) { IConverter c = ContentEditorLabel.this.getConverter(type); return c != null ? c : super.getConverter(type); } @Override protected void onModelChanged() { super.onModelChanged(); ContentEditorLabel.this.onModelChanged(); } @Override protected void onModelChanging() { super.onModelChanging(); ContentEditorLabel.this.onModelChanging(); } }; editor.setOutputMarkupId(true); editor.setVisible(false); editor.add(new EditorAjaxBehavior()); return editor; } }; package com.csc.pts.web.panels.swift; import org.apache.wicket.markup.html.form.FormComponent; import org.apache.wicket.markup.html.form.FormComponentPanel; import org.apache.wicket.markup.html.form.TextArea; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; public class SwiftFieldInput extends FormComponentPanelString { private static final long serialVersionUID = 1L; private final FormComponentString contentArea; String test; public SwiftFieldInput(String id, IModelString model) { super(id,model); contentArea = new TextAreaString(contentarea,new ModelString()); add(contentArea); } @Override protected void onModelChanged() { super.onModelChanged(); String content = getModelObject(); if (content != null) contentArea.setModelObject(content); else contentArea.setModelObject(null); } } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Customize-AjaxEditableLabel-tp3643409p3645206.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
Customize AjaxEditableLabel
Hallo, is it possible to customize AjaxEditableLabel in a way that I can replace the TextEditField with a panel? I have to display a little Form with a text area component and some buttons. A modal window doesn't work for me because I want to show the panel exactly at the position of the label. Thanks, Peter
Re: Customize AjaxEditableLabel
See org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.newEditor(MarkupContainer, String, IModelT) Return FormComponentPanel. On Mon, Jul 4, 2011 at 1:30 PM, Peter Diefenthaeler pdief...@csc.com wrote: Hallo, is it possible to customize AjaxEditableLabel in a way that I can replace the TextEditField with a panel? I have to display a little Form with a text area component and some buttons. A modal window doesn't work for me because I want to show the panel exactly at the position of the label. Thanks, Peter -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Customize AjaxEditableLabel
Thanks for your fast response. Is there a QuickStart available how to implement it? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Customize-AjaxEditableLabel-tp3643409p3643435.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: Customize AjaxEditableLabel
AjaxEditableLabel itself, I guess. See how it creates TextField. On Mon, Jul 4, 2011 at 1:49 PM, PDiefent pdief...@csc.com wrote: Thanks for your fast response. Is there a QuickStart available how to implement it? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Customize-AjaxEditableLabel-tp3643409p3643435.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Customize AjaxEditableLabel
I tried it like AjaxEditableLabel does itself, but now I get the default input field plus the new fields in the panel! How do I erase the default text field? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Customize-AjaxEditableLabel-tp3643409p3643712.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: Customize AjaxEditableLabel
Unless you call super.newEditor() in your implementation it should not know the TextField. Paste your code in some pastebin service (e.g. www.pastie.com) On Mon, Jul 4, 2011 at 4:10 PM, PDiefent pdief...@csc.com wrote: I tried it like AjaxEditableLabel does itself, but now I get the default input field plus the new fields in the panel! How do I erase the default text field? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Customize-AjaxEditableLabel-tp3643409p3643712.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ajaxeditablelabel and setescapemodelstrings to false
Hey all, anyone...? How can I make 'setEscapeModelStrings(false)' work in a AjaxEditablePanel? Thx, Kurt 2010/10/23 Kurt Sys kurt@gmail.com Hi, I'm new to Wicket and I'm trying to get the feel of it. So I tried a small webapp, using a AjaxEditableMultiLineLabel, which so far worked perfectly. However, if I want it not to escape the html-tags - which is generally a bad idea, I know - I use 'setEscapeModelStrings(false)'. For some reason, it doesn't work. It does work, however, when I replace the AjaxEditablePanel (or AjaxEditableMultiLinePanel) with a Panel or MultiLinePanel. See code below, I'm using wicket-1.4.12 (and wicket-1.4.12-extensions). What am I missing here? Oh yeah, I want to extend it to store the panel content in a database (together with the content of some other panels, e.g. a title, author and time), so it's a kind of very lightweight personal wiki-like thingy. It might be I'm not using the best way to achieve this, but I want to keep the editable panel :). Any suggestions are welcome of course. Thx, Kurt 'midregion.html' [...] div wicket:id=wikicontent /div span wicket:id=messagetext goes here/span [...] 'midregion.java' import org.apache.wicket.markup.html.CSSPackageResource; import org.apache.wicket.markup.html.panel.Panel; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.basic.MultiLineLabel; import org.apache.wicket.model.IModel; import org.apache.wicket.extensions.ajax.markup.html.AjaxEditableMultiLineLabel; import org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel; public class midRegion extends Panel { public midRegion(String id) { super(id); add(CSSPackageResource.getHeaderContribution(main.class, css/midRegion.css)); //AjaxEditableMultiLineLabelString mod = new AjaxEditableMultiLineLabelString(wikicontent, new contentModel()); // not ok //AjaxEditableLabelString mod = new AjaxEditableLabelString(wikicontent, new contentModel()); // not ok MultiLineLabel mod = new MultiLineLabel(wikicontent, new contentModel()); // ok add(mod.setEscapeModelStrings(false)); add(new Label( message, h1Hello!/h1 ).setEscapeModelStrings(false) ); // this is just another test for using setEscapeModelStrings } } class contentModel implements IModelString { private String content=blablabla b bold text /b; @Override public void setObject(String c) { this.content = c; } @Override public String getObject(){ return content; } @Override public void detach() { } }
ajaxeditablelabel and setescapemodelstrings to false
Hi, I'm new to Wicket and I'm trying to get the feel of it. So I tried a small webapp, using a AjaxEditableMultiLineLabel, which so far worked perfectly. However, if I want it not to escape the html-tags - which is generally a bad idea, I know - I use 'setEscapeModelStrings(false)'. For some reason, it doesn't work. It does work, however, when I replace the AjaxEditablePanel (or AjaxEditableMultiLinePanel) with a Panel or MultiLinePanel. See code below, I'm using wicket-1.4.12 (and wicket-1.4.12-extensions). What am I missing here? Oh yeah, I want to extend it to store the panel content in a database (together with the content of some other panels, e.g. a title, author and time), so it's a kind of very lightweight personal wiki-like thingy. It might be I'm not using the best way to achieve this, but I want to keep the editable panel :). Any suggestions are welcome of course. Thx, Kurt 'midregion.html' [...] div wicket:id=wikicontent /div span wicket:id=messagetext goes here/span [...] 'midregion.java' import org.apache.wicket.markup.html.CSSPackageResource; import org.apache.wicket.markup.html.panel.Panel; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.basic.MultiLineLabel; import org.apache.wicket.model.IModel; import org.apache.wicket.extensions.ajax.markup.html.AjaxEditableMultiLineLabel; import org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel; public class midRegion extends Panel { public midRegion(String id) { super(id); add(CSSPackageResource.getHeaderContribution(main.class, css/midRegion.css)); //AjaxEditableMultiLineLabelString mod = new AjaxEditableMultiLineLabelString(wikicontent, new contentModel()); // not ok //AjaxEditableLabelString mod = new AjaxEditableLabelString(wikicontent, new contentModel()); // not ok MultiLineLabel mod = new MultiLineLabel(wikicontent, new contentModel()); // ok add(mod.setEscapeModelStrings(false)); add(new Label( message, h1Hello!/h1 ).setEscapeModelStrings(false) ); // this is just another test for using setEscapeModelStrings } } class contentModel implements IModelString { private String content=blablabla b bold text /b; @Override public void setObject(String c) { this.content = c; } @Override public String getObject(){ return content; } @Override public void detach() { } }
Re: AjaxEditableLabel uses wicketAjaxGet
Then maybe you should use AjaxEditableMultiLineLabel (textarea behind) ;-) This is supposed to bring more data. On Wed, Sep 29, 2010 at 4:36 PM, cretzel mailinglists...@gmail.com wrote: It seems like AjaxEditableLabel uses wicketAjaxGet to send the input. This might cause errors if the input is too large for a GET request. Maybe it should better be wicketAjaxPost? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxEditableLabel-uses-wicketAjaxGet-tp2719139p2719139.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: AjaxEditableLabel uses wicketAjaxGet
Stupid me. Thx. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxEditableLabel-uses-wicketAjaxGet-tp2719139p2719168.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: Custom AjaxEditableLabel with an X in the upper right corner
Use javascript to do that, for example: var target = document.getElementById('somecomponentid'); target.style.position = 'relative'; var close = document.createElement(span); close.innerHTML = 'x'; close.style.position = 'absolute'; close.style.top = 0; close.style.right = 0; close.onclick = function(){target.style.display = 'none'}; target.appendChild(close); With Wicket, you can create some behavior that calls this javascript for the target component and then add this behaviour on those component you want. On Mon, Aug 30, 2010 at 11:51 PM, Alec Swan alecs...@gmail.com wrote: Hello, I would like to customize AjaxEditableLabel so that every time it is rendered it has a letter X in the right-upper corner which allows the user to remove the label from the screen. I would also like to customize other components, such as panels, the same way. So, ideally the solution should be applicable to any type of component. I would also like to generate the X label at runtime and not have the web designer create a separate HTML element with a wicket:id for each X. Any ideas on how to best approach this? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Custom AjaxEditableLabel with an X in the upper right corner
actually, if you re-render the component after hide it, it will to be visible... perhaps you can add some callback on the close handler that updates the visibility property on the wicket component. On Tue, Aug 31, 2010 at 11:08 AM, Pedro Santos pedros...@gmail.com wrote: Use javascript to do that, for example: var target = document.getElementById('somecomponentid'); target.style.position = 'relative'; var close = document.createElement(span); close.innerHTML = 'x'; close.style.position = 'absolute'; close.style.top = 0; close.style.right = 0; close.onclick = function(){target.style.display = 'none'}; target.appendChild(close); With Wicket, you can create some behavior that calls this javascript for the target component and then add this behaviour on those component you want. On Mon, Aug 30, 2010 at 11:51 PM, Alec Swan alecs...@gmail.com wrote: Hello, I would like to customize AjaxEditableLabel so that every time it is rendered it has a letter X in the right-upper corner which allows the user to remove the label from the screen. I would also like to customize other components, such as panels, the same way. So, ideally the solution should be applicable to any type of component. I would also like to generate the X label at runtime and not have the web designer create a separate HTML element with a wicket:id for each X. Any ideas on how to best approach this? Thanks, Alec - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Custom AjaxEditableLabel with an X in the upper right corner
Thanks for the suggestion, Pedro. When the user clicks on the X label, I need to store the user decision in the database so that the next time they load the page the component does not show up. Can this behavior be implemented with the server-side code? Thanks, Alec On Tue, Aug 31, 2010 at 8:13 AM, Pedro Santos pedros...@gmail.com wrote: actually, if you re-render the component after hide it, it will to be visible... perhaps you can add some callback on the close handler that updates the visibility property on the wicket component. On Tue, Aug 31, 2010 at 11:08 AM, Pedro Santos pedros...@gmail.com wrote: Use javascript to do that, for example: var target = document.getElementById('somecomponentid'); target.style.position = 'relative'; var close = document.createElement(span); close.innerHTML = 'x'; close.style.position = 'absolute'; close.style.top = 0; close.style.right = 0; close.onclick = function(){target.style.display = 'none'}; target.appendChild(close); With Wicket, you can create some behavior that calls this javascript for the target component and then add this behaviour on those component you want. On Mon, Aug 30, 2010 at 11:51 PM, Alec Swan alecs...@gmail.com wrote: Hello, I would like to customize AjaxEditableLabel so that every time it is rendered it has a letter X in the right-upper corner which allows the user to remove the label from the screen. I would also like to customize other components, such as panels, the same way. So, ideally the solution should be applicable to any type of component. I would also like to generate the X label at runtime and not have the web designer create a separate HTML element with a wicket:id for each X. Any ideas on how to best approach this? Thanks, Alec - 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 - 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: Custom AjaxEditableLabel with an X in the upper right corner
Sure, the onclick handler can invoke an callback for an AbstractDefaultAjaxBehavior for instance. take a look at: http://wicket.apache.org/apidocs/1.4/org/apache/wicket/ajax/AbstractDefaultAjaxBehavior.html#getCallbackScript%28%29 On Tue, Aug 31, 2010 at 3:48 PM, Alec Swan alecs...@gmail.com wrote: Thanks for the suggestion, Pedro. When the user clicks on the X label, I need to store the user decision in the database so that the next time they load the page the component does not show up. Can this behavior be implemented with the server-side code? Thanks, Alec On Tue, Aug 31, 2010 at 8:13 AM, Pedro Santos pedros...@gmail.com wrote: actually, if you re-render the component after hide it, it will to be visible... perhaps you can add some callback on the close handler that updates the visibility property on the wicket component. On Tue, Aug 31, 2010 at 11:08 AM, Pedro Santos pedros...@gmail.com wrote: Use javascript to do that, for example: var target = document.getElementById('somecomponentid'); target.style.position = 'relative'; var close = document.createElement(span); close.innerHTML = 'x'; close.style.position = 'absolute'; close.style.top = 0; close.style.right = 0; close.onclick = function(){target.style.display = 'none'}; target.appendChild(close); With Wicket, you can create some behavior that calls this javascript for the target component and then add this behaviour on those component you want. On Mon, Aug 30, 2010 at 11:51 PM, Alec Swan alecs...@gmail.com wrote: Hello, I would like to customize AjaxEditableLabel so that every time it is rendered it has a letter X in the right-upper corner which allows the user to remove the label from the screen. I would also like to customize other components, such as panels, the same way. So, ideally the solution should be applicable to any type of component. I would also like to generate the X label at runtime and not have the web designer create a separate HTML element with a wicket:id for each X. Any ideas on how to best approach this? Thanks, Alec - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: autocomplete for AjaxEditableLabel
Is there a way to enable autocomplete for AjaxEditableLabel (just like AutoCompleteTextField)? I was going through AutoCompleteTextField as a reference and wrote my own behavior for autocompletion. The new behavior works perfectly for a TextField, but not for AjaxEditableLabel. Answering my own question (in case someone is looking for the same functionality through a google search). AjaxEditableLabel is a panel with a label and textfield component which is why adding the autocomplete behavior to it didn't work. I solved it by overriding the newEditor() method and adding my behavior to the editor in the AjaxEditableLabel panel like so: AjaxEditableLabelString label = new AjaxEditableLabelString(foo) { @Override protected FormComponentString newEditor(final MarkupContainer parent, final String componentId, final IModelString model) { final FormComponent form = super.newEditor(parent, componentId, model); form.add(new MyAutoCompleteBehavior()); return form; } }; Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Custom AjaxEditableLabel with an X in the upper right corner
Hello, I would like to customize AjaxEditableLabel so that every time it is rendered it has a letter X in the right-upper corner which allows the user to remove the label from the screen. I would also like to customize other components, such as panels, the same way. So, ideally the solution should be applicable to any type of component. I would also like to generate the X label at runtime and not have the web designer create a separate HTML element with a wicket:id for each X. Any ideas on how to best approach this? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
autocomplete for AjaxEditableLabel
Hi! Is there a way to enable autocomplete for AjaxEditableLabel (just like AutoCompleteTextField)? I was going through AutoCompleteTextField as a reference and wrote my own behavior for autocompletion. The new behavior works perfectly for a TextField, but not for AjaxEditableLabel. Any help? What would be the correct way to do it? Cheers, Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxEditableLabel unicode issue
Hi, I cannot enter/save unicode chars with a AjaxEditableLabel (e.g. german/arabic). Enter: 'ü' Value: 'ü' All unicode-chars seems to be converted to utf-8 since the single char ü is converter to double-bytes? Thanks Jens - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEditableLabel unicode issue
Hi, Is this after the value has been submitted and perhaps stored in a database, then retrieved and displayed again? If so, is your database setup as UTF-8? Also, if using Tomcat, is the connector setup as UTF-8 also? For Wicket, try setting this *: getRequestCycleSettings().setResponseRequestEncoding(UTF-8); getMarkupSettings().setDefaultMarkupEncoding(UTF-8); in your Application#init If you don't set the default markup encoding explicitly, the default for it is the 'os provided encoding' (see: IMarkupSettings#getDefaultMarkupEncoding) If Tomcat, add URIEncoding=UTF-8 to your connector. See if that helps. cheers, Steve * came up on list back in early 2009. On 11/05/2010, at 9:16 PM, Jens Zastrow wrote: Hi, I cannot enter/save unicode chars with a AjaxEditableLabel (e.g. german/arabic). Enter: 'ü' Value: 'ü' All unicode-chars seems to be converted to utf-8 since the single char ü is converter to double-bytes? Thanks Jens - 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: AjaxEditableLabel unicode issue
Hi, We switched from a http to a ajp based tomcat-connector and didnt configured the URIEncoding=UTF-8 properly. Thanks a lot, everything is working now. Am 11.05.2010 13:34, schrieb Steve Swinsburg: Hi, Is this after the value has been submitted and perhaps stored in a database, then retrieved and displayed again? If so, is your database setup as UTF-8? Also, if using Tomcat, is the connector setup as UTF-8 also? For Wicket, try setting this *: getRequestCycleSettings().setResponseRequestEncoding(UTF-8); getMarkupSettings().setDefaultMarkupEncoding(UTF-8); in your Application#init If you don't set the default markup encoding explicitly, the default for it is the 'os provided encoding' (see: IMarkupSettings#getDefaultMarkupEncoding) If Tomcat, add URIEncoding=UTF-8 to your connector. See if that helps. cheers, Steve * came up on list back in early 2009. On 11/05/2010, at 9:16 PM, Jens Zastrow wrote: Hi, I cannot enter/save unicode chars with a AjaxEditableLabel (e.g. german/arabic). Enter: 'ü' Value: 'ü' All unicode-chars seems to be converted to utf-8 since the single char ü is converter to double-bytes? Thanks Jens - 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 -- dipl. inform jens zastrow phone | +49.152.04840108 mail | m...@jens-zastrow.de web | http://jens-zastrow.de xing | http://www.xing.com/profile/Jens_Zastrow - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Troubles with AjaxEditableLabel
Hi! Any hints to point me in the right direction? Here is the end bit of the Ajax request (from the Wicket Ajax Debug panel): ![CDATA[{ var el=wicketGet('editor42'); if (el.createTextRange) { var v = el.value; var r = el.createTextRange(); r.moveStart('character', v.length); r.select(); } }]]/ evaluateevaluate![CDATA[Wicket.Focus.setFocusOnId('editor42');]]/ evaluate/ajax-response But getting this error immediately after: INFO: Response parsed. Now invoking steps... ERROR: Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript: TypeError: el is null So, the html doesn't get updated and my editable label is not editable. The error message is not helping, and even after some digging, I've run out of ideas... Can post more info if necessary. Thanks! =David - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxEditableLabel with icon in addition to label
Dear all, I would like to add an icon next to the label of an AjaxEditableLabel component. I tried to use a Panel or WebMarkupContainer, but both are not subtypes to WebComponent (which is the return type of newLabel() that I tried to overwrite). Can you please provide me with suggestions about how to implement this? TIA, Erich
Re: AjaxEditableLabel with icon in addition to label
use css... -igor On Mon, May 3, 2010 at 5:51 AM, Erich W Schreiner eschrei...@yahoo.com wrote: Dear all, I would like to add an icon next to the label of an AjaxEditableLabel component. I tried to use a Panel or WebMarkupContainer, but both are not subtypes to WebComponent (which is the return type of newLabel() that I tried to overwrite). Can you please provide me with suggestions about how to implement this? TIA, Erich - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to increase the width of the AjaxEditableLabel editor? @L
I noticed that when the user clicks on AjaxEditableLabel to edit the text the width of the edited area is reduced to 30 or so characters. How can I change the width of AjaxEditableLabel editor? Thanks.
Re: AjaxEditableLabel
Hi, Well, I have overrided AjaxEditableLabel to use the wicketAjaxPost (that's solved my problem), because I shall not change the URIEncoding (there may be conflits with others applications running under the Tomcat server and I'm not allowed to do that :'( ). Thanks for your reply Regards Julien Roche Aka Indiana_Jules On Tue, Dec 8, 2009 at 8:30 PM, TahitianGabriel glan...@piti.pf wrote: Try to add URIEncoding=UTF-8 in the Connector meta in the server.xml file of Tomcat: Connector URIEncoding=UTF-8 ... Should solve your problem... Regards, Gabriel. -- View this message in context: http://old.nabble.com/AjaxEditableLabel-tp26676156p26699350.html Sent from the Wicket - User 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: AjaxEditableLabel
Try to add URIEncoding=UTF-8 in the Connector meta in the server.xml file of Tomcat: Connector URIEncoding=UTF-8 ... Should solve your problem... Regards, Gabriel. -- View this message in context: http://old.nabble.com/AjaxEditableLabel-tp26676156p26699350.html Sent from the Wicket - User 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
AjaxEditableLabel
Hi guys, I used Wicket-1.4.3 Wicket-1.4.3 on Windows XP Tomcat 6, and I've got a strange behavior on the component AjaxEditableLabel. If I insert peut-être in the field, the character with the accent will be badly stored. In the code, I see the following code into the Ajax behavior: final String saveCall = { + generateCallbackScript(wicketAjaxGet(' + getCallbackUrl() + save=true'+this.name+'='+wicketEncode(this.value)) + ; return false;}; If I change it, like it was done into the commit r835229 for the ajaxEditMultineLabel (see http://svn.apache.org/viewvc/wicket/trunk/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxEditableMultiLineLabel.java?view=diffr1=835228r2=835229pathrev=835229), with this code: final String saveCall = { + wicketAjaxPost(' + getCallbackUrl(true) + save=true', wicketSerialize(this)); return true;}; It works, I retrieve the correct text. Can it be possible to change this part of code to avoid changing the Tomcat server configuration ? Thanks Julien Roche Aka Indiana_Jules Email: roche@gmail.com Portable: 06 63 91 94 63 Skype: indiana_jules
AjaxEditableLabel and problem with diacritical marks
Hello, when I submit AjaxEditableLabel which contains a letter with diacritical mark (ěščřžýáíé..) I dont get right letter in model, but something like this '?'. All my markups contains this: ?xml version=1.0 encoding=UTF-8 ? html xmlns:wicket ... /html Could you give me a advice? thanks
Regarding AjaxEditableLabel and feedback
Hi, I have an issue with AjaxEditableLabel that i hope i can get some help with. In my application i have a couple of AjaxEditableLabel's. Though i am not interested in the default feature of AjaxEditableLabel. I want edit button and a save button, that switches automatically between the Label and TextInput mode for all the AjaxEditableLabel fields i have. I used AjaxFallbackLink to implement a save button and edit button, that switches between the Label and TextInput fields of the AjaxEditableLabel. And this works for me now. The only problem i have is that the feedback is not displaying unless i submit the form. It does not show when i switch between the modes. When i log the onError method in my instance of the AjaxEditableLabel, i can see that the error is caugth, but for some reason not displayed. Here is some of my code: MyAjaxEditableLabel adress = new MyAjaxEditableLabel(adress, new PropertyModel(wildcardProfil, adress.street)); add(adresse.setRequired(true)); FeedbackPanel adressFP = new NbFeedbackPanel(adress.feedback, new ContainerFeedbackMessageFilter(adress)); add(adressFP); And the AjaxFallbackLink's: class SaveAjaxFallbackLink extends AjaxFallbackLink { public void onClick(AjaxRequestTarget target) { if (target != null) { // shift visibility adress.makeEditorlVisible(true); adress.makeLabelVisible(false); target.addComponent(adress); ... } class EditAjaxFallbackLink extends AjaxFallbackLink { public void onClick(AjaxRequestTarget target) { if (target != null) { // shift visibility adress.makeEditorlVisible(true); adress.makeLabelVisible(false); target.addComponent(adress); ... } So when i click edit it should be in display mode, when click save it should save the content and go back to none-edit mode. But how do i get the feedback, when press the save button ? Hope someone can help me on this. Best Regards Cemil
Re: Regarding AjaxEditableLabel and feedback
your save link should be a save link that submits a form, unless you are going to manually append the value you want sent back via javascript to the save link's url. -igor On Tue, Sep 1, 2009 at 4:27 AM, Muro Copenhagencopenha...@gmail.com wrote: Hi, I have an issue with AjaxEditableLabel that i hope i can get some help with. In my application i have a couple of AjaxEditableLabel's. Though i am not interested in the default feature of AjaxEditableLabel. I want edit button and a save button, that switches automatically between the Label and TextInput mode for all the AjaxEditableLabel fields i have. I used AjaxFallbackLink to implement a save button and edit button, that switches between the Label and TextInput fields of the AjaxEditableLabel. And this works for me now. The only problem i have is that the feedback is not displaying unless i submit the form. It does not show when i switch between the modes. When i log the onError method in my instance of the AjaxEditableLabel, i can see that the error is caugth, but for some reason not displayed. Here is some of my code: MyAjaxEditableLabel adress = new MyAjaxEditableLabel(adress, new PropertyModel(wildcardProfil, adress.street)); add(adresse.setRequired(true)); FeedbackPanel adressFP = new NbFeedbackPanel(adress.feedback, new ContainerFeedbackMessageFilter(adress)); add(adressFP); And the AjaxFallbackLink's: class SaveAjaxFallbackLink extends AjaxFallbackLink { public void onClick(AjaxRequestTarget target) { if (target != null) { // shift visibility adress.makeEditorlVisible(true); adress.makeLabelVisible(false); target.addComponent(adress); ... } class EditAjaxFallbackLink extends AjaxFallbackLink { public void onClick(AjaxRequestTarget target) { if (target != null) { // shift visibility adress.makeEditorlVisible(true); adress.makeLabelVisible(false); target.addComponent(adress); ... } So when i click edit it should be in display mode, when click save it should save the content and go back to none-edit mode. But how do i get the feedback, when press the save button ? Hope someone can help me on this. Best Regards Cemil - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxEditableLabel doesn't work in IE7
Hi. I'm testing AjaxEditableLabel as well as AjaxEditableMultiLineLabel using wicket rc7 now, but the same problem initially occurred with rc3. Mysteriously, the ajax call isn't working with IE7, although it's working with IE6, firefox etc. Is it possible this is due to crippled IE7 installation, as I'm using http://tredosoft.com/IE7_standalone on Parallels, and I have no apparent chance to test on real windows box. I get the following error in wicket ajax debug window, which tells something about Automation server can't create object: INFO: Initiating Ajax GET request on ?wicket:interface=:1:m2ChoiceContainer:m2author:label::IBehaviorListener:0:random=0.2440050199589187 INFO: Invoking pre-call handler(s)... INFO: Received ajax response (2769 characters) INFO: ?xml version=1.0 encoding=UTF-8?ajax-responseheader-contribution encoding=wicket1 ![CDATA[head xmlns:wicket=http://wicket.apache.org;script type=text/javascript src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js/script script type=text/javascript id=wicket-ajax-debug-enable!--/*--![CDATA[/*!--*/ wicketAjaxDebugEnable=true; /*--]^]^*//script /head]]/header-contributioncomponent id=m2author9 ![CDATA[span id=m2author9input type=text value=x name=m2ChoiceContainer:m2author:editor id=editore onblur={var wcall=wicketAjaxGet('?wicket:interface=:1:m2ChoiceContainer:m2author:editor::IActivePageBehaviorListener:0:-1wicket:ignoreIfNotActive=truesave=true'+this.name+'='+wicketEncode(this.value),null,null, function() {return Wicket.$('editore') != null;}.bind(this));; return false;} onkeypress=if (Wicket.Browser.isSafari()) { return; }; var kc=wicketKeyCode(event); if (kc==27) {var wcall=wicketAjaxGet('?wicket:interface=:1:m2ChoiceContainer:m2author:editor::IActivePageBehaviorListener:0:-1wicket:ignoreIfNotActive=truesave=false',null,null, function() {return Wicket.$('editore') != null;}.bind(this));; return false;} else if (kc!=13) { return true; } else {var wcall=wicketAjaxGet('?wicket:interface=:1:m2ChoiceContainer:m2author:editor::IActivePageBehaviorListener:0:-1wicket:ignoreIfNotActive=truesave=true'+this.name+'='+wicketEncode(this.value),null,null, function() {return Wicket.$('editore') != null;}.bind(this));; return false;} onkeydown=if (!Wicket.Browser.isSafari()) { return; }; var kc=wicketKeyCode(event); if (kc==27) {var wcall=wicketAjaxGet('?wicket:interface=:1:m2ChoiceContainer:m2author:editor::IActivePageBehaviorListener:0:-1wicket:ignoreIfNotActive=truesave=false',null,null, function() {return Wicket.$('editore') != null;}.bind(this));; return false;} else if (kc!=13) { return true; } else {var wcall=wicketAjaxGet('?wicket:interface=:1:m2ChoiceContainer:m2author:editor::IActivePageBehaviorListener:0:-1wicket:ignoreIfNotActive=truesave=true'+this.name+'='+wicketEncode(this.value),null,null, function() {return Wicket.$('editore') != null;}.bind(this));; return false;}//span]]/componentevaluate![CDATA[{ var el=wicketGet('editore'); if (el.createTextRange) { var v = el.value; var r = el.createTextRange(); r.moveStart('character', v.length); r.select(); } }]]/evaluateevaluate![CDATA[Wicket.Focus.setFocusOnId('editore');]]/evaluate/ajax-response ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Automation server can't create object INFO: Invoking post-call handler(s)... INFO: Invoking failure handler(s)... Thanks, cvl - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEditableLabel doesn't work in IE7
What about the wicket examples. Does this work for you? http://www.wicket-library.com/wicket-examples/ajax/editable-label http://www.wicket-library.com/wicket-examples/ajax/editable-label I've tried it in IE7 and it works fine. -- View this message in context: http://www.nabble.com/AjaxEditableLabel-doesn%27t-work-in-IE7-tp24722482p24723733.html Sent from the Wicket - User 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: AjaxEditableLabel doesn't work in IE7
good news, it doesn't. thanks a lot Mathias :D cvl Mathias Nilsson wrote: What about the wicket examples. Does this work for you? http://www.wicket-library.com/wicket-examples/ajax/editable-label http://www.wicket-library.com/wicket-examples/ajax/editable-label I've tried it in IE7 and it works fine. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxEditableLabel and feedback on error
Dear all, I am trying to implement a list with AJAX-powered inline editing and have set one field of the model to required using ajaxEditableLabel.setRequired(true). Now, whenever I hit [Enter] after clearing the related input field, I get the message Field 'editor' is required.. The field name 'editor' is coming from the internal instantiation of the editor field at line 491 of AjaxEditableLabel.java: editor = newEditor(this, editor, model); Is there any way to use the actual field name from the domain model for the feedback message, e.g. Field 'name' is required. ? Thanks best regards, Erich
AjaxEditableLabel field width.
I've been trying to implement a editable label in a DataView. Getting the AjaxEditableLabel into the DataView presented no trouble. However, I'm having trouble defining the width of the field. Ajax examples have yielded me no help on the methodology for this. I've tried SimpleAttributeModifier, but whenever I select a field for editing, it always snaps it back to the predefined width. While I would like to give code, I unfortunately currently lack any access to it.
Fwd: AjaxEditableLabel field width.
I've been trying to implement a editable label in a DataView. Getting the AjaxEditableLabel into the DataView presented no trouble. However, I'm having trouble defining the width of the field. Ajax examples have yielded me no help on the methodology for this. I've tried SimpleAttributeModifier, but whenever I select a field for editing, it always snaps it back to the predefined width. While I would like to give code, I unfortunately currently lack any access to it. Any ideas?
Re: AjaxEditableLabel ... but how to get the changed value?
On Tue, 26 May 2009 16:27:18 +0200 Dorothée Giernoth dorothee.giern...@kds-kg.de wrote: Now I want to write the changed information from these labels back into the database after the content has changed. Wouldn't be too much of a problem if I knew how to retrieve the changed value from the label. I really have no clue how to do that! Override the onSubmit() method, like this (untested, but you get the gist): cell.add(new AjaxEditableLabel(cell.newChildId(), new Model(...)) { protected void onSubmit(AjaxRequestTarget target) { super.onSubmit(target); String value = getDefaultModelObject(); // persist value here... } }); Alternatively, if you keep a reference to the model you pass to the AjaxEditableLabel, you can read its contents at some other point. Grüße Carl-Eric - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxEditableLabel within a RepeatingView?
Hey everyone, how can I use AjaxEditableLabel within a RepeatingView? Meaning: I have data from a database written into a RepeatingView. Now I wanna make it possible, that the user can edit the cells. But how? Any hint would be appreciated. Thnx, dg - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEditableLabel within a RepeatingView?
just like you would use it outside a repeatingview... -igor 2009/5/25 Dorothée Giernoth dorothee.giern...@kds-kg.de: Hey everyone, how can I use AjaxEditableLabel within a RepeatingView? Meaning: I have data from a database written into a RepeatingView. Now I wanna make it possible, that the user can edit the cells. But how? Any hint would be appreciated. Thnx, dg - 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
AjaxEditableLabel trouble in Safari
Anyone else having issues with AjaxEditableLabel in Safari? This could be a legit bug for Safari, but I thought i'd ask before adding an issue. What I'm getting is: 1) Label is beside the input box 2) when label is clicked, a new input is added to the page and the label is moved over. So you get: inpout...input...label - Brill - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Help: AjaxEditableLabel error
Dear all, I am using AjaxEditableLabel, with the following codes, it is ok to show the description, but when i clicked it, error happened. onEdit ... is on the console , so it already call onEdit() method, how to implement the method? how to solve the question? thanks a lot. AjaxEditableLabel descriptionEditableLabel = new AjaxEditableChoiceLabel(description, new PropertyModel(fileObj, description)){ @Override protected void onEdit(AjaxRequestTarget arg0) { System.out.println(onEdit ...); super.onEdit(arg0); } @Override protected void onError(AjaxRequestTarget arg0) { System.out.println(onError ...); super.onError(arg0); } @Override protected void onSubmit(AjaxRequestTarget arg0) { System.out.println(onSubmit ...); super.onSubmit(arg0); } }; item.add(descriptionEditableLabel); Exception: onEdit ... org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = editor, page = sg.sphsearch.dira.web.wicket.pages.people.EditPersonPage, path = 3:tabpanel:panel:attachedFilesPanelContainer:saveUploadFilesForm:group:fileList:0:description:editor.DropDownChoice, isVisible = true, isVersioned = false]] at org.apache.wicket.Component.renderComponent(Component.java:2467) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354) -- View this message in context: http://www.nabble.com/Help%3A-AjaxEditableLabel-error-tp22347654p22347654.html Sent from the Wicket - User 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: Help: AjaxEditableLabel error
sorry the reason for the error is AjaxEditableLabel descriptionEditableLabel = new AjaxEditableChoiceLabel(description, new PropertyModel(fileObj, description)) it should be AjaxEditableLabel descriptionEditableLabel = new AjaxEditableLabel(description, new PropertyModel(fileObj, description)) wch2001 wrote: Dear all, I am using AjaxEditableLabel, with the following codes, it is ok to show the description, but when i clicked it, error happened. onEdit ... is on the console , so it already call onEdit() method, how to implement the method? how to solve the question? thanks a lot. AjaxEditableLabel descriptionEditableLabel = new AjaxEditableChoiceLabel(description, new PropertyModel(fileObj, description)){ @Override protected void onEdit(AjaxRequestTarget arg0) { System.out.println(onEdit ...); super.onEdit(arg0); } @Override protected void onError(AjaxRequestTarget arg0) { System.out.println(onError ...); super.onError(arg0); } @Override protected void onSubmit(AjaxRequestTarget arg0) { System.out.println(onSubmit ...); super.onSubmit(arg0); } }; item.add(descriptionEditableLabel); Exception: onEdit ... org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = editor, page = sg.sphsearch.dira.web.wicket.pages.people.EditPersonPage, path = 3:tabpanel:panel:attachedFilesPanelContainer:saveUploadFilesForm:group:fileList:0:description:editor.DropDownChoice, isVisible = true, isVersioned = false]] at org.apache.wicket.Component.renderComponent(Component.java:2467) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354) -- View this message in context: http://www.nabble.com/Help%3A-AjaxEditableLabel-error-tp22347654p22348774.html Sent from the Wicket - User 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: AjaxEditableLabel in 1.3.0
Dear all, How can you solve the problem? I used wicket1.3.5, also have the problem: can not save with the error: java.lang.IllegalAccessError: tried to access method org.apache.wicket.Component.onModelChanging()V from class org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel$1 any suggestion? thanks a lot -- View this message in context: http://www.nabble.com/AjaxEditableLabel-in-1.3.0-tp14675483p22365003.html Sent from the Wicket - User 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
AjaxEditableLabel, Double type and comma / dot
Hi all, I'd like to know if there is a way to make an AjaxEditableLabel accept either a comma or a dot as decimal separator. That field has a Double type. It works well but I have to insert a , as decimal separator (dots are not allowed), which is quite unusual. I know this is related to Locale, but is there an easy way? Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEditableLabel, Double type and comma / dot
What you can do is to provide you own Converter to the Label and do you own number parsing/formatting. In my experience it makes sense to strictly follow the formats defined by the locales, otherwise user will complain about unexpected results when entering numbers, e.g. if they use the character that you would expect as decimal separator as grouping char. On Fri, Feb 27, 2009 at 4:19 PM, Piller Sébastien pi...@hmcrecord.ch wrote: Hi all, I'd like to know if there is a way to make an AjaxEditableLabel accept either a comma or a dot as decimal separator. That field has a Double type. It works well but I have to insert a , as decimal separator (dots are not allowed), which is quite unusual. I know this is related to Locale, but is there an easy way? Thanks! - 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: AjaxEditableLabel, Double type and comma / dot
Hi, thank you for your quick answer. I agree with what you said, but my users are a bit... hum, you know, they have weird desires, and often ask for things they don't really need. If I try to make them change their point of view, then they get angry... so I've learned to close my mouth and do what they want, even if it is stupid... ;) Jonas a écrit : What you can do is to provide you own Converter to the Label and do you own number parsing/formatting. In my experience it makes sense to strictly follow the formats defined by the locales, otherwise user will complain about unexpected results when entering numbers, e.g. if they use the character that you would expect as decimal separator as grouping char. On Fri, Feb 27, 2009 at 4:19 PM, Piller Sébastien pi...@hmcrecord.ch wrote: Hi all, I'd like to know if there is a way to make an AjaxEditableLabel accept either a comma or a dot as decimal separator. That field has a Double type. It works well but I have to insert a , as decimal separator (dots are not allowed), which is quite unusual. I know this is related to Locale, but is there an easy way? Thanks! - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
DefaultDataTable and AjaxEditableLabel
Dear all, I try to create an editable column using DefaultDataTable and AjaxEditableLabel. My current version is posted below but it's quite a hack and I wonder whether there's an official good solution for that before I go on with my work. Thanks al lot for your help Philipp HTML:table class=tablename cellspacing=0 wicket:id=termTable[table]/table Java: columns = new ArrayListIColumn(); columns.add(new AbstractColumn(new Model(ColumnName)) { public void populateItem(Item cellItem, String componentId, final IModel model) { cellItem.setModel(model); ObjectToDisplay to = (ObjectToDisplay )cellItem.getModelObject(); String attribute1= to.getAttribute1(); cellItem.add(new AjaxEditableLabel(componentId, new Model(attribute1)) { @Override protected void onSubmit(AjaxRequestTarget target) { super.onSubmit(target); String newAttribute1 = (String) getModelObject(); ObjectToDisplay obj = (ObjectToDisplay ) getParent().getModelObject(); obj.setAttribute1(newAttribute1); System.out.println(New Attribute for + obj .getId() + : + obj .getAttribute1(); } }); } add(new DefaultDataTable(tablename, columns, provider, 20)); SortableDataProvider provider = new SortableDataProvider() { public int size() { return resultList.getEntries().size(); } public IModel model(Object object) { TableObject entry = (TableObject) object; return new Model((Serializable) entry); } /*public Iterator iterator(int first, int count) { return resultList.selectEntries(first, count).iterator(); }*/ public Iterator iterator(int first, int count) { SortParam sp = getSort(); return resultList.selectEntries(first, count, sp).iterator(); } }; -- Averbis GmbH c/o Klinikum der Albert-Ludwigs-Universität Stefan-Meier-Strasse 26 D-79104 Freiburg Fon: +49 (0) 761 - 203 6707 Fax: +49 (0) 761 - 203 6800 E-Mail: dau...@averbis.de Geschäftsführer: Dr. med. Philipp Daumke, Kornél Markó Sitz der Gesellschaft: Freiburg i. Br. AG Freiburg i. Br., HRB 701080 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DefaultDataTable and AjaxEditableLabel
Philipp Daumke schrieb: I try to create an editable column using DefaultDataTable and AjaxEditableLabel. My current version is posted below but it's quite a hack and I wonder whether there's an official good solution for that before I go on with my work. i think the passing of your models is a little weird. anyhow, you might want to take a look at this example: http://wicketstuff.org/wicket13/nested/?wicket:bookmarkablePage=%3Aorg.apache.wicket.examples.ajax.builtin.tree.EditableTreeTablePage cu uwe -- THOMAS DAILY GmbH Adlerstraße 19 79098 Freiburg Deutschland T + 49 761 3 85 59 0 F + 49 761 3 85 59 550 E schae...@thomas-daily.de www.thomas-daily.de Geschäftsführer/Managing Directors: Wendy Thomas, Susanne Larbig Handelsregister Freiburg i.Br., HRB 3947 Registrieren Sie sich unter http://morningnews.thomas-daily.de für die kostenfreien TD Morning News, eine Auswahl aktueller Themen des Tages morgens um 9:00 in Ihrer Mailbox. Hinweis: Der Redaktionsschluss für unsere TD Morning News ist täglich um 8:30 Uhr. Es werden vorrangig Informationen berücksichtigt, die nach 16:00 Uhr des Vortages eingegangen sind. Die Email-Adresse unserer Redaktion lautet redakt...@thomas-daily.de. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DefaultDataTable and AjaxEditableLabel
Hi Uwe, thanks for the link. I agree that my model passing is weird. Your link to the example explains an editable TreeTable but I look for a DataTable example. In that tree table example I cannot use the tree.table.PropertyEditableColumn as as the DefaultDataTable I want to use requires data.table.IColumns (not tree.table.IColumns) , or am I wrong? Or can I just cast them? Another ideas? Not to be mentioned I'm a wicket newbie and there's maybe a very simple solution for that Thanks, Philipp Philipp Daumke schrieb: I try to create an editable column using DefaultDataTable and AjaxEditableLabel. My current version is posted below but it's quite a hack and I wonder whether there's an official good solution for that before I go on with my work. i think the passing of your models is a little weird. anyhow, you might want to take a look at this example: http://wicketstuff.org/wicket13/nested/?wicket:bookmarkablePage=%3Aorg.apache.wicket.examples.ajax.builtin.tree.EditableTreeTablePage cu uwe -- Averbis GmbH c/o Klinikum der Albert-Ludwigs-Universität Stefan-Meier-Strasse 26 D-79104 Freiburg Fon: +49 (0) 761 - 203 6707 Fax: +49 (0) 761 - 203 6800 E-Mail: dau...@averbis.de Geschäftsführer: Dr. med. Philipp Daumke, Kornél Markó Sitz der Gesellschaft: Freiburg i. Br. AG Freiburg i. Br., HRB 701080 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org