Re: [ANN] wicketstuff-lazymodel

2013-03-06 Thread Jesse Long

Hi All,

Please can we do a 6.6.0 release of wicketstuff... I'd love for 
LazyModel to be on Maven Central.


Thanks,
Jesse

On 18/02/2013 19:30, Sven Meier wrote:

Hi all,

I've added a new module to wicketstuff:

LazyModel offers lazy evaluation of method invocations. It takes the 
best from present solutions (safemodel and modelfactory) and improves 
on reflection to support:


* arbitrary parameters
* generics
* collections
* interfaces

Two simple examples:

IModel model = model(from(a).getB().getStrings().get("key"));

new LazyColumn(header, from(A.class).getB());

Read more here:

https://github.com/wicketstuff/core/wiki/LazyModel

Have fun
Sven

-
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: Wicket 1.5.x FileUploadField and the required flag

2013-03-06 Thread Paul Bors
n/m that... is just me :)

-Original Message-
From: Paul Bors [mailto:p...@bors.ws] 
Sent: Wednesday, March 06, 2013 2:02 PM
To: users@wicket.apache.org
Subject: Wicket 1.5.x FileUploadField and the required flag

If the FileUploadField is just a FormComponent> shouldn't 
calling setRequired(true) on it and submitting the form with blank user input 
generate an error using the "Required" language pack key?

I've notice that it doesn’t do that for me and was wondering if it's just me.



-
~ Thank you,
p...@bors.ws
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-x-FileUploadField-and-the-required-flag-tp4657052.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: JS execution order problem

2013-03-06 Thread Nick Pratt
I logged: https://issues.apache.org/jira/browse/WICKET-5082 and added some
comments with my interpretation of what's going on.

N

On Wed, Mar 6, 2013 at 12:31 PM, Nick Pratt  wrote:

> I take some of that back:
>
> In the initial page rendering, the Javascript is ordered as I expect
> (child JS then parent JS).
> However, in the Ajax update, the Wicket listeners are added *after* the
> datatables init call, which results in an out of order sequence.
>
> Why is the Ajax update change the order of the JS of the parent and child
> elements?
>
> N
>
> On Wed, Mar 6, 2013 at 12:27 PM, Nick Pratt  wrote:
>
>> Thanks - that seems to confirm the problem - delaying the Datatables JS
>> to after the Wicket link listeners have executed will fix it, since the
>> errors are coming from the Wicket Link Listeners not being able to find
>> markup IDs that the Datatables JS paginates out of view. (load fires after
>> ready if my research is correct)
>>
>> I expect the execution order to be:
>> 1. All link listeners within the table would be executed (all rows in
>> table are available at this point)
>> 2. Datatables JS then executes and paginates the table
>>
>> Although when I look at the page source I see the Wicket event listeners
>> listed before the Datatables JS, they seem to be executing in a different
>> order - this is what is confusing.
>>
>> N
>>
>>  On Wed, Mar 6, 2013 at 12:10 PM, Andrea Del Bene 
>> wrote:
>>
>>> Replacing OnDomReadyHeaderItem with OnLoadHeaderItem (class
>>> DatatablesBehavior) seems to solve your problem. It's likely that your
>>> script (the one from DatatablesBehavior) depends on some other code and it
>>> must wait for it to be loaded before being executed.
>>>
 Im having a problem with Javascript execution order that I could use
 some
 help with.  I made a quickstart here:
 https://dl.dropbox.com/u/**107816727/quickstart.tar.gz

 Basically, this is a Wicket DefaultDataTable, with an embedded
 AjaxEventBehavior, overlaid with a Datatables.net JS behavior (
 www.datatables.net).

 What seems to be happening is that the Datatables.net JS is executing
 before the Wicket AjaxEventBehavior JS, and in so doing, it paginates
 the
 table and removes a couple of IDs that Wicket then cannot find.
 I thought the default JS execution order was children first, then
 parent,
 so I was expecting the AjaxEventBehavior JS to execute first and then
 the
 Datatables.net JS (which is on the parent DefaultDataTable)

 To reproduce simply click any of the "Click Me" cells in the table.

 Any suggestions would be most appreciated,

 Regards

 Nick


>>>
>>> --**--**
>>> -
>>> To unsubscribe, e-mail: 
>>> users-unsubscribe@wicket.**apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>


Re: Validator Question

2013-03-06 Thread Jered Myers
Assuming you are extending AbstractFormValidator, you can store the 
components when you construct the validator like so...


public DependantTextFieldValidator(TextField textField1, TextField 
dependantTextField)

{
if (textField1 == null)
{
throw new IllegalArgumentException("argument textField1 
cannot be null");

}
if (dependantTextField == null)
{
throw new IllegalArgumentException("argument textField2 
cannot be null");

}
components = new FormComponent[] { textField1, 
dependantTextField };

}

and then pull them back out like so...

public void validate(Form form)
{
// TextField1
final FormComponent textField1 = components[0];
// DependantTextField
final FormComponent dependantTextField = components[1];

boolean textField1Empty = Strings.isEmpty(textField1.getInput());

}

On 03/06/2013 12:03 PM, eugenebalt wrote:

I have a Form-level Validator which works on a pair of Date fields, and makes
sure that one can't be filled in without the other. (None or both filled in
is fine.)

The Validator is Form-level because it is multi-component; it must work
generically on any pair of Component IDs, because it's shared between
different projects. Right now the implementation is:

@Override
public void validate(Form form) {
//...
}

The issue is that I can't pass any arbitrary pair of IDs to validate, the
param is a Form. Do I hard-code all the possible IDs that different projects
can use? Or is there a better way to do it?

Thanks



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Validator-Question-tp4657054.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Validator Question

2013-03-06 Thread eugenebalt
I have a Form-level Validator which works on a pair of Date fields, and makes
sure that one can't be filled in without the other. (None or both filled in
is fine.)

The Validator is Form-level because it is multi-component; it must work
generically on any pair of Component IDs, because it's shared between
different projects. Right now the implementation is:

@Override
public void validate(Form form) {
   //...
}

The issue is that I can't pass any arbitrary pair of IDs to validate, the
param is a Form. Do I hard-code all the possible IDs that different projects
can use? Or is there a better way to do it?

Thanks



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Validator-Question-tp4657054.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: Wicket Tester with BookmarkablePageLink

2013-03-06 Thread yka
Hi Vineet,
tried it out. My setup() method now looks like this:

@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
app = new StartApplication() {
@Override
public ServletContext getServletContext() {
ServletContext servletContext = 
super.getServletContext();
ApplicationContextMock appctx = new 
ApplicationContextMock();
Service service = Mockito.mock(Service.class);
appctx.putBean(service);
WebApplication application = new 
MockApplication();
WicketTester tester = new 
WicketTester(application);
SpringComponentInjector componentInjector = new 
SpringComponentInjector(
tester.getApplication(), 
appctx, false);


tester.getApplication().getComponentInstantiationListeners()
.add(componentInjector);

return servletContext;
}
};

org.apache.log4j.Logger logger = org.apache.log4j.Logger
.getLogger("org.apache.wicket.util.tester");
logger.setLevel(Level.DEBUG);

tester = new WicketTester(app);
}


But when I run the test, I get:

java.lang.IllegalStateException: No WebApplicationContext found: no
ContextLoaderListener registered?
at
org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:90)
at
org.apache.wicket.spring.injection.annot.SpringComponentInjector.(SpringComponentInjector.java:81)
at com.index.StartApplication.init(StartApplication.java:16)
at org.apache.wicket.Application.initApplication(Application.java:818)
at
org.apache.wicket.util.tester.BaseWicketTester.(BaseWicketTester.java:287)
at
org.apache.wicket.util.tester.BaseWicketTester.(BaseWicketTester.java:231)
at 
org.apache.wicket.util.tester.WicketTester.(WicketTester.java:184)
at
com.customer.web.AbstractBasePageTester.setUp(AbstractBasePageTester.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at
org.mockito.internal.runners.JUnit45AndHigherRunnerImpl.run(JUnit45AndHigherRunnerImpl.java:37)
at 
org.mockito.runners.MockitoJUnitRunner.run(MockitoJUnitRunner.java:62)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Tester-with-BookmarkablePageLink-tp4656921p4657053.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



Wicket 1.5.x FileUploadField and the required flag

2013-03-06 Thread Paul Bors
If the FileUploadField is just a FormComponent> shouldn't
calling setRequired(true) on it and submitting the form with blank user
input generate an error using the "Required" language pack key?

I've notice that it doesn’t do that for me and was wondering if it's just
me.



-
~ Thank you,
p...@bors.ws
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-x-FileUploadField-and-the-required-flag-tp4657052.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: Sending Data via Javascript and AJAX

2013-03-06 Thread Nick Mudge
Great, do you know of any good examples using wicketAjaxPost?



On Wed, Mar 6, 2013 at 9:35 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Hi,
>
> On Wed, Mar 6, 2013 at 6:18 PM, Nick Mudge  wrote:
>
> > Looks like the problem with AjaxEditableLabel is that it sends data to
> the
> > server through a URL. The data I need to send to the server is a lot of
> > data and won't fit in a URL.
> > Is there another source code example that I could look at that can send a
> > lot of data to the server via AJAX?
> >
> > Here's is what I need to do:
> > I have a web page with a Save button on it. When the user presses the
> Save
> > button I want to execute some javascript which generates a large string
> > value and then I want the value to be sent to the server where I store
> the
> > value in a database. Then I want a label to appear on the webpage that
> says
> > the data has been saved. The string value contains a lot of data and so
> the
> > value cannot be put in a URL.
> >
> >
> The following might work.
>
> 1-Put data in a hidden field.
> 2-Use wicketAjaxPost() to stream back this value to server side.
>
>
> > I am using Wicket 1.4.
> >
> > Thanks
> > Nick
> >
> >
> >
> >
> > On Wed, Mar 6, 2013 at 9:09 AM, Nick Mudge  wrote:
> >
> > > I see, Martin wanted me to look at the source code of
> AjaxEditableLabel.
> > >  I didn't know that.
> > > I understand now. Thank you.
> > >
> > >
> > > On Wed, Mar 6, 2013 at 9:01 AM, Ernesto Reinaldo Barreiro <
> > > reier...@gmail.com> wrote:
> > >
> > >> Hi,
> > >>
> > >> On Wed, Mar 6, 2013 at 5:57 PM, Nick Mudge  wrote:
> > >>
> > >> > Hi,
> > >> > Where is the example?
> > >> >
> > >> >
> > >> AjaxEditableLabel source code?
> > >>
> > >>
> > >> > Nick
> > >> >
> > >> >
> > >> > On Wed, Mar 6, 2013 at 8:32 AM, Martin Grigorov <
> mgrigo...@apache.org
> > >> > >wrote:
> > >> >
> > >> > > On Wed, Mar 6, 2013 at 6:24 PM, Nick Mudge 
> > wrote:
> > >> > >
> > >> > > > Hi,
> > >> > > > Why would I look at the AjaxEditableLabel? According to the
> > javadoc
> > >> for
> > >> > > it,
> > >> > > >
> > >> > >
> > >> > > To see an example how this is done there.
> > >> > >
> > >> > >
> > >> > > > it is for: "An implementation of ajaxified edit-in-place
> component
> > >> > using
> > >> > > a
> > >> > > > TextField as it's editor."
> > >> > > > I am not doing that.
> > >> > > >
> > >> > > > What I need is a Save button that executes some javascript to
> > >> calculate
> > >> > > > some data that is then sent the server via AJAX.  Then I need to
> > >> > update a
> > >> > > > label on the webpage saying that the data has been saved.
> > >> > > >
> > >> > > > How can I do this?
> > >> > > >
> > >> > > > Thanks
> > >> > > > Nick
> > >> > > >
> > >> > > >
> > >> > > >
> > >> > > >
> > >> > > > On Wed, Mar 6, 2013 at 12:34 AM, Martin Grigorov <
> > >> mgrigo...@apache.org
> > >> > > > >wrote:
> > >> > > >
> > >> > > > > Hi,
> > >> > > > >
> > >> > > > > Take a look at AjaxEditableLabel, it sends a parameter named
> > >> "save".
> > >> > > > > This is improved a lot in Wicket 6.
> > >> > > > >
> > >> > > > >
> > >> > > > > On Wed, Mar 6, 2013 at 3:28 AM, Nick Mudge 
> > >> wrote:
> > >> > > > >
> > >> > > > > > I could not find an example that show's how to do what I
> want
> > to
> > >> > do.
> > >> > > > > >
> > >> > > > > > I have a web page with a Save button on it. When the user
> > >> presses
> > >> > the
> > >> > > > > Save
> > >> > > > > > button I want to execute some javascript which calculates a
> > >> value
> > >> > and
> > >> > > > > then
> > >> > > > > > I want the value to be sent to the server where I store the
> > >> value
> > >> > in
> > >> > > a
> > >> > > > > > database. Then I want a label to appear on the webpage that
> > says
> > >> > the
> > >> > > > data
> > >> > > > > > has been saved.
> > >> > > > > >
> > >> > > > > > I am new to Wicket and I am using Wicket 1.4. How should I
> do
> > >> this?
> > >> > > Is
> > >> > > > > > there an example of something like this?
> > >> > > > > >
> > >> > > > > > Thanks
> > >> > > > > > Nick Mudge
> > >> > > > > >
> > >> > > > >
> > >> > > > >
> > >> > > > >
> > >> > > > > --
> > >> > > > > Martin Grigorov
> > >> > > > > jWeekend
> > >> > > > > Training, Consulting, Development
> > >> > > > > http://jWeekend.com 
> > >> > > > >
> > >> > > >
> > >> > >
> > >> > >
> > >> > >
> > >> > > --
> > >> > > Martin Grigorov
> > >> > > jWeekend
> > >> > > Training, Consulting, Development
> > >> > > http://jWeekend.com 
> > >> > >
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Regards - Ernesto Reinaldo Barreiro
> > >> Antilia Soft
> > >> http://antiliasoft.com/ 
> > >>
> > >
> > >
> >
>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
> Antilia Soft
> http://antiliasoft.com/ 
>


Re: Sending Data via Javascript and AJAX

2013-03-06 Thread Ernesto Reinaldo Barreiro
Hi,

On Wed, Mar 6, 2013 at 6:18 PM, Nick Mudge  wrote:

> Looks like the problem with AjaxEditableLabel is that it sends data to the
> server through a URL. The data I need to send to the server is a lot of
> data and won't fit in a URL.
> Is there another source code example that I could look at that can send a
> lot of data to the server via AJAX?
>
> Here's is what I need to do:
> I have a web page with a Save button on it. When the user presses the Save
> button I want to execute some javascript which generates a large string
> value and then I want the value to be sent to the server where I store the
> value in a database. Then I want a label to appear on the webpage that says
> the data has been saved. The string value contains a lot of data and so the
> value cannot be put in a URL.
>
>
The following might work.

1-Put data in a hidden field.
2-Use wicketAjaxPost() to stream back this value to server side.


> I am using Wicket 1.4.
>
> Thanks
> Nick
>
>
>
>
> On Wed, Mar 6, 2013 at 9:09 AM, Nick Mudge  wrote:
>
> > I see, Martin wanted me to look at the source code of AjaxEditableLabel.
> >  I didn't know that.
> > I understand now. Thank you.
> >
> >
> > On Wed, Mar 6, 2013 at 9:01 AM, Ernesto Reinaldo Barreiro <
> > reier...@gmail.com> wrote:
> >
> >> Hi,
> >>
> >> On Wed, Mar 6, 2013 at 5:57 PM, Nick Mudge  wrote:
> >>
> >> > Hi,
> >> > Where is the example?
> >> >
> >> >
> >> AjaxEditableLabel source code?
> >>
> >>
> >> > Nick
> >> >
> >> >
> >> > On Wed, Mar 6, 2013 at 8:32 AM, Martin Grigorov  >> > >wrote:
> >> >
> >> > > On Wed, Mar 6, 2013 at 6:24 PM, Nick Mudge 
> wrote:
> >> > >
> >> > > > Hi,
> >> > > > Why would I look at the AjaxEditableLabel? According to the
> javadoc
> >> for
> >> > > it,
> >> > > >
> >> > >
> >> > > To see an example how this is done there.
> >> > >
> >> > >
> >> > > > it is for: "An implementation of ajaxified edit-in-place component
> >> > using
> >> > > a
> >> > > > TextField as it's editor."
> >> > > > I am not doing that.
> >> > > >
> >> > > > What I need is a Save button that executes some javascript to
> >> calculate
> >> > > > some data that is then sent the server via AJAX.  Then I need to
> >> > update a
> >> > > > label on the webpage saying that the data has been saved.
> >> > > >
> >> > > > How can I do this?
> >> > > >
> >> > > > Thanks
> >> > > > Nick
> >> > > >
> >> > > >
> >> > > >
> >> > > >
> >> > > > On Wed, Mar 6, 2013 at 12:34 AM, Martin Grigorov <
> >> mgrigo...@apache.org
> >> > > > >wrote:
> >> > > >
> >> > > > > Hi,
> >> > > > >
> >> > > > > Take a look at AjaxEditableLabel, it sends a parameter named
> >> "save".
> >> > > > > This is improved a lot in Wicket 6.
> >> > > > >
> >> > > > >
> >> > > > > On Wed, Mar 6, 2013 at 3:28 AM, Nick Mudge 
> >> wrote:
> >> > > > >
> >> > > > > > I could not find an example that show's how to do what I want
> to
> >> > do.
> >> > > > > >
> >> > > > > > I have a web page with a Save button on it. When the user
> >> presses
> >> > the
> >> > > > > Save
> >> > > > > > button I want to execute some javascript which calculates a
> >> value
> >> > and
> >> > > > > then
> >> > > > > > I want the value to be sent to the server where I store the
> >> value
> >> > in
> >> > > a
> >> > > > > > database. Then I want a label to appear on the webpage that
> says
> >> > the
> >> > > > data
> >> > > > > > has been saved.
> >> > > > > >
> >> > > > > > I am new to Wicket and I am using Wicket 1.4. How should I do
> >> this?
> >> > > Is
> >> > > > > > there an example of something like this?
> >> > > > > >
> >> > > > > > Thanks
> >> > > > > > Nick Mudge
> >> > > > > >
> >> > > > >
> >> > > > >
> >> > > > >
> >> > > > > --
> >> > > > > Martin Grigorov
> >> > > > > jWeekend
> >> > > > > Training, Consulting, Development
> >> > > > > http://jWeekend.com 
> >> > > > >
> >> > > >
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > Martin Grigorov
> >> > > jWeekend
> >> > > Training, Consulting, Development
> >> > > http://jWeekend.com 
> >> > >
> >> >
> >>
> >>
> >>
> >> --
> >> Regards - Ernesto Reinaldo Barreiro
> >> Antilia Soft
> >> http://antiliasoft.com/ 
> >>
> >
> >
>



-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ 


Re: using static fileds in a page

2013-03-06 Thread Jochen Mader
If you are already using Spring why do you need the field to be static?
Beans are by default singleton scoped and can be tailored to
session/request scoped.

On Wed, Mar 6, 2013 at 1:41 PM, Martin Grigorov  wrote:
> If you create an ExecutorService then you should shutdown it too.
> See org.apache.wicket.Application#getApplicationListeners &
> org.apache.wicket.IApplicationListener#onBeforeDestroyed
> or org.apache.wicket.Application#onDestroy
>
>
> On Wed, Mar 6, 2013 at 2:32 PM, fachhoch  wrote:
>
>> My proxy executes  my service  call in  a thread for which I ma uisng
>> google
>> Guava com.google.common.util.concurrent.SimpleTimeLimiter
>>
>> this uses   Executors.newCachedThreadPool() ,  if I want to restart my
>> server   do I have to worry about all these threadsnot stopping or any
>> issue with this ?
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/using-static-fileds-in-a-page-tp4657021p4657024.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: JS execution order problem

2013-03-06 Thread Nick Pratt
I take some of that back:

In the initial page rendering, the Javascript is ordered as I expect (child
JS then parent JS).
However, in the Ajax update, the Wicket listeners are added *after* the
datatables init call, which results in an out of order sequence.

Why is the Ajax update change the order of the JS of the parent and child
elements?

N

On Wed, Mar 6, 2013 at 12:27 PM, Nick Pratt  wrote:

> Thanks - that seems to confirm the problem - delaying the Datatables JS to
> after the Wicket link listeners have executed will fix it, since the errors
> are coming from the Wicket Link Listeners not being able to find markup IDs
> that the Datatables JS paginates out of view. (load fires after ready if my
> research is correct)
>
> I expect the execution order to be:
> 1. All link listeners within the table would be executed (all rows in
> table are available at this point)
> 2. Datatables JS then executes and paginates the table
>
> Although when I look at the page source I see the Wicket event listeners
> listed before the Datatables JS, they seem to be executing in a different
> order - this is what is confusing.
>
> N
>
>  On Wed, Mar 6, 2013 at 12:10 PM, Andrea Del Bene wrote:
>
>> Replacing OnDomReadyHeaderItem with OnLoadHeaderItem (class
>> DatatablesBehavior) seems to solve your problem. It's likely that your
>> script (the one from DatatablesBehavior) depends on some other code and it
>> must wait for it to be loaded before being executed.
>>
>>> Im having a problem with Javascript execution order that I could use some
>>> help with.  I made a quickstart here:
>>> https://dl.dropbox.com/u/**107816727/quickstart.tar.gz
>>>
>>> Basically, this is a Wicket DefaultDataTable, with an embedded
>>> AjaxEventBehavior, overlaid with a Datatables.net JS behavior (
>>> www.datatables.net).
>>>
>>> What seems to be happening is that the Datatables.net JS is executing
>>> before the Wicket AjaxEventBehavior JS, and in so doing, it paginates the
>>> table and removes a couple of IDs that Wicket then cannot find.
>>> I thought the default JS execution order was children first, then parent,
>>> so I was expecting the AjaxEventBehavior JS to execute first and then the
>>> Datatables.net JS (which is on the parent DefaultDataTable)
>>>
>>> To reproduce simply click any of the "Click Me" cells in the table.
>>>
>>> Any suggestions would be most appreciated,
>>>
>>> Regards
>>>
>>> Nick
>>>
>>>
>>
>> --**--**-
>> To unsubscribe, e-mail: 
>> users-unsubscribe@wicket.**apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>


Re: JS execution order problem

2013-03-06 Thread Nick Pratt
Thanks - that seems to confirm the problem - delaying the Datatables JS to
after the Wicket link listeners have executed will fix it, since the errors
are coming from the Wicket Link Listeners not being able to find markup IDs
that the Datatables JS paginates out of view. (load fires after ready if my
research is correct)

I expect the execution order to be:
1. All link listeners within the table would be executed (all rows in table
are available at this point)
2. Datatables JS then executes and paginates the table

Although when I look at the page source I see the Wicket event listeners
listed before the Datatables JS, they seem to be executing in a different
order - this is what is confusing.

N

On Wed, Mar 6, 2013 at 12:10 PM, Andrea Del Bene wrote:

> Replacing OnDomReadyHeaderItem with OnLoadHeaderItem (class
> DatatablesBehavior) seems to solve your problem. It's likely that your
> script (the one from DatatablesBehavior) depends on some other code and it
> must wait for it to be loaded before being executed.
>
>> Im having a problem with Javascript execution order that I could use some
>> help with.  I made a quickstart here:
>> https://dl.dropbox.com/u/**107816727/quickstart.tar.gz
>>
>> Basically, this is a Wicket DefaultDataTable, with an embedded
>> AjaxEventBehavior, overlaid with a Datatables.net JS behavior (
>> www.datatables.net).
>>
>> What seems to be happening is that the Datatables.net JS is executing
>> before the Wicket AjaxEventBehavior JS, and in so doing, it paginates the
>> table and removes a couple of IDs that Wicket then cannot find.
>> I thought the default JS execution order was children first, then parent,
>> so I was expecting the AjaxEventBehavior JS to execute first and then the
>> Datatables.net JS (which is on the parent DefaultDataTable)
>>
>> To reproduce simply click any of the "Click Me" cells in the table.
>>
>> Any suggestions would be most appreciated,
>>
>> Regards
>>
>> Nick
>>
>>
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Sending Data via Javascript and AJAX

2013-03-06 Thread Nick Mudge
Looks like the problem with AjaxEditableLabel is that it sends data to the
server through a URL. The data I need to send to the server is a lot of
data and won't fit in a URL.
Is there another source code example that I could look at that can send a
lot of data to the server via AJAX?

Here's is what I need to do:
I have a web page with a Save button on it. When the user presses the Save
button I want to execute some javascript which generates a large string
value and then I want the value to be sent to the server where I store the
value in a database. Then I want a label to appear on the webpage that says
the data has been saved. The string value contains a lot of data and so the
value cannot be put in a URL.

I am using Wicket 1.4.

Thanks
Nick




On Wed, Mar 6, 2013 at 9:09 AM, Nick Mudge  wrote:

> I see, Martin wanted me to look at the source code of AjaxEditableLabel.
>  I didn't know that.
> I understand now. Thank you.
>
>
> On Wed, Mar 6, 2013 at 9:01 AM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
>> Hi,
>>
>> On Wed, Mar 6, 2013 at 5:57 PM, Nick Mudge  wrote:
>>
>> > Hi,
>> > Where is the example?
>> >
>> >
>> AjaxEditableLabel source code?
>>
>>
>> > Nick
>> >
>> >
>> > On Wed, Mar 6, 2013 at 8:32 AM, Martin Grigorov > > >wrote:
>> >
>> > > On Wed, Mar 6, 2013 at 6:24 PM, Nick Mudge  wrote:
>> > >
>> > > > Hi,
>> > > > Why would I look at the AjaxEditableLabel? According to the javadoc
>> for
>> > > it,
>> > > >
>> > >
>> > > To see an example how this is done there.
>> > >
>> > >
>> > > > it is for: "An implementation of ajaxified edit-in-place component
>> > using
>> > > a
>> > > > TextField as it's editor."
>> > > > I am not doing that.
>> > > >
>> > > > What I need is a Save button that executes some javascript to
>> calculate
>> > > > some data that is then sent the server via AJAX.  Then I need to
>> > update a
>> > > > label on the webpage saying that the data has been saved.
>> > > >
>> > > > How can I do this?
>> > > >
>> > > > Thanks
>> > > > Nick
>> > > >
>> > > >
>> > > >
>> > > >
>> > > > On Wed, Mar 6, 2013 at 12:34 AM, Martin Grigorov <
>> mgrigo...@apache.org
>> > > > >wrote:
>> > > >
>> > > > > Hi,
>> > > > >
>> > > > > Take a look at AjaxEditableLabel, it sends a parameter named
>> "save".
>> > > > > This is improved a lot in Wicket 6.
>> > > > >
>> > > > >
>> > > > > On Wed, Mar 6, 2013 at 3:28 AM, Nick Mudge 
>> wrote:
>> > > > >
>> > > > > > I could not find an example that show's how to do what I want to
>> > do.
>> > > > > >
>> > > > > > I have a web page with a Save button on it. When the user
>> presses
>> > the
>> > > > > Save
>> > > > > > button I want to execute some javascript which calculates a
>> value
>> > and
>> > > > > then
>> > > > > > I want the value to be sent to the server where I store the
>> value
>> > in
>> > > a
>> > > > > > database. Then I want a label to appear on the webpage that says
>> > the
>> > > > data
>> > > > > > has been saved.
>> > > > > >
>> > > > > > I am new to Wicket and I am using Wicket 1.4. How should I do
>> this?
>> > > Is
>> > > > > > there an example of something like this?
>> > > > > >
>> > > > > > Thanks
>> > > > > > Nick Mudge
>> > > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > > --
>> > > > > Martin Grigorov
>> > > > > jWeekend
>> > > > > Training, Consulting, Development
>> > > > > http://jWeekend.com 
>> > > > >
>> > > >
>> > >
>> > >
>> > >
>> > > --
>> > > Martin Grigorov
>> > > jWeekend
>> > > Training, Consulting, Development
>> > > http://jWeekend.com 
>> > >
>> >
>>
>>
>>
>> --
>> Regards - Ernesto Reinaldo Barreiro
>> Antilia Soft
>> http://antiliasoft.com/ 
>>
>
>


Re: JS execution order problem

2013-03-06 Thread Andrea Del Bene
Replacing OnDomReadyHeaderItem with OnLoadHeaderItem (class 
DatatablesBehavior) seems to solve your problem. It's likely that your 
script (the one from DatatablesBehavior) depends on some other code and 
it must wait for it to be loaded before being executed.

Im having a problem with Javascript execution order that I could use some
help with.  I made a quickstart here:
https://dl.dropbox.com/u/107816727/quickstart.tar.gz

Basically, this is a Wicket DefaultDataTable, with an embedded
AjaxEventBehavior, overlaid with a Datatables.net JS behavior (
www.datatables.net).

What seems to be happening is that the Datatables.net JS is executing
before the Wicket AjaxEventBehavior JS, and in so doing, it paginates the
table and removes a couple of IDs that Wicket then cannot find.
I thought the default JS execution order was children first, then parent,
so I was expecting the AjaxEventBehavior JS to execute first and then the
Datatables.net JS (which is on the parent DefaultDataTable)

To reproduce simply click any of the "Click Me" cells in the table.

Any suggestions would be most appreciated,

Regards

Nick




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Sending Data via Javascript and AJAX

2013-03-06 Thread Nick Mudge
I see, Martin wanted me to look at the source code of AjaxEditableLabel.  I
didn't know that.
I understand now. Thank you.


On Wed, Mar 6, 2013 at 9:01 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Hi,
>
> On Wed, Mar 6, 2013 at 5:57 PM, Nick Mudge  wrote:
>
> > Hi,
> > Where is the example?
> >
> >
> AjaxEditableLabel source code?
>
>
> > Nick
> >
> >
> > On Wed, Mar 6, 2013 at 8:32 AM, Martin Grigorov  > >wrote:
> >
> > > On Wed, Mar 6, 2013 at 6:24 PM, Nick Mudge  wrote:
> > >
> > > > Hi,
> > > > Why would I look at the AjaxEditableLabel? According to the javadoc
> for
> > > it,
> > > >
> > >
> > > To see an example how this is done there.
> > >
> > >
> > > > it is for: "An implementation of ajaxified edit-in-place component
> > using
> > > a
> > > > TextField as it's editor."
> > > > I am not doing that.
> > > >
> > > > What I need is a Save button that executes some javascript to
> calculate
> > > > some data that is then sent the server via AJAX.  Then I need to
> > update a
> > > > label on the webpage saying that the data has been saved.
> > > >
> > > > How can I do this?
> > > >
> > > > Thanks
> > > > Nick
> > > >
> > > >
> > > >
> > > >
> > > > On Wed, Mar 6, 2013 at 12:34 AM, Martin Grigorov <
> mgrigo...@apache.org
> > > > >wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > Take a look at AjaxEditableLabel, it sends a parameter named
> "save".
> > > > > This is improved a lot in Wicket 6.
> > > > >
> > > > >
> > > > > On Wed, Mar 6, 2013 at 3:28 AM, Nick Mudge 
> wrote:
> > > > >
> > > > > > I could not find an example that show's how to do what I want to
> > do.
> > > > > >
> > > > > > I have a web page with a Save button on it. When the user presses
> > the
> > > > > Save
> > > > > > button I want to execute some javascript which calculates a value
> > and
> > > > > then
> > > > > > I want the value to be sent to the server where I store the value
> > in
> > > a
> > > > > > database. Then I want a label to appear on the webpage that says
> > the
> > > > data
> > > > > > has been saved.
> > > > > >
> > > > > > I am new to Wicket and I am using Wicket 1.4. How should I do
> this?
> > > Is
> > > > > > there an example of something like this?
> > > > > >
> > > > > > Thanks
> > > > > > Nick Mudge
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Martin Grigorov
> > > > > jWeekend
> > > > > Training, Consulting, Development
> > > > > http://jWeekend.com 
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Martin Grigorov
> > > jWeekend
> > > Training, Consulting, Development
> > > http://jWeekend.com 
> > >
> >
>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
> Antilia Soft
> http://antiliasoft.com/ 
>


Re: Sending Data via Javascript and AJAX

2013-03-06 Thread Ernesto Reinaldo Barreiro
Hi,

On Wed, Mar 6, 2013 at 5:57 PM, Nick Mudge  wrote:

> Hi,
> Where is the example?
>
>
AjaxEditableLabel source code?


> Nick
>
>
> On Wed, Mar 6, 2013 at 8:32 AM, Martin Grigorov  >wrote:
>
> > On Wed, Mar 6, 2013 at 6:24 PM, Nick Mudge  wrote:
> >
> > > Hi,
> > > Why would I look at the AjaxEditableLabel? According to the javadoc for
> > it,
> > >
> >
> > To see an example how this is done there.
> >
> >
> > > it is for: "An implementation of ajaxified edit-in-place component
> using
> > a
> > > TextField as it's editor."
> > > I am not doing that.
> > >
> > > What I need is a Save button that executes some javascript to calculate
> > > some data that is then sent the server via AJAX.  Then I need to
> update a
> > > label on the webpage saying that the data has been saved.
> > >
> > > How can I do this?
> > >
> > > Thanks
> > > Nick
> > >
> > >
> > >
> > >
> > > On Wed, Mar 6, 2013 at 12:34 AM, Martin Grigorov  > > >wrote:
> > >
> > > > Hi,
> > > >
> > > > Take a look at AjaxEditableLabel, it sends a parameter named "save".
> > > > This is improved a lot in Wicket 6.
> > > >
> > > >
> > > > On Wed, Mar 6, 2013 at 3:28 AM, Nick Mudge  wrote:
> > > >
> > > > > I could not find an example that show's how to do what I want to
> do.
> > > > >
> > > > > I have a web page with a Save button on it. When the user presses
> the
> > > > Save
> > > > > button I want to execute some javascript which calculates a value
> and
> > > > then
> > > > > I want the value to be sent to the server where I store the value
> in
> > a
> > > > > database. Then I want a label to appear on the webpage that says
> the
> > > data
> > > > > has been saved.
> > > > >
> > > > > I am new to Wicket and I am using Wicket 1.4. How should I do this?
> > Is
> > > > > there an example of something like this?
> > > > >
> > > > > Thanks
> > > > > Nick Mudge
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Martin Grigorov
> > > > jWeekend
> > > > Training, Consulting, Development
> > > > http://jWeekend.com 
> > > >
> > >
> >
> >
> >
> > --
> > Martin Grigorov
> > jWeekend
> > Training, Consulting, Development
> > http://jWeekend.com 
> >
>



-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ 


Re: Sending Data via Javascript and AJAX

2013-03-06 Thread Nick Mudge
Hi,
Where is the example?

Nick


On Wed, Mar 6, 2013 at 8:32 AM, Martin Grigorov wrote:

> On Wed, Mar 6, 2013 at 6:24 PM, Nick Mudge  wrote:
>
> > Hi,
> > Why would I look at the AjaxEditableLabel? According to the javadoc for
> it,
> >
>
> To see an example how this is done there.
>
>
> > it is for: "An implementation of ajaxified edit-in-place component using
> a
> > TextField as it's editor."
> > I am not doing that.
> >
> > What I need is a Save button that executes some javascript to calculate
> > some data that is then sent the server via AJAX.  Then I need to update a
> > label on the webpage saying that the data has been saved.
> >
> > How can I do this?
> >
> > Thanks
> > Nick
> >
> >
> >
> >
> > On Wed, Mar 6, 2013 at 12:34 AM, Martin Grigorov  > >wrote:
> >
> > > Hi,
> > >
> > > Take a look at AjaxEditableLabel, it sends a parameter named "save".
> > > This is improved a lot in Wicket 6.
> > >
> > >
> > > On Wed, Mar 6, 2013 at 3:28 AM, Nick Mudge  wrote:
> > >
> > > > I could not find an example that show's how to do what I want to do.
> > > >
> > > > I have a web page with a Save button on it. When the user presses the
> > > Save
> > > > button I want to execute some javascript which calculates a value and
> > > then
> > > > I want the value to be sent to the server where I store the value in
> a
> > > > database. Then I want a label to appear on the webpage that says the
> > data
> > > > has been saved.
> > > >
> > > > I am new to Wicket and I am using Wicket 1.4. How should I do this?
> Is
> > > > there an example of something like this?
> > > >
> > > > Thanks
> > > > Nick Mudge
> > > >
> > >
> > >
> > >
> > > --
> > > Martin Grigorov
> > > jWeekend
> > > Training, Consulting, Development
> > > http://jWeekend.com 
> > >
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com 
>


Re: JS and CSS package references

2013-03-06 Thread Martin Grigorov
On Wed, Mar 6, 2013 at 6:51 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Hi,
>
> On Wed, Mar 6, 2013 at 5:44 PM, Entropy  wrote:
>
> > That's exactly what i am doing.  Notice the comment marks /* and */
> around
> > the package stuff.  I tried it both ways.  And "this" in this case is
> > ExtGrid.java.  So I am also sending in that class.
> >
>
> I think the URLs are telling you this.getClass() !=  ExtGrid.class. Can you
> paste whole panel code?
>

Exactly!
Note the '$1' in the class name. This means the class is an anonymous class
in ExtGrid.
Just use ExtGrid.class instead of this.getClass()


>
> >
> > So I have to pre-register these resources in some way or something?  Note
> > that ExtGrid is a panel not a page, so the resources aren't in the same
> > pacakge as the page.  Would that matter?
> >
> >
> No, it should not matter.
>
>
> >
> >
> > --
> > View this message in context:
> >
> http://apache-wicket.1842946.n4.nabble.com/JS-and-CSS-package-references-tp4657034p4657038.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
> >
> >
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
> Antilia Soft
> http://antiliasoft.com/ 
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com 


Re: JS and CSS package references

2013-03-06 Thread Ernesto Reinaldo Barreiro
Hi,

On Wed, Mar 6, 2013 at 5:44 PM, Entropy  wrote:

> That's exactly what i am doing.  Notice the comment marks /* and */ around
> the package stuff.  I tried it both ways.  And "this" in this case is
> ExtGrid.java.  So I am also sending in that class.
>

I think the URLs are telling you this.getClass() !=  ExtGrid.class. Can you
paste whole panel code?

>
> So I have to pre-register these resources in some way or something?  Note
> that ExtGrid is a panel not a page, so the resources aren't in the same
> pacakge as the page.  Would that matter?
>
>
No, it should not matter.


>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/JS-and-CSS-package-references-tp4657034p4657038.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
>
>


-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ 


Re: JS and CSS package references

2013-03-06 Thread Entropy
That's exactly what i am doing.  Notice the comment marks /* and */ around
the package stuff.  I tried it both ways.  And "this" in this case is
ExtGrid.java.  So I am also sending in that class.

So I have to pre-register these resources in some way or something?  Note
that ExtGrid is a panel not a page, so the resources aren't in the same
pacakge as the page.  Would that matter?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/JS-and-CSS-package-references-tp4657034p4657038.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: Sending Data via Javascript and AJAX

2013-03-06 Thread Martin Grigorov
On Wed, Mar 6, 2013 at 6:24 PM, Nick Mudge  wrote:

> Hi,
> Why would I look at the AjaxEditableLabel? According to the javadoc for it,
>

To see an example how this is done there.


> it is for: "An implementation of ajaxified edit-in-place component using a
> TextField as it's editor."
> I am not doing that.
>
> What I need is a Save button that executes some javascript to calculate
> some data that is then sent the server via AJAX.  Then I need to update a
> label on the webpage saying that the data has been saved.
>
> How can I do this?
>
> Thanks
> Nick
>
>
>
>
> On Wed, Mar 6, 2013 at 12:34 AM, Martin Grigorov  >wrote:
>
> > Hi,
> >
> > Take a look at AjaxEditableLabel, it sends a parameter named "save".
> > This is improved a lot in Wicket 6.
> >
> >
> > On Wed, Mar 6, 2013 at 3:28 AM, Nick Mudge  wrote:
> >
> > > I could not find an example that show's how to do what I want to do.
> > >
> > > I have a web page with a Save button on it. When the user presses the
> > Save
> > > button I want to execute some javascript which calculates a value and
> > then
> > > I want the value to be sent to the server where I store the value in a
> > > database. Then I want a label to appear on the webpage that says the
> data
> > > has been saved.
> > >
> > > I am new to Wicket and I am using Wicket 1.4. How should I do this? Is
> > > there an example of something like this?
> > >
> > > Thanks
> > > Nick Mudge
> > >
> >
> >
> >
> > --
> > Martin Grigorov
> > jWeekend
> > Training, Consulting, Development
> > http://jWeekend.com 
> >
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com 


Re: Sending Data via Javascript and AJAX

2013-03-06 Thread Nick Mudge
Hi,
Why would I look at the AjaxEditableLabel? According to the javadoc for it,
it is for: "An implementation of ajaxified edit-in-place component using a
TextField as it's editor."
I am not doing that.

What I need is a Save button that executes some javascript to calculate
some data that is then sent the server via AJAX.  Then I need to update a
label on the webpage saying that the data has been saved.

How can I do this?

Thanks
Nick




On Wed, Mar 6, 2013 at 12:34 AM, Martin Grigorov wrote:

> Hi,
>
> Take a look at AjaxEditableLabel, it sends a parameter named "save".
> This is improved a lot in Wicket 6.
>
>
> On Wed, Mar 6, 2013 at 3:28 AM, Nick Mudge  wrote:
>
> > I could not find an example that show's how to do what I want to do.
> >
> > I have a web page with a Save button on it. When the user presses the
> Save
> > button I want to execute some javascript which calculates a value and
> then
> > I want the value to be sent to the server where I store the value in a
> > database. Then I want a label to appear on the webpage that says the data
> > has been saved.
> >
> > I am new to Wicket and I am using Wicket 1.4. How should I do this? Is
> > there an example of something like this?
> >
> > Thanks
> > Nick Mudge
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com 
>


JS and CSS package references

2013-03-06 Thread Entropy
So I am trying to do the package resource reference thing.
https://cwiki.apache.org/WICKET/adding-javascript-or-css-using-a-resource.html
https://cwiki.apache.org/WICKET/including-css-resources.html

However, I am clearly not doing it right.  The URLs rendered look like:


Re: RepeatingView and FormComponentPanels

2013-03-06 Thread Martin Grigorov
Hi,

You can use wicket:for attribute:
[label text]




On Wed, Mar 6, 2013 at 5:10 PM, Lucio Crusca  wrote:

> I've created three subclasses of FormComponentPanel, e.g.
> TextFormComponentPanel, CheckBoxFormComponentPanel and
> DropDownChoiceFormComponentPanel. They all share some markup logic in that
> they all have an enclosing  and a  for the text to use as
> label.
> However each class has its own markup file, because each one needs a
> different
>  or  instead. Here is for example
> TextFormComponentPanel  markup:
>
> 
>wicket:id="inputSpan">[label text]
>  />
> 
>
>
> Then I created a FormComponentPanel derived class that uses a
> RepeatingView, and expects its derived classes to fill in the RepeatingView
> with instances of the three classes above. Those derived classes are the
> detail forms corresponding to my domain model beans.
>
> The problem is that TextFormComponentPanel, CheckBoxFormComponentPanel and
> DropDownChoiceFormComponentPanel html markup have fixed IDs for the input
> tags
> (I mean html id attributes, the ones referenced by  That's
> the recipe for a mess, because I end up with multiple html elements that
> have
> the same html id.
>
> I googled around and found AutoLabelResolver and AutoLabelTextResolver. I
> suspect those classes could help me, because they generate dynamic html
> IDs,
> but I failed to find an example that shows me how to use them. While it's
> clear
> to me how the markup should look, I can't get the java side.
>
> Any help?
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com 


RepeatingView and FormComponentPanels

2013-03-06 Thread Lucio Crusca
I've created three subclasses of FormComponentPanel, e.g. 
TextFormComponentPanel, CheckBoxFormComponentPanel and 
DropDownChoiceFormComponentPanel. They all share some markup logic in that 
they all have an enclosing  and a  for the text to use as label. 
However each class has its own markup file, because each one needs a different 
 or  instead. Here is for example 
TextFormComponentPanel  markup:


  [label text]




Then I created a FormComponentPanel derived class that uses a 
RepeatingView, and expects its derived classes to fill in the RepeatingView 
with instances of the three classes above. Those derived classes are the 
detail forms corresponding to my domain model beans.

The problem is that TextFormComponentPanel, CheckBoxFormComponentPanel and 
DropDownChoiceFormComponentPanel html markup have fixed IDs for the input tags 
(I mean html id attributes, the ones referenced by 

Re: Ajax indicator - display delay

2013-03-06 Thread Ernesto Reinaldo Barreiro
Maybe you can monkey patch wicketHide and wicketShow? Make some assumption
that indicator id start as "ind_" and then do an special "delayed" show for
those DOM elements/

On Wed, Mar 6, 2013 at 2:11 PM, Daniel Stoch  wrote:

> Hi all,
>
> When there is some AJAX activity on page we can show ajax indicator
> (using AjaxIndicatorAppender and implementing IAjaxIndicatorAware).
> My problem is that I want to show such indicator only when ajax
> request takes longer than specified amount of time (eg. > 1 second).
> But inside a AbstractDefaultAjaxBehavior (1.4.x) such indicator is
> shown immediately when request is processed. Is there any solution to
> delay displaying indicator (something like AjaxCallThrottlingDecorator
> but not for ajax beahvior but for ajax indicator itself)?
>
> --
> Best regards,
> Daniel
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ 


Ajax indicator - display delay

2013-03-06 Thread Daniel Stoch
Hi all,

When there is some AJAX activity on page we can show ajax indicator
(using AjaxIndicatorAppender and implementing IAjaxIndicatorAware).
My problem is that I want to show such indicator only when ajax
request takes longer than specified amount of time (eg. > 1 second).
But inside a AbstractDefaultAjaxBehavior (1.4.x) such indicator is
shown immediately when request is processed. Is there any solution to
delay displaying indicator (something like AjaxCallThrottlingDecorator
but not for ajax beahvior but for ajax indicator itself)?

--
Best regards,
Daniel

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: ThreadLocal with ajax

2013-03-06 Thread Nick Pratt
How are you ensuring that the thread that created the page is the same one
that's used to service the AJAX call?

N
On Mar 6, 2013 6:37 AM, "Ann Baert"  wrote:

> Hi,
>
> I have a springbean with a ThreadLocal property. On the page (constructor
> and onBeforeRenderer) I set a value to that ThreadLocal property. When I do
> the get of that property after an ajax call, the value is null.
>
> I made a quickstart to simulate the problem. I print the ThreadLocal value
> on the page (correct) and
> after call on the ajaxlink the value is null.
> Does anyone know a solution for this?
>
> ThreadLocalTest.zip
> <
> http://apache-wicket.1842946.n4.nabble.com/file/n4657018/ThreadLocalTest.zip
> >
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/ThreadLocal-with-ajax-tp4657018.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: using static fileds in a page

2013-03-06 Thread Martin Grigorov
If you create an ExecutorService then you should shutdown it too.
See org.apache.wicket.Application#getApplicationListeners &
org.apache.wicket.IApplicationListener#onBeforeDestroyed
or org.apache.wicket.Application#onDestroy


On Wed, Mar 6, 2013 at 2:32 PM, fachhoch  wrote:

> My proxy executes  my service  call in  a thread for which I ma uisng
> google
> Guava com.google.common.util.concurrent.SimpleTimeLimiter
>
> this uses   Executors.newCachedThreadPool() ,  if I want to restart my
> server   do I have to worry about all these threadsnot stopping or any
> issue with this ?
>
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/using-static-fileds-in-a-page-tp4657021p4657024.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 


Re: using static fileds in a page

2013-03-06 Thread Martin Grigorov
Hi,

Since it is static it wont be (de)serialized at all.
But it will be used by *all* instances of this page. Is this OK for your
case ?


On Wed, Mar 6, 2013 at 2:10 PM, fachhoch  wrote:

> to run my lengthy  operation, my pages needs, I am using a static filed
> which
> is a proxy  of my service in the page class itself, on ahjaxevent I use
> this
> proxy to get my data, this proxy times out based on configration to avoid
> wicket  freezing for lengthy operation.
>
> Is it advised to have static field in page? Its not instance data so will
> they be serialized ?
> Please clarify will this cause issues  with   page serialization and
> denationalization?
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/using-static-fileds-in-a-page-tp4657021.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 


using static fileds in a page

2013-03-06 Thread fachhoch
to run my lengthy  operation, my pages needs, I am using a static filed which
is a proxy  of my service in the page class itself, on ahjaxevent I use this
proxy to get my data, this proxy times out based on configration to avoid
wicket  freezing for lengthy operation.

Is it advised to have static field in page? Its not instance data so will
they be serialized ?
Please clarify will this cause issues  with   page serialization and
denationalization?




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/using-static-fileds-in-a-page-tp4657021.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: ThreadLocal with ajax

2013-03-06 Thread Martin Grigorov
Hi,

Why do you use ThreadLocal ?
Each http request is handled by a random thread from the web container's
thread pool.
You should store that value in the session if you want it to be available
in the next request.


On Wed, Mar 6, 2013 at 1:36 PM, Ann Baert  wrote:

> Hi,
>
> I have a springbean with a ThreadLocal property. On the page (constructor
> and onBeforeRenderer) I set a value to that ThreadLocal property. When I do
> the get of that property after an ajax call, the value is null.
>
> I made a quickstart to simulate the problem. I print the ThreadLocal value
> on the page (correct) and
> after call on the ajaxlink the value is null.
> Does anyone know a solution for this?
>
> ThreadLocalTest.zip
> <
> http://apache-wicket.1842946.n4.nabble.com/file/n4657018/ThreadLocalTest.zip
> >
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/ThreadLocal-with-ajax-tp4657018.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 


ThreadLocal with ajax

2013-03-06 Thread Ann Baert
Hi,

I have a springbean with a ThreadLocal property. On the page (constructor
and onBeforeRenderer) I set a value to that ThreadLocal property. When I do
the get of that property after an ajax call, the value is null.

I made a quickstart to simulate the problem. I print the ThreadLocal value
on the page (correct) and
after call on the ajaxlink the value is null.
Does anyone know a solution for this?

ThreadLocalTest.zip
  



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ThreadLocal-with-ajax-tp4657018.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: Sending Data via Javascript and AJAX

2013-03-06 Thread Martin Grigorov
Hi,

Take a look at AjaxEditableLabel, it sends a parameter named "save".
This is improved a lot in Wicket 6.


On Wed, Mar 6, 2013 at 3:28 AM, Nick Mudge  wrote:

> I could not find an example that show's how to do what I want to do.
>
> I have a web page with a Save button on it. When the user presses the Save
> button I want to execute some javascript which calculates a value and then
> I want the value to be sent to the server where I store the value in a
> database. Then I want a label to appear on the webpage that says the data
> has been saved.
>
> I am new to Wicket and I am using Wicket 1.4. How should I do this? Is
> there an example of something like this?
>
> Thanks
> Nick Mudge
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com