Re: Access to Dynamically Generated AjaxEditableLabel Value

2017-05-17 Thread Martin Grigorov
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  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 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> getColumns() {
> logger.debug("About to evaluate columns");
>
> List> lReturn = new
> LinkedList>();
>
> lReturn.add(new PropertyColumn(
> new 
> StringResourceModel("table.col.header.tecnicalServiceName",
> this,
> null), "ts", "ts"));
>
> lReturn.add(new PropertyColumn(
> new 
> StringResourceModel("table.col.header.quantity",
> this, null),
> "technicalServiceNumber",
> "technicalServiceNumber") {
> private static final long serialVersionUID =
> 8344520291257227470L;
>
> /**
>  *
>  */
>
> @Override
> public void populateItem(Item 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(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;
> }
>
>
>
>

Access to Dynamically Generated AjaxEditableLabel Value

2017-05-17 Thread Ehsan
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 {

/**
 * 
 */
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> getColumns() {
logger.debug("About to evaluate columns");

List> lReturn = new
LinkedList>();

lReturn.add(new PropertyColumn(
new 
StringResourceModel("table.col.header.tecnicalServiceName", this,
null), "ts", "ts"));

lReturn.add(new PropertyColumn(
new 
StringResourceModel("table.col.header.quantity", this, null),
"technicalServiceNumber",
"technicalServiceNumber") {
private static final long serialVersionUID = 
8344520291257227470L;

/**
 * 
 */

@Override
public void 
populateItem(Item>
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:

 








--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Access-to-Dynamically-Generated-AjaxEditableLabel-Value-tp4677886.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.a

ResourceReference that contains relative paths

2017-05-17 Thread Ravi
Hi,

I have the following scenario:
My packages look like:
-bootstrap
--css
---BootstrapCssResourceReference.java
---bootstrap.css
--fonts
---glyphicons-halflings-regular.eot

In that css file bootstrap defines its font by referencing a relative path
(src:url(../fonts/glyphicons-halflings-regular.eot)
The BootstrapCssResourceReference has the following url:
http://localhost:8080/webapp/wicket/resource/some.package.bootstrap.css.BootstrapCssResourceReference/bootstrap.min-ver-1495022368739.css

Now when the browser resolves the relativ font url, it comes up with
http://localhost:8080/webapp/wicket/resource/fonts/glyphicons-halflings-regular.eot
Obviously it won't find anything there. 

I'm wondering what is the best way of dealing with that kind of references?
I could mount a ResourceReference for each file, but maybe there is a better
way?

Thanks for your time,

Ravi




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ResourceReference-that-contains-relative-paths-tp4677885.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



[ANNOUNCE] WicketStuff 7.7.0 Released

2017-05-17 Thread Martin Grigorov
WicketStuff core 7.7.0 based on Apache Wicket 7.7.0 is released and soon
will be available at Maven Central!

The changelog since 7.6.0 is:

Andrea Del Bene (5):
  Fix for WICKET-6287
  Another fix for WICKET-6287
  Change to comply with the last version of open-json
  Fix for gmap test case
  Issue #582

Sven Meier (4):
  issue #569 getObject's return might be a type variable
  removed erroneous commit into minis
  added behaviors for IE Document Compatibility and Safari Persisted
Cache
  Merge pull request #596 from rototor/wicket-7-inmethodgrid-
checkbox-onclick-fix

Martin Tzvetanov Grigorov (5):
  Build against Wicket 7.7.0-SNAPSHOT
  [clipboard.js] Update to 1.6.0
  Issue #595 - Remove slf4j-log4j as a dependency to non-example
projects
  Fix Maven warnings
  Release 7.7.0

Stefano Cascarini (3):
  Wicket 7.x pdf.js additional functions  (#573)
  [pdf.js] Add print and autoscale functions (#575)
  [pdf.js] Add progress event, use jquery (#577)

Jonathan Heek (2):
  don't add js code twice
  fix indentation

Maxim Solodovnik (2):
  More work on Issue #583: 7.x browserid module is removed
  Select2 is fixed to work as expected with wicket 7.7.0

chrisly42 (2):
  Fix for Issue #570: InMethod-Grid: AbstractPageableView does not
allow resetting of total count (#576)
  Fix for Issue #586: InMethodGrid: ColumnsHeaderRepeater uses wrong
markup. (#587)

Emmeran Seehuber (1):
  inmethodgrid: CheckBoxColumn: Fix click event name

Konstantinos Karavitis (1):
  Merge pull request #590 from kkaravitis/wicket-7.x

kkaravitis (1):
  fix for #588 issue: When invoking setResponsePage during an ajax
resource request the portlet doesn't redirect correctly


The WicketStuff team


Re: [ANNOUNCE] Apache Wicket 7.7.0 released

2017-05-17 Thread Martin Grigorov
Hi,

Please do not respond to announce@.

I do agree that it makes sense to mark those methods as deprecated in 6.x
and 7.x.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, May 17, 2017 at 9:13 AM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> Hi,
>
> see the migration guide for 8.x:
>
> https://cwiki.apache.org/confluence/display/WICKET/
> Migration+to+Wicket+8.0#MigrationtoWicket8.0-Changestoorg.apache.wicket.
> ajax.json.*ASFJIRAkey,summary,type,created,updated,due,
> assignee,reporter,priority,status,resolution5aa69414-a9e9-3523-82ec-
> 879b028fb15bWICKET-6287
>
> for 6.x / 7.x it is slightly different:
>
> https://cwiki.apache.org/confluence/display/WICKET/
> Migration+to+Wicket+7.0#MigrationtoWicket7.0-Changestoorg.apache.wicket.
> ajax.json.*WICKET-6287-Switchfromjson.orgtoopen-jsonRESOLVED
>
> If you need the functionality you are free to reimplement it or if the
> license of json.org is ok for you to add the library and change the
> imports.
>
> kind regards
>
> Tobias
>
> > Am 17.05.2017 um 08:52 schrieb Thomas Matthijs :
> >
> > Just a little warning to people upgrading, the json changes added
> > runtime failures.
> >
> > org.apache.wicket.WicketRuntimeException: This call is not supported
> > any longer, because of the change to open-json
> > (https://github.com/tdunning/open-json) due to license issues. (See
> > https://www.apache.org/legal/resolved#category-x)
> >
> >
> > Should these methods not be marked deprecated to at least generate
> warnings?
> >
> >> On Tue, May 16, 2017 at 8:55 PM, Andrea Del Bene 
> wrote:
> >> The Apache Wicket PMC is proud to announce Apache Wicket 7.7.0!
> >>
> >> Apache Wicket is an open source Java component oriented web application
> >> framework that powers thousands of web applications and web sites for
> >> governments, stores, universities, cities, banks, email providers, and
> >> more. You can find more about Apache Wicket at
> https://wicket.apache.org
> >>
> >> This release marks another minor release of Wicket 7. We
> >> use semantic versioning for the development of Wicket, and as such no
> >> API breaks are present breaks are present in this release compared to
> >> 7.0.0.
> >>
> >> New and noteworthy
> >> --
> >> With this version Wicket changed its internal JSON implementation
> (package
> >> org.apache.wicket.ajax.json) switching from project JSON-java
> >> (https://github.com/stleary/JSON-java) to Open JSON
> >> (https://github.com/openjson/openjson). This was necessery as
> JSON-java's
> >> license is no longer compatible with Apache License 2.0.
> >>
> >> Using this release
> >> --
> >>
> >> With Apache Maven update your dependency to (and don't forget to
> >> update any other dependencies on Wicket projects to the same version):
> >>
> >> 
> >>org.apache.wicket
> >>wicket-core
> >>7.7.0
> >> 
> >>
> >> Or download and build the distribution yourself, or use our
> >> convenience binary package
> >>
> >> * Source: http://www.apache.org/dyn/closer.cgi/wicket/7.7.0
> >> * Binary: http://www.apache.org/dyn/closer.cgi/wicket/7.7.0/binaries
> >>
> >> Upgrading from earlier versions
> >> ---
> >>
> >> If you upgrade from 7.y.z this release is a drop in replacement. If
> >> you come from a version prior to 7.0.0, please read our Wicket 7
> >> migration guide found at
> >>
> >> * http://s.apache.org/wicket7migrate
> >>
> >> Have fun!
> >>
> >> — The Wicket team
> >>
> >>
> >> 
> 
> >>
> >>The signatures for the source release artefacts:
> >>
> >>
> >> Signature for apache-wicket-7.7.0.zip:
> >>
> >>-BEGIN PGP SIGNATURE-
> >> Version: GnuPG v1
> >>
> >> iQIcBAABAgAGBQJZFKHNAAoJEAzCjx+CMhBVeUEQAKYrOl330nSPSPIlNdFn84ux
> >> VASOZ7R0WgkF3jiI7YfqJoif3KY5oed3Exu/zhNvjc45Gocw6HZp7ETDHw5lpaMl
> >> vEjXGCkp/OwYrwfUKs9eCwfM0l5XG7wfSMgEpEWBeGVpZjDS08bnQje8rH3sjhHz
> >> g+Kzen2WItdRpw+TSpxG8RHUOpJ0lUy7tTIIdYtLBL7HnMqgKOSKDQMfUW+q/voS
> >> 3qxOKhpVA5mw46z8v/z2c96FUBU9JbKpBl4DAp8dMWy2a+/GEB7O/SM4wpFgRXim
> >> iOerbsEi0nruBGm4RU7pMH4aGppZmr2IdiGMeiA1ZlgI7TBJB2SmvK4hffhaTmV6
> >> Zcn6BtCPn70reUdHOijnebAuLsLio0D1jtGb2kQ4VvxuamXc+qLJfnyiWtg91kf8
> >> A6NcNzENN1sdMORHBah7tSwN4RP47eKG1uFN3isBi+lKiZcYPW/DmSWKNEY76Q0T
> >> SMPgcvIl3vz4tCfCo08PSbQG6HPgut+0KzuhA7KyLO34WmzvnQxvcigrOTDUUHy1
> >> bHEoSlcor+XZcIOPYmKJLZVHFDNrnZRfqgTPHo9w0AlYAYmmbwL5iM9vG/u3zxuv
> >> SziD7fXvu8zqA33XNNikS4DJz76Onz1ZOrx3dhZt3lIktIJC5KYxk8so+w1DjX0q
> >> wDSelmuT4U9w7iX4Y0Cf
> >> =6Htq
> >> -END PGP SIGNATURE-
> >>
> >> Signature for apache-wicket-7.7.0.tar.gz:
> >>
> >>-BEGIN PGP SIGNATURE-
> >> Version: GnuPG v1
> >>
> >> iQIcBAABAgAGBQJZFKHNAAoJEAzCjx+CMhBVjeIP/RjNERucRA5/C/4M/HhxU/wt
> >> 05ZlyiEYTTviuX5gLPc3AQQm7zA0FrQo5Mz80+KGKECq63hbXtHsqxqsvEAOLnf0
> >> mhgtvgmZwILaXkY3Q7WBgrxqKZsISLGlOiBWJQV68ml5qPsjd08WEXmpscrIr13B
> >> zCPekHtizOKepNZmXRxPGdSV9ZeoHllFKwb

Re: [ANNOUNCE] Apache Wicket 7.7.0 released

2017-05-17 Thread Tobias Soloschenko
Hi,

see the migration guide for 8.x:

https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+8.0#MigrationtoWicket8.0-Changestoorg.apache.wicket.ajax.json.*ASFJIRAkey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution5aa69414-a9e9-3523-82ec-879b028fb15bWICKET-6287

for 6.x / 7.x it is slightly different:

https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+7.0#MigrationtoWicket7.0-Changestoorg.apache.wicket.ajax.json.*WICKET-6287-Switchfromjson.orgtoopen-jsonRESOLVED

If you need the functionality you are free to reimplement it or if the license 
of json.org is ok for you to add the library and change the imports.

kind regards

Tobias

> Am 17.05.2017 um 08:52 schrieb Thomas Matthijs :
> 
> Just a little warning to people upgrading, the json changes added
> runtime failures.
> 
> org.apache.wicket.WicketRuntimeException: This call is not supported
> any longer, because of the change to open-json
> (https://github.com/tdunning/open-json) due to license issues. (See
> https://www.apache.org/legal/resolved#category-x)
> 
> 
> Should these methods not be marked deprecated to at least generate warnings?
> 
>> On Tue, May 16, 2017 at 8:55 PM, Andrea Del Bene  
>> wrote:
>> The Apache Wicket PMC is proud to announce Apache Wicket 7.7.0!
>> 
>> Apache Wicket is an open source Java component oriented web application
>> framework that powers thousands of web applications and web sites for
>> governments, stores, universities, cities, banks, email providers, and
>> more. You can find more about Apache Wicket at https://wicket.apache.org
>> 
>> This release marks another minor release of Wicket 7. We
>> use semantic versioning for the development of Wicket, and as such no
>> API breaks are present breaks are present in this release compared to
>> 7.0.0.
>> 
>> New and noteworthy
>> --
>> With this version Wicket changed its internal JSON implementation (package
>> org.apache.wicket.ajax.json) switching from project JSON-java
>> (https://github.com/stleary/JSON-java) to Open JSON
>> (https://github.com/openjson/openjson). This was necessery as JSON-java's
>> license is no longer compatible with Apache License 2.0.
>> 
>> Using this release
>> --
>> 
>> With Apache Maven update your dependency to (and don't forget to
>> update any other dependencies on Wicket projects to the same version):
>> 
>> 
>>org.apache.wicket
>>wicket-core
>>7.7.0
>> 
>> 
>> Or download and build the distribution yourself, or use our
>> convenience binary package
>> 
>> * Source: http://www.apache.org/dyn/closer.cgi/wicket/7.7.0
>> * Binary: http://www.apache.org/dyn/closer.cgi/wicket/7.7.0/binaries
>> 
>> Upgrading from earlier versions
>> ---
>> 
>> If you upgrade from 7.y.z this release is a drop in replacement. If
>> you come from a version prior to 7.0.0, please read our Wicket 7
>> migration guide found at
>> 
>> * http://s.apache.org/wicket7migrate
>> 
>> Have fun!
>> 
>> — The Wicket team
>> 
>> 
>> 
>> 
>>The signatures for the source release artefacts:
>> 
>> 
>> Signature for apache-wicket-7.7.0.zip:
>> 
>>-BEGIN PGP SIGNATURE-
>> Version: GnuPG v1
>> 
>> iQIcBAABAgAGBQJ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HllFKwb257nFSd0oK2B6wcrrD4WFZjUNPMFP
>> daP5qH3bIsr0Kp2938hEVwqXFRpcxZqEF/ZReVEv0tC66R9pqd+JVt8myH6YpnHR
>> Ymg3ApjQTFHKw2dBtfA0l5izH0UiAkSRYrNszxT5jcgReX+PICUfwNpYa+FHByAk
>> sP15sFZ5JT1sqwtGkBhVvLE9gm8IB8MndInWS31oaAW8jv4hX823HsN4VEoh+PzU
>> lQTmTEVCyLzYMA0GdXCmKyugNbaSnQBCqbTkbMjqPnPXcwaOUJmX7U4A43MeTrS4
>> 7E8Y50xCfBL22uYEoEhcylscVqW/8NDrmUAb7rfS7RmAgd4XUIpPeHogM/in021R
>> 8Qx+Op2dY1FRgbmD40CaLkAx1tQ1806BCFBCcLU9SqthdNt1slySvussTHdz+usF
>> /qlursrXa56tqchhl1z8mM80NLtnK+VYUtJkQ8ClEs8ADypiidmNLFb+QcLv8NRl
>> oAIYkVII4BcThA/4eJ