Re: IndicatingAjaxButton onSubmit seems missing when deployed

2017-08-24 Thread sorinev
As it turns out, someone did modify this page, but it was earlier this year
and not recently. This button is part of a row in a table, so each row has
its own version of this button, and obviously the button is supposed to act
on the data specific to that row. Well, they added a setMarkupId() to this
button and this killed it because then every button in the table had the
same ID. I'll have to keep a weather eye on this sort of thing going forward
unless there's someway to config / force an error any time such an instance
happens.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/IndicatingAjaxButton-onSubmit-seems-missing-when-deployed-tp4678598p4678599.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



IndicatingAjaxButton onSubmit seems missing when deployed

2017-08-24 Thread sorinev
I really don't know what to make of this. Hopefully I'm missing something
simple.

I'm using NetBeans to attach a debugging session to my wicket (1.4.17)
application deployed on Wildfly. NetBeans keeps telling me that there is no
executable code located at that line when I try to submit a breakpoint to a
line inside my onSubmit() button (in fact, EVERY line inside the onSubmit
method says this). Normally this would be a case of source being out of sync
with what's deployed, but I've triple checked and confirmed they're in sync.

What's even weirder is that the lines right before and right after the line
that adds my button and its onSubmit override attach and are hit just fine.
There is even a bit of javascript attached to the button through
AttributeModifier that does fire off properly (ok/cancel window). The button
even responds to being enabled, disabled, hidden, shown, etc. I also have a
log statement at the very beginning of both onSubmit and onError, and
neither one of them prints. It really does seem like the onSubmit method is
literally missing when deployed. Im looking through the source control and I
don't see any recent changes.

I'm really not sure what to do at this point.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/IndicatingAjaxButton-onSubmit-seems-missing-when-deployed-tp4678598.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: DiskDataStore error

2017-08-24 Thread Lon Varscsak
Hey Martin, yeah the file is owned by me and it’s a file not a directory.
I upgraded to M7 and I don’t seem to get the error anymore.

-Lon

On Wed, Aug 23, 2017 at 11:11 PM, Martin Grigorov 
wrote:

> Hi,
>
> The same error can happen if the Tomcat/Jetty process doesn't have
> permissions to read/write this file.
> Check that this file is owned by the Tomcat user and that it is a file, not
> a directory.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Thu, Aug 24, 2017 at 1:38 AM, Lon Varscsak 
> wrote:
>
> > As always, I forgot to include the version. :)* 8.0.0-M6*
> >
> > On Wed, Aug 23, 2017 at 2:58 PM, Lon Varscsak 
> > wrote:
> >
> > > Hey guys, I’m getting this error on an app (on my dev/Mac machine):
> > >
> > > java.io.FileNotFoundException: /var/folders/3g/
> > > vcn2yyls05q249yzkbp457qmgn/T/wicket-filestore/8289/6329/
> > > 1rjb8e27m1orf1mnxttof0qy22/data (No such file or directory)
> > >
> > > at java.io.RandomAccessFile.open0(Native Method)
> > >
> > > at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
> > >
> > > at java.io.RandomAccessFile.(RandomAccessFile.java:243)
> > >
> > > at org.apache.wicket.pageStore.DiskDataStore$SessionEntry.
> > getFileChannel(
> > > DiskDataStore.java:432)
> > >
> > > at org.apache.wicket.pageStore.DiskDataStore$SessionEntry.savePage(
> > > DiskDataStore.java:350)
> > >
> > > at org.apache.wicket.pageStore.DiskDataStore.storeData(DiskDa
> > > taStore.java:188)
> > >
> > > at org.apache.wicket.pageStore.AsynchronousDataStore$
> > > PageSavingRunnable.run(AsynchronousDataStore.java:340)
> > >
> > > at java.lang.Thread.run(Thread.java:745)
> > >
> > >
> > > That file does exist which means it must be locked, but I don’t know
> why
> > I
> > > would be getting this error.  I’m not really sure what I’d be doing in
> > this
> > > application to trigger this error.  Thoughts?
> > >
> > > Thanks!
> > >
> > > -Lon
> > >
> >
>


Re: Validation messages from properties file not working.

2017-08-24 Thread Entropy
That's perfect.  Thanks so much.


Brian Mulholland
"For every complex problem, there is an answer that is clear, simple and
wrong."
--H.L. Mencken
"Politics is the art of looking for trouble, finding it everywhere,
diagnosing it incorrectly, and applying the wrong remedies."
--Groucho Marx

On Wed, Aug 23, 2017 at 3:56 PM, Sven Meier [via Apache Wicket] <
ml+s1842946n4678590...@n4.nabble.com> wrote:

> Hi,
>
> FormComponent has a special error() method for ValidationErrors.
>
> You're hitting another method on Component, that just accepts any
> serializable:
>
>  ((WebMarkupContainer) form.get("wmcCaptchaError")).error(new
> ValidationError().addKey("CaptchaRequired"));
>
> Try the following instead:
>
>  ((WebMarkupContainer)
> form.get("wmcCaptchaError")).error(form.getString("CaptchaRequired"));
>
> Regards
> Sven
>
>
> Am 23.08.2017 um 19:18 schrieb Entropy:
>
> > Yeah, it's definitely related to the component that the
> > ComponentFeedbackPanel relates to.  If I use a TextField, it finds the
> > message perfectly.  I change it to a web markup container or
> hiddenfield,
> > and it fails to find the message.  Same name, same code doing the
> validation
> > and the adding of the validation key.
> >
> > I tried a TextField with visibility set to false and that didn't even
> show
> > the error (which makes sense).
> >
> > --
> > View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Validation-messages-from-properties-file-
> not-working-tp4678575p4678588.html
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > -
> > To unsubscribe, e-mail: [hidden email]
> 
> > For additional commands, e-mail: [hidden email]
> 
> >
>
>
> -
> To unsubscribe, e-mail: [hidden email]
> 
> For additional commands, e-mail: [hidden email]
> 
>
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-wicket.1842946.n4.nabble.com/Validation-
> messages-from-properties-file-not-working-tp4678575p4678590.html
> To unsubscribe from Validation messages from properties file not working., 
> click
> here
> 
> .
> NAML
> 
>


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Validation-messages-from-properties-file-not-working-tp4678575p4678596.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: FileUploadField with AJAX Behavior

2017-08-24 Thread Rob Audenaerde
I use this home brew Behavior:

import java.io.File;

import org.apache.wicket.Component;
import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
import org.apache.wicket.request.cycle.RequestCycle;
import org.apache.wicket.request.http.WebRequest;
import org.apache.wicket.util.string.StringValue;

public abstract class FileSelectedBehavior extends
AbstractDefaultAjaxBehavior
{
public static final String FILE_SELECTED_REQUEST_PARAMETER_NAME = "val";

@Override
public void respond( AjaxRequestTarget target )
{
// get the web request
RequestCycle cycle = RequestCycle.get();
WebRequest webRequest = (WebRequest) cycle.getRequest();

// get the parameter
StringValue term = webRequest.getQueryParameters().getParameterValue(
FILE_SELECTED_REQUEST_PARAMETER_NAME );

// term contains full (fake) path
File file = new File( term.toString() );

// process the parameter
this.processRequest( target, file.getName() );
}

/**
* This method will be called when a file is selected.
*
* @param target
* @param fileName will contain the filename with extension (without path)
*/
public abstract void processRequest( AjaxRequestTarget target, String
fileName );

@Override
public void renderHead( Component component, IHeaderResponse response )
{
// after selecting a file the onRequest of this class is called
String script = "document.getElementById('" + component.getMarkupId() +
"').onchange = function () {  Wicket.Ajax.get({ 'u' : \""
+ this.getCallbackUrl() + "\", 'ep' : {'" +
FILE_SELECTED_REQUEST_PARAMETER_NAME + "' : this.value } });};";

// add the javascript
response.render( OnDomReadyHeaderItem.forScript( script ) );
}
}

On Thu, Aug 24, 2017 at 9:57 AM, lucast  wrote:

> I had the same requirement,I wanted to display the contents of the file,
> once
> the file has been selected.
> I found the code on
> https://github.com/apache/openmeetings/blob/4a5e859f886253086e51a2ac26bbc5
> 01d621e590/openmeetings-web/src/main/java/org/apache/
> openmeetings/web/common/UploadableImagePanel.java
>  4a5e859f886253086e51a2ac26bbc501d621e590/openmeetings-web/
> src/main/java/org/apache/openmeetings/web/common/UploadableImagePanel.java
> >
> , line 77, new AjaxFormSubmitBehavior(form, "change") to be extremely
> helpful and just what I was looking for.
>
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/FileUploadField-with-AJAX-Behavior-tp4677874p4678594.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: FileUploadField with AJAX Behavior

2017-08-24 Thread lucast
I had the same requirement,I wanted to display the contents of the file, once
the file has been selected.
I found the code on 
https://github.com/apache/openmeetings/blob/4a5e859f886253086e51a2ac26bbc501d621e590/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/UploadableImagePanel.java

 
, line 77, new AjaxFormSubmitBehavior(form, "change") to be extremely
helpful and just what I was looking for.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FileUploadField-with-AJAX-Behavior-tp4677874p4678594.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: DiskDataStore error

2017-08-24 Thread Martin Grigorov
Hi,

The same error can happen if the Tomcat/Jetty process doesn't have
permissions to read/write this file.
Check that this file is owned by the Tomcat user and that it is a file, not
a directory.

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

On Thu, Aug 24, 2017 at 1:38 AM, Lon Varscsak 
wrote:

> As always, I forgot to include the version. :)* 8.0.0-M6*
>
> On Wed, Aug 23, 2017 at 2:58 PM, Lon Varscsak 
> wrote:
>
> > Hey guys, I’m getting this error on an app (on my dev/Mac machine):
> >
> > java.io.FileNotFoundException: /var/folders/3g/
> > vcn2yyls05q249yzkbp457qmgn/T/wicket-filestore/8289/6329/
> > 1rjb8e27m1orf1mnxttof0qy22/data (No such file or directory)
> >
> > at java.io.RandomAccessFile.open0(Native Method)
> >
> > at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
> >
> > at java.io.RandomAccessFile.(RandomAccessFile.java:243)
> >
> > at org.apache.wicket.pageStore.DiskDataStore$SessionEntry.
> getFileChannel(
> > DiskDataStore.java:432)
> >
> > at org.apache.wicket.pageStore.DiskDataStore$SessionEntry.savePage(
> > DiskDataStore.java:350)
> >
> > at org.apache.wicket.pageStore.DiskDataStore.storeData(DiskDa
> > taStore.java:188)
> >
> > at org.apache.wicket.pageStore.AsynchronousDataStore$
> > PageSavingRunnable.run(AsynchronousDataStore.java:340)
> >
> > at java.lang.Thread.run(Thread.java:745)
> >
> >
> > That file does exist which means it must be locked, but I don’t know why
> I
> > would be getting this error.  I’m not really sure what I’d be doing in
> this
> > application to trigger this error.  Thoughts?
> >
> > Thanks!
> >
> > -Lon
> >
>