Re: Paths not serializable

2018-06-13 Thread sorinev
Perfect, that worked. What's the side effect of this vs the other way, if
any?

--
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



Paths not serializable

2018-06-13 Thread sorinev
I created a quickstart for this, but I imagine you're long since aware of it.
But, what am I supposed to do about sun.nio.fs.UnixPath throwing a
java.io.NotSerializableException (passed in to FileSystemResourceReference)?
The page still works, but the server log gets really nasty, really quick,
especially since I rely on FileSystemResourceReference extensively for a lot
of images being displayed on a central page of my site (I use the file
system for images, instead of my war file, because otherwise the war file
would be 300MB and harder to maintain).

--
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: Debugging options

2018-06-07 Thread sorinev
Ok, so I found out what it appears to be. My full code for the DropDownChoice
I'm setting up is this:

selectedAccountDropdown = new DropDownChoice("selectedAccount", new
PropertyModel(this, "selectedAccount"), accountList, new
ChoiceRenderer("name", "id"));
selectedAccountDropdown.add(new AjaxFormComponentUpdatingBehavior("change")
{
@Override
protected void onError(AjaxRequestTarget target, RuntimeException e) {
if (e != null) {
LOG.error(e, e);
error(e);
} else {
LOG.error("Exception null, see feedback on page.");
}
error("Page may not have been updated");
target.add(feedbackPanel);
}

@Override
protected void onUpdate(AjaxRequestTarget target) {
//[code here]
}

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
attributes.getAjaxCallListeners().add(new AjaxCallListener()

.onBefore("$('#selectedAccount').prop('disabled',true);")

.onComplete("$('#selectedAccount').prop('disabled',false);"));
}
});
selectedAccountDropdown.setMarkupId("selectedAccount");
selectedAccountDropdown.setNullValid(false);
selectedAccountDropdown.setRequired(true);
baseForm.add(selectedAccountDropdown);

When I comment out the updateAjaxAttributes method, everything works as
expected. If I add it back in, my model object becomes null again when
changing. So, I'm obviously doing that the wrong way. What is the proper way
to achieve what I'm doing on the updateAjaxAttributes override? What I need
to do is disable the dropdown *while* the dropdown is being updated because
there's code that runs that needs to be allowed to finish. I obviously can't
disable/enable the component inside the onUpdate method because those won't
take effect until after onUpdate finishes. Which, clearly, is useless. Hence
the Ajax bits.

--
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: Debugging options

2018-06-07 Thread sorinev
It seems like nothing in that class is being called when I change the
selection in the DropDownChoice.

I'm setting it up like this:

new DropDownChoice("account", new PropertyModel(this, "selectedAccount"),
accountList, new ChoiceRenderer("name", "id"));

But I've tried several other ways too, such as a CompoundPropertyModel
straight, a CompoundPropertyModel with bind(), putting the selectedAccount
object not in "this" ("this" is the page itself, derived from Wicket
WebPage), but in an normal object, etc. and it always results in
selectedAccount being null. But like I said, this same thing works in a
quickstart, so I'm baffled.

--
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: Debugging options

2018-06-07 Thread sorinev
I don't have an equals method for the class, and most of the classes I've
come across in our code that are being used in Wicket components don't. Is a
class supposed to? How does it work otherwise? Bit-by-bit comparison by the
JVM?

Anyhow, yeah debugging is what I've been doing but I've been getting
nowhere. I was wondering what I can zero in on in the Wicket sources that
might help me debug why setting up the dropdown is perfectly fine, as is
setting the initial value when the page is constructed, but why changing is
always null.

--
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



Debugging options

2018-06-06 Thread sorinev
I have some code that's not working like it should, and like it does in other
projects. I made a quickstart, but it works there. What other debugging
options do I have besides plain Java debugging (short of sharing my repo
with a maintainer / expert, which I'm 100% open to)?

I have a DropDownChoice with a PropertyModel. The dropdown is set up
initially just fine. But any changes to the selection result in the property
object being null and I can't for the life of me figure out why. I've
included the wicket sources in my debugger and have poked around in there,
but can't see anything obvious to my untrained eye. I use this same pattern
in lots of other files in different projects, but for some reason it's just
not working here, so I'm obviously missing something, but can't figure out
what.

Wicket 7.11.

--
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: iframe on migration from 1.4.17 to 7.10.0

2018-05-11 Thread sorinev
Thanks, that was basically it, though I had to prefix with "/myApp/" instead.
Is there a way to set this globally somewhere through Wicket itself, rather
than making sure all my strings have that prefixed?

--
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: iframe on migration from 1.4.17 to 7.10.0

2018-05-11 Thread sorinev
It's different for each page, but it returns a string that corresponds to the
path in the "Help" folder to find the help page associated with the current
page. The AtrributeModifier then replaces the src attribute of the help
iframe so that when clicked, it slides up the help page relevant to the
current application page. So if you are on a page to add a new device, then
getHelpPath() would return a string like "Help/Device/add.html", which is a
path that is relative to the root of the application war folder. So
{war-root}/Help/Device/add.html. Except that with Wicket 7, extra things are
getting added to the url.

So in 1.4.17, the src link would be "Help/Device/add.html", and then a
mousover of the link shows the full url is the application root,
https://ip/myApp"; added together with the current src string, so
https://ip/myApp/Help/Device/add.html.

However, in 7.10.0, the part of the url that comes before the help path
string now has things added to it. Some times it's wicket and sometimes it's
bookmarkable. So, https://ip/myApp/*wicket/*Help/Device/add.html or
https://ip/myApp/*wicket/bookmarkable/*Help/Device/add.html.

I'm not sure where that's coming from.

--
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



iframe on migration from 1.4.17 to 7.10.0

2018-05-11 Thread sorinev
FYI: I did not write the original code; I'm just updating it.

We have an application on 1.4.17 that we are /finally/ updating to 7 (like
I've been saying is necessary for the last 3 years, but now a client wants
us to do it and suddenly it's urgent...) and have things mostly sorted out.
One of the few remaining issues is some iframe functionality that we have.
As a part of our base page (which all pages extend) we have a link in the
bottom right that, when clicked, slides open an iframe with content in it
specific to the current page. It looks like this in the 1.4.17 version:

Java:
WebMarkupContainer help_src = new WebMarkupContainer("help_src");
help_src.add(new SimpleAttributeModifier("src", getHelpLinkPath()));
add(help_src);

HTML:

Help



When viewing the source of the page and looking at the generated URL in the
src of the iframe, it looks like this:

https://ip/myApp/Help/Admin/index.html

When clicked, it shows the content of the pointed-to page.

Now, after fixing the build errors for the 7.10.0 upgrade, the Java and HTML
look the same, save for the update for the way AttributeModifier works (not
important here). Now however, the URL looks like this:

https://ip/myApp/wicket/Help/Admin/index.html

When clicked, the frame is empty and the source pointed to is just a
[browser?] generated error page.

Notice the addition of the "/wicket/" bit in the URL. We haven't done any
page mounting in the entry point (WicketApplication.java class). Where is
this coming from? If I simply add a "wicket" folder to the root of our .war
and move the "Help" directory there, it works. But isn't the "wicket" folder
a temporary thing generated upon running? Or is it not, and there's just
something in our code related to the 7.10.0 update indirectly causing that
to get added to the URL?

--
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: Force Model to use getter

2017-12-01 Thread sorinev
I added a setter for each property, but it's still not working (tried
matching field types as well). I guess I'll just have to stick with the
IModel route, even though I don't like it.

I changed the Doubles to BigDecimal, thanks for the reminder.

--
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



Force Model to use getter

2017-12-01 Thread sorinev
Wicket 7.9.0.

I have a Java double that is linked to a Wicket Label. This double
represents a dollar amount, so I want to work with it as a double for math
purposes. When I display it on the page however, I want it to a be a
currency formatted String.

I figured I would just add a getter to my page for that property, with a
return type of String (and do the appropriate actions there). So for a
member variable called 'amount' of type Double, I have a getter as 'private
String getAmount()'. It's not working though, it still gets the value
directly from the property itself when displaying on the page (and seems to
get displayed as an int, at that).

I was using CompoundPropertyModel at first, then after something i read on 
StackOverflow
 
, I changed it to a PropertyModel, but it's still not working. Does the
return type of the getter have to match the type of the variable, even if
the getter method has the appropriate name otherwise? I am currently going
with the method shown in the second answer by Andreas on that StackOverflow
question, but I'd rather it be done automatically through PropertyModel or
CompoundPropertyModel because it looks a lot cleaner.

--
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: 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: Attach ajax/javascript to CheckBox, v1.4

2017-05-25 Thread sorinev
I've tried adding an AjaxEventBehavior to the regular CheckBox and to the
AjaxCheckBox. I tried a few different things, the latest one is this:

fooCheckBox.add(new AjaxEventBehavior("onbefore"){
@Override
protected IAjaxCallDecorator getAjaxCallDecorator(){
return new IAjaxCallDecorator(){
public CharSequence decorateScript(CharSequence
script) {
return "$('#button1').prop('disabled',true);"
+ "$('#button2').prop('disabled',true);"
+ script;
}

public CharSequence
decorateOnSuccessScript(CharSequence script) {
return script;
}

public CharSequence
decorateOnFailureScript(CharSequence script) {
return script;
}

};
}

And a similar one for oncomplete. There doesn't seem to really be much
inside the AjaxCheckBox itself, unlike some of the other Ajax components
that have a ton of things that can be overridden (including an internal
getAjaxCallDecorator. There's basically just the one onUpdate method and
that's it.

I am very light on front end knowledge and sometimes wicket is hard to find
non-api-doc info for. It's really hard to find good information for what to
do in specific situations. So I may be going about this the wrong way, but
like I said, I tried a few other things I found I just don't remember
specifically what they were.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Attach-ajax-javascript-to-CheckBox-v1-4-tp4677930p4677932.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



Attach ajax/javascript to CheckBox, v1.4

2017-05-24 Thread sorinev
I have a version 7.x application where I have an Ajax component that I add
some javascript to via this method:

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes
attributes) {
super.updateAjaxAttributes(attributes);
attributes.getAjaxCallListeners().add(new AjaxCallListener()
.onBefore("$('#button1').prop('disabled',true);"
+ "$('#button2').prop('disabled',true);")
.onComplete("$('#button1').prop('disabled',false);"
+ "$('#button2').prop('disabled',false);"));
}

Now, I have a v1.4.17 app that I need to do the same thing to, but it's
going to be on a CheckBox (I could do AjaxCheckBox if necessary). I've tried
the various solutions I've googled, but to no avail. When the checkbox is
checked, some code runs. While that code runs, I need two buttons to be
disabled (doing it via the AjaxRequestTarget obviously won't work). When the
CheckBox's onUpdate code finishes running, the buttons can be enabled again.

This app is stuck on 1.4.17 for the foreseeable future and that's outside of
my hands.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Attach-ajax-javascript-to-CheckBox-v1-4-tp4677930.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: 7.3 : javascript attached to extended AjaxButton

2016-10-20 Thread sorinev
1. We extend AjaxButton.
2. In renderHead(), we do a JavaScriptReferenceHeaderItem with a
JavaScriptResourceReference that has a javascript file that is local to our
class.
3. Inside the javascript file there is a yahoo widget panel that does this:
panel.setBody(" <\"images/ajax-loader.gif\"> ").

So it appears to be resolved relative to the page. I've tried many different
ways to load an image, but they mostly seem to rely on manually adding a
html tag in the file and giving it a wicket:id, but this image is not loaded
in the standard wicket component way.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/7-3-javascript-attached-to-extended-AjaxButton-tp4675692p4675858.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



7.3 : javascript attached to extended AjaxButton

2016-10-06 Thread sorinev
We are upgrading from 1.4.17 to 7.3. A handful of runtime issues remain now
that all the build errors are fixed. One of them is in regards to the
AjaxButton, which we extended.

In 1.4.17 this was the class



The relevant javascript file is



After upgrading to 7.3, the update class, to fix build errors and most
runtime problems is



After upgrading to 7.3 the class now looks like this to fix build errors and
all but the runtime error at hand (so far)



When a page with this button is loaded, this stack dump appears.



Putting a break point in the debugger in the wicket classes shows that it's
treating the images folder in the deployment as a class to be loaded :
"wicket", "bookmarkable", "images", "ajax-loader.gif". ajax-loader.gif is a
file referenced by the javascript file that is attached to the button. It is
located in the images folder of the war deployment
(webapp/images/ajax-loader.gif).

This all worked just fine in 1.4.17, but something seems to be different in
7.3 in regards to this such that I've missed something when updating our
extended AjaxButton class to this version.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/7-3-javascript-attached-to-extended-AjaxButton-tp4675692.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: Unexpected Invocation of #onSubmit()

2016-10-05 Thread sorinev
Well it's still the same issue; the button does /function/ now, it's just not
entirely right. The button has its own javascript file and something in this
file is causing an exception in wicket when the button is loaded on a page.
There is a gif associated with this button, but something is different from
1.4.17 vs 7.3 (probably started in 6) that means I need to load the images
folder (or the specific image file) somehow to make the stack dump stop when
a page is loaded that has the button on it.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unexpected-Invocation-of-onSubmit-tp4675637p4675673.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: Unexpected Invocation of #onSubmit()

2016-10-05 Thread sorinev
I resolved the button not working issue. I had to change the package
reference statements to JavaScriptReferenceHeaderItem instead of just
JavaScriptHeaderItem and I had to put the four statements to load these
references in the right order, it seems.

New problem though is that one of those javascript files has a reference to
a .gif image. This image is in the images folder with all of the other
images that the application uses and loads properly. This gif however does
not. We have not had to load or reference this image directly or the folder
it's in before, but I guess now with version 7 (coming from 1.4.17) we do
because I get this exception:



I put a break point at
org.apache.wicket.application.AbstractClassResolver.resolveClass line 101.
Walking back along the callstack to
org.apache.wicket.core.request.mapper.BookmarkableMapper shows a string
array called "segments" with four elements showing as "wicket",
"bookmarkable", "images", "img.gif".

I'm not sure where's it getting the bookmarkable bit from, but it's just a
gif in the image folder that a method in the javascript file wants to load.

How can I get rid of this exception properly?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unexpected-Invocation-of-onSubmit-tp4675637p4675663.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: Unexpected Invocation of #onSubmit()

2016-10-05 Thread sorinev
It seems that no matter what I put in 

JavaScriptHeaderItem.forUrl();

it does not get added to the page when I look at it through the browser
inspector. I tried simply the file name, I've tried a path relative to the
webapp folder (i.e. ./src/main/webapp/) and it just does not want to get
added. In 1.4.17 this was done with the PackageResourceReference that took
the filename (no path) and OurAjaxButton.class for the scope.

Here is the set up now with 7.3:

We extend AjaxButton, let's just call it OurAjaxButton. It is in
com/ourcom/wicket/ (so ~/projectdir/src/main/java/com/ourcom/wicket/).



I also tried doing "../java/com/ourcom/wicket/OurAjaxButton.js" as the
string. I also tried copying the js files into the js folder in webapp and
doing "js/OurAjaxButton.js" and none of this works. I also tried these three
versions of the filename inside an onInitialize() override and inside a
renderHead() override.

In all cases the browser inspector doesn't show the js files I'm adding as
being on the page (in the  section at least), the console shows the
functions in our js file as not existing, and I still get those same
unexpected invocation log messages.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unexpected-Invocation-of-onSubmit-tp4675637p4675661.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



Unexpected Invocation of #onSubmit()

2016-10-03 Thread sorinev
I'm in the middle of upgrading from 1.4.17 to 7.3 and one of many issues is
with the AjaxButton class that we extended. We provided three constructors
(id and form; id; id and model), an init function common to all three, and
an override of getAjaxCallDecorator().

Init function did a few
add(JavascriptPackageResource.getHeaderContribution(new
ResourceReference(OurAJaxButton.class, "filename.js")). 

The override for getAjaxCallDecorator had a new IAjaxCallDecorator as a
parameter that had inplace overridesw for decorateScript,
decorateOnFailureScript, and decorateOnSuccessScript.

As near as I can tell, the replacement for the javascript stuff was
JavaScriptHeaderItem.forUrl("filename.js").

The replacement for the ajax decorator bit seems to have been 



The strings inside there correspond, to the three decorate functions above,
except since they were actual method overrides, they did the js string + the
paramater (a CharSequence).


So that's all that was changed to get rid of the build errors. The actual
usage of the button hasn't changed. We just do in-place overrides for
onError(AjaxRequestTarget, Form) and onSubmit(AjaxRequestTarget, Form).
Nothing here had to change. We also have defaultFormProcessing false because
this is a cancel button. But for some reason, wicket prints the following
messages to the log and the onSubmit(AjaxRequestTarget, Form) override is
never entered.



We neither call these methods directly, nor are they overridden, so I'm not
sure what's going on here.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unexpected-Invocation-of-onSubmit-tp4675637.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: Migration from 1.4.17 to 7.3

2016-10-03 Thread sorinev
Since the previous way of doing it was never referenced, I figured I'd
comment the new way out and see what happened. It works like it should. So I
guess the previous class extension and overriding must have been something
that was tried and later abandoned but not deleted.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Migration-from-1-4-17-to-7-3-tp4675615p4675636.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: Migration from 1.4.17 to 7.3

2016-10-03 Thread sorinev
Regarding #4, how do I redirect it to my https url then? The 1.4.17 class we
extended built a new https url and set it on a response. This new method
appears, yes, to do nothing. When I go to my login url now or try to type
the https url for the login page directly, i stay on http and port 80 (port
not show of course, but either way I'm not at 8443).

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Migration-from-1-4-17-to-7-3-tp4675615p4675633.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



Migration from 1.4.17 to 7.3

2016-09-30 Thread sorinev
I'm updating the web portion of our server application from ancient 1.4.17 to
shiny new 7.3. There are about 225 files and I've gotten through a lot of
them (mass find/replace, woo hoo) but I've hit a few snags that are not only
difficult to find information on in regards to upgrade, but that I don't
know a whole lot about.


= 1 =


I know compressedresourcereference was removed, but I'm not sure what to
replace the code with. For example, in one file there are these two lines:



in the class member declaration area, and



in the constructor. What do these two lines get replaced with?


= 2 =


We extend a few AJAX components. Two of them have this, which I'm not
entirely sure how to replace since I'm very inexperienced in front end
stuff.



Same goes for extending AjaxLink.

We also have a timer that extends  and has this:



Which is missing from the superclass now, so I'm not sure how to update it.

Also, renderHead of AbstractDefaultAjaxBehavior seems to have changed a bit;
it now takes a Component, which I'm not sure what to do with since it didn't
exist in the older version. This specific extension of
AbstractDefaultAjaxBehavior was for a javascript item, so at the end of
renderHead it had



Which does not exist anymore, it's just render(HeaderItem header) now, so
I'm not sure how to update this. The first string was actual javascript and
the second appears to have been an id.


= 3 =


The "Resource" stuff doesn't seem to exist anymore, which we extended to
make a couple of new classes, so I'm not sure what to do with these. They
extended DynamicWebResource and WebResource, and in their methods there are
references to classes like Resource and ResourceState. Their major function
seems to relate to setting a filename on an AttachmentHeader. There are
several instances where we have a HashMap whose value is one of these
extended DynamicWebResource / WebResource classes.


= 4 =


We had a class that extended WebRequestCycleProcessor and its sole function
was to extend "respond(RequestCycle)" in order to build the proper url to
redirect http pages to https pages that required SSL. I did not see any
references to this class either in the java code or in any text file (config
files, for example), so I'm not sure if it was in use or not. But in any
case, the replacement seems to be just adding this to the init() method of
our AuthenticatedWebApplication class?




Really appreciate any help with all this stuff, thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Migration-from-1-4-17-to-7-3-tp4675615.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: Link - open modal on left click, new tab/window on right-click/context

2016-07-27 Thread sorinev
Changing the href worked. But it opens the page on both a left click and a
right click -> new tab. This may be related to the second part having no
effect (stopping the propagation), which may in turn be related to the third
part. Since I don't really know javascript, I'm not sure what needs to go
there. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Link-open-modal-on-left-click-new-tab-window-on-right-click-context-tp4675216p4675227.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



Link - open modal on left click, new tab/window on right-click/context

2016-07-26 Thread sorinev
I have an AjaxLink on my page. 



and the modal side of it is:



And this works just fine. When I click the link, a wicket modal window opens
with the content of that modal being loaded from an external url.

However, a request has been made to change the functionality slightly. When
left clicking, the behavior should remain as is, but when right clicking on
the link and choosing open in a new tab or window, it should open a new
tab/window with that external url instead of popping up the modal. I've
googled around and haven't found a way to do this.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Link-open-modal-on-left-click-new-tab-window-on-right-click-context-tp4675216.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: AjaxIndicatingButton

2015-12-04 Thread sorinev
I gave that a shot but it didn't seem to work. It still did the disabling
after onSubmit() returned. I'm not going to worry about it at this point, I
just thought it'd be better to do it. 

Thanks for your assistance mihir. 


mihir wrote
> You could something like below:
> 
>final AjaxButton testButton1 = new AjaxButton("test1"){
> 
> /**
> *
> */
>private static final long serialVersionUID = 1L;
> 
>@Override
> protected void onSubmit(AjaxRequestTarget target, Form
> form)
> {
> 
>  target.appendJavascript("document.getElementById('tb2').disabled=true;");
> 
>  target.appendJavascript("document.getElementById('tb3').disabled=true;");
> }
> };
> 
> testButton1.setMarkupId("tb1");
> testButton1.setOutputMarkupId(true);
> 
> final Button testButton2 = new Button("test2");
> testButton2.setMarkupId("tb2");
> testButton2.setOutputMarkupId(true);
> 
> final Button testButton3 = new Button("test3");
> testButton3.setMarkupId("tb3");
> testButton3.setOutputMarkupId(true);
> 
> Thanks,
> -Mihir.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxIndicatingButton-tp4672874p4672879.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: AjaxIndicatingButton

2015-12-04 Thread sorinev
Yes, it's Wicket 1.4.17. I've thought about migrating it to one of the more
recent versions. But with 41k lines of java across 225 files just in the
Wicket portion of our enterprise application, it'll be a major pain to
migrate considering there were several enormous changes to certain
components/functionality that we use a lot. Believe me, it does kill me that
we are on a version that is so old. 

As for the disabling thing, more specifically I wanted to be able to do
something like this:

protected void onSubmit(AjaxRequestTarget target, Form form){
this.setEnabled(false);
//disable button 2 here
//disable button 3 here

//do a bunch of stuff here

//enable button 3 here
//enable button 2 here
this.setEnabled(true);
}

Meaning, I'd like the effect to happen immediately, without having to do
target.addComponent() and without having to wait for onSubmit() to return
(since it would be pointless to disable and re-enable after I've already
finished the work). Basically, the user needs to not be able to use any
other buttons while some other button's code is busy in onSubmit().
mihir wrote
> Hi,
> 
> As you have mentioned target.addComponent(comp), it seems you are using
> Wicket 1.4. Just so that it might be helpful to you; Wicket 1.4 is no
> longer supported - does not mean that you won't get answers from forum but
> there won't be any release for 1.4 version (I am writing this based upon
> online Wicket version status - so please take it as suggestion).
> 
> If I am understanding it correctly, all you want is disable two other
> buttons on submit of 'this' button. And as by design; Wicket needs the
> component to be added for ajax change via target.addComponent. Which
> should
> take effect immediately.
> 
> I might be wrong in my suggestion as your scenario needs more details for
> better understanding.
> 
> -Mihir.
> 
> On Fri, Dec 4, 2015 at 3:28 PM, sorinev <

> sorinev@

> > wrote:
> 
>> I have a dialog with 3 AjaxIndicatingButtons on it. When I override
>> onSubmit(), I can disable the 'this' component in real time
>> (this.setEnabled(false)), but traditionally, any other component that
>> gets
>> modified has to do target.addComponent(comp) and then wait for the
>> onSubmit() to return in order for it to take effect.
>>
>> However, I really need to have all three buttons be disabled immediately
>> if
>> *any* button is actively inside it's onSubmit() function (being
>> re-enabled
>> when the function returns is ok). Is this possible?
>>
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/AjaxIndicatingButton-tp4672874.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> -
>> To unsubscribe, e-mail: 

> users-unsubscribe@.apache

>> For additional commands, e-mail: 

> users-help@.apache

>>
>>



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxIndicatingButton-tp4672874p4672877.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



AjaxIndicatingButton

2015-12-04 Thread sorinev
I have a dialog with 3 AjaxIndicatingButtons on it. When I override
onSubmit(), I can disable the 'this' component in real time
(this.setEnabled(false)), but traditionally, any other component that gets
modified has to do target.addComponent(comp) and then wait for the
onSubmit() to return in order for it to take effect.

However, I really need to have all three buttons be disabled immediately if
*any* button is actively inside it's onSubmit() function (being re-enabled
when the function returns is ok). Is this possible? 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxIndicatingButton-tp4672874.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



CompoundPropertyModel: override method or catch exception

2015-06-16 Thread sorinev
To go with my  other thread

  
about the same form page, I have an issue with the CompoundPropertyModel.
There is a TextField in a form on this page, and the corresponding setter in
the model can throw an exception. When it does, wicket crashes the page. It
seems that it's using reflection by grabbing the name of the component on
the page, and looking for a setter for that component in the model
automatically behind the scenes.

What I need to have happen is either I can somehow override that method
through the CompoundPropertyModel, or just catch exceptions from the model
in general, or maybe some other mechanism. In any case, what I need is to be
able to cleanly reset things on the page in the case of an exception rather
than the page crashing altogether. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CompoundPropertyModel-override-method-or-catch-exception-tp4671205.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: TextField -> AjaxEventBehavior-onBlur -> onEvent

2015-06-16 Thread sorinev
False alarm, I had some kinks to work out. It works great now, thanks for
your help with this, I appreciate it. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TextField-AjaxEventBehavior-onBlur-onEvent-tp4671150p4671204.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: TextField -> AjaxEventBehavior-onBlur -> onEvent

2015-06-16 Thread sorinev
How would I accomplish that? I've tried

this  https://cwiki.apache.org/confluence/display/WICKET/Markup+inheritance
  

and this 
https://cwiki.apache.org/confluence/display/WICKET/Adding+Javascript+or+CSS+using+a+Resource

  

and neither is working. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TextField-AjaxEventBehavior-onBlur-onEvent-tp4671150p4671203.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: TextField -> AjaxEventBehavior-onBlur -> onEvent

2015-06-16 Thread sorinev
I don't have the code at hand this very moment, but it goes something like
this. 

The TextField above the table does the onblur like:

tf.add(new AjaxEventBehavior("onBlur", {override onEvent here along with a
target.addComponent(table)} ...

Then for the table, there is a DataView with a populate item. In populate
item, those TextFields get setup like:

item.add(new SimpleAttributeModifier("onfocus", "this.select(); return
true;");



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TextField-AjaxEventBehavior-onBlur-onEvent-tp4671150p4671194.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: TextField -> AjaxEventBehavior-onBlur -> onEvent

2015-06-15 Thread sorinev
I decoupled the submit buttons from the table, which was easy on the Java
side but a HUGE pain on the HTML side. However, I now have a new problem
(well it always existed, but it's next on the agenda). 

This form has a TextField and a table. The table has some rows on it, and
each row has a couple of TextFields on it. Each of the TextFields on the
table has a SimpleAttributeModifier that, upon focus, highlights the
contents of the box. 

BUT, the TextField at the top of the form has an onBlur set to it. This
means that when you click away from the TextField at the top, and into one
of the tables TextFields, the contents of the table TextField will briefly
flash blue (highlighted), but then a split second after that the contents
are no longer highlighted and the cursor is at the beginning of the
TextField. This seems to obviously be because in the main TextField's
onblur, the table is added (no getting around that in this case). So the
table TextField's onfocus is basically nullified as a result. Also, it seems
that the onfocus of the table TextField fires before the main TextField's
onblur, which kills the one idea I had (grab the row and textfield IDs on
the onfocus, then in the onblur, after adding the table, set the focus
back). 

So how can I keep the content of the TextField that's clicked into
highlighted even after that TextField is added back onto the page via
another component's onblur? 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TextField-AjaxEventBehavior-onBlur-onEvent-tp4671150p4671174.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



TextField -> AjaxEventBehavior-onBlur -> onEvent

2015-06-12 Thread sorinev
Wicket v1.4.17

I have a Form with a TextField and, among other things, two submit buttons.
One is a typical submit button, the other is a submit button that acts as a
cancel (closes stuff out and goes to the previous page). 

This TextField has an AjaxEventBehavior of onBlur added to it, and inside
that behavior, onEvent is overridden. onEvent does some validation of the
TextField's contents and dynamically updates some stuff on the page.
Meaning, when the TextField loses focus, it's going to immediately update a
table on the page. 

The problem, however, is that the TextField has DefaultFocusBehavior on it
as well so that when you first visit the page, the TextField already has
focus. So upon first visiting the page, if you try to click either of the
submit buttons (well, the "cancel" submit button really, because the other
submit button is disabled until the TextField gets input), you have to click
it twice before it activates. The first click does nothing, i.e., the
onSubmit method doesn't fire.

This appears to be caused by the onBlur/onEvent deal, because clicking the
button means the TextField has lost focus, but it somehow results in that
click not registering. 

Of course, commenting out the DefaultFocusBehavior line makes everything
work fine since the TextField doesn't have focus on the first visit to the
page, but since having focus on the TextField is our desired behavior, is
there a way to make this work? 

Between NetBeans code completion in source and messing around in the
debugger, I couldn't see a way to find out which component, if any, was
clicked in order to trigger the onBlur/onEvent. That would be easy because I
could see if it was the cancel button, and if so, I could trigger it's
onSubmit (if that's actually even possible). I also didn't see any methods
available to any component while inside the onEvent method that would help
me get this working right. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TextField-AjaxEventBehavior-onBlur-onEvent-tp4671150.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



Override automatic default Form style

2014-07-15 Thread sorinev
   

I have a page with a form on it, created by:

/Form addContactForm = new Form("AddContactForm", new
CompoundPropertyModel(contact));/

and it automatically inserts this crazy hidden styling:

//

I want the input boxes to all be aligned with each other instead of looking
all crooked like they do in the picture. No amount of styling (that my
limited knowledge has tried) in my css file can fix it. In fact, it just
gets a lot worse. Is there a way to override the hidden default styling, or
is there a way to at least align my input boxes?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Override-automatic-default-Form-style-tp417.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: item.getModelObject() result "cannot be cast to"

2014-07-14 Thread sorinev
I found a way to do it. I just had to change the line from 

/List contactList = session.createSQLQuery("select * from
wicket.contacts").list();/

to

/List contactList = session.createSQLQuery("select * from
wicket.contacts").addEntity(Contact.class).list();/

meaning the only thing that changed was adding addEntity(Contact.class) in
between the query call and the list call. Thanks for your clear and speedy
replies.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/item-getModelObject-result-cannot-be-cast-to-tp4666598p404.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: item.getModelObject() result "cannot be cast to"

2014-07-14 Thread sorinev
Ok, that was simple enough (running in Jetty for debug purposes). It shows
the objects as:

/contactList = {java.util.ArrayList@3397} size = 4/

and then each element in the list is shown as

/java.lang.Object/

So I guess I need to get some converting going on for the list and/or it's
elements. How do I go about doing that? 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/item-getModelObject-result-cannot-be-cast-to-tp4666598p402.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: item.getModelObject() result "cannot be cast to"

2014-07-14 Thread sorinev
I'm not even sure HOW to get into a debuggable environment. The wicket
framework and whole environment is so bizzare and unfamiliar, i'm not sure
how (it took me 2 days to get the environment set up to even begin
programming). I current develop it in IntelliJ IDEA. When I'm ready, I hit
rebuild project. I then open a terminal (Kubuntu 14.04) in the root of the
project folder and run it by typing /mvn tomcat:run/. In this case, how
would I get debug going? 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/item-getModelObject-result-cannot-be-cast-to-tp4666598p400.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



item.getModelObject() result "cannot be cast to"

2014-07-14 Thread sorinev
I'm using the Wicket Quickstart (latest as of yesterday) as a base and I'm
trying to do a very simple loop through data I've grabbed from a database
(Hibernate, MySQL, no Spring). I'm following the various DataView, ListView,
etc examples to the letter and every time I restart the server and reload
the page, I get:

 /Last cause: [Ljava.lang.Object; cannot be cast to com.cfm.Contact/

This is referring to this line:

 /final Contact thisContact = (Contact)item.getModelObject();/

I have WicketApplication.java, HomePage.html, HomePage.java,
HibernateUtil.java, and Contact.java all under /src/main/java/com.cfm

Contact is declared as 

 /public class Contact implements java.io.Serializable {/

and just has some basic string fields with getters and setters.

The relevant part of HomePage.java is:

/List contactList = session.createSQLQuery("select * from
wicket.contacts").list();
final DataView dv = new DataView("AllContacts", new
ListDataProvider(contactList)){
public void populateItem(final Item item){
final Contact thisContact = (Contact)item.getModelObject();
item.add(new Label("Id", thisContact.getId()));
}
};

add(dv);
/
and it dies at the final Contact thisContact line. I have no idea what's
going on. All of the examples I've found through Google all show it
happening in this exact way. I've tried about three different methods of
looping through the data (it's really hard to find how to loop through
database data in wicket...) and it all comes to the same result (even if I
leave the /(Contact)/ part off). 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/item-getModelObject-result-cannot-be-cast-to-tp4666598.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