Re: Wicket in Italy

2009-09-29 Thread Emanuele Gesuato

Padova :)


Paolo Di Tommaso wrote:

Roma (~)


On Thu, Sep 24, 2009 at 8:46 AM, francesco dicarlo
evilsephir...@gmail.comwrote:


Hi, i've just worked on a project with wicket for a software house in Bari.

But now i'm in Rome.

Hope to see you in an event XD

2009/9/24 Luca Provenzani eufor...@gmail.com








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



Pageable FormComponent

2009-07-16 Thread Emanuele Gesuato

Hi there,

I've got an extension of a FormComponent that basically show a list of 
data (an element for row) with three buttons for permitting the crud 
operation (new, modify and delete).


This component can show only a list of static data (ArrayList) and it 
isn't a DataTable but now i would like to use a dataprovider for lazy 
loading the rows. What is the best way on getting it done ? Is it more 
convenient to do another (ex-novo) component ?


Obviously i would like to mantain the load of static data (it's a 
component quite used) AND dynamic data.


Here is the full code of the component (unfortunately the comments are 
in italian):

http://pastebin.com/m6ef959a8


Thanks,
Emanuele


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



Re: Submit form with ajax on enter

2009-06-30 Thread Emanuele Gesuato

Why not using AjaxFormSubmitBehavior ?

vineet semwal wrote:

you can use AjaxButton,AjaxFallbackButton,IndicatingAjaxButton.

regards,
Vineet Semwal

On Thu, Jun 25, 2009 at 9:47 AM, John Patterson jdpatter...@gmail.comwrote:


Hi, I have a single text box which I wan to be submitted by ajax when
either the enter key is pressed or a submit button clicked.  Is there an
easy way to submit the form or just the input when the return key is hit?

Thanks,

John

-
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 and downloading huge pdf files

2009-03-02 Thread Emanuele Gesuato
Only want to know if an url similar to:

http://www.myweb.com/.../depliant.pdf

with a pdf file (or similar) as suffix is possible to create in wicket.


On Fri, 2009-02-27 at 10:13 +0100, Emanuele Gesuato wrote:
 Hi there,
 
 We have several huge pdf files with many pages (an hundred or so) and we
 would like to do a lazy loading of the pdf file when the user click to
 download it. Right now, when the user click for some pdf we return to
 the browser a resource stream with mime type application/pdf in which
 we load the file as a byte array output stream.
 
 But in this way the file is returned entirely to the user. In some web
 site they use an url with the the pdf file embedded to it (example:
 http://.../file.pdf); in this way the pdf client (adobe reader or
 similar) could lazy load the pages of the document.
 
 But is it a correct approach ? Is it possibile to implement something
 similar using a custom UrlCodingStrategy ?
 
 Thanks,
 Emanuele Gesuato 
 
 
 
 -
 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



Wicket and downloading huge pdf files

2009-02-27 Thread Emanuele Gesuato
Hi there,

We have several huge pdf files with many pages (an hundred or so) and we
would like to do a lazy loading of the pdf file when the user click to
download it. Right now, when the user click for some pdf we return to
the browser a resource stream with mime type application/pdf in which
we load the file as a byte array output stream.

But in this way the file is returned entirely to the user. In some web
site they use an url with the the pdf file embedded to it (example:
http://.../file.pdf); in this way the pdf client (adobe reader or
similar) could lazy load the pages of the document.

But is it a correct approach ? Is it possibile to implement something
similar using a custom UrlCodingStrategy ?

Thanks,
Emanuele Gesuato 



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



Tooltip on IE7

2009-01-22 Thread Emanuele Gesuato
Hello,

I'm using a tooltip as described here:

http://cwiki.apache.org/WICKET/how-to-add-tooltips.html

and it works fine on Firefox 3.0.5.

But on Internet Explorer 7 i've got a strange behaviour when i try to
add the tooltip on a td element: the tooltip is displayed but after the
label there is a string with null value.

For instance if i set the label Hello World on a td element i've got
on the tooltip the text Hello World null (with null that is in a new
line).

Any clue ? The html is rendered fine with no null string.

I'm using wicket 1.3.4.

Thanks,
Emanuele



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



Re: Wicket presentation at JUGPadova

2009-01-22 Thread Emanuele Gesuato
Ehr someone not anyone :)


On Wed, 2009-01-21 at 22:46 +0100, Emanuele Gesuato wrote:
  Maybe anyone could find it useful.

 
 
 -
 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



Wicket presentation at JUGPadova

2009-01-21 Thread Emanuele Gesuato
Just to let you know that i've made a presentation about apache wicket 
1.3 at our local Java User Group here in Italy (Padova, near Venice).


The presentation is a video and it hasn't a good quality additionally it 
is in italian :( Maybe anyone could find it useful.
It was intended to be a quick introduction to wicket through two 
existing projects.


The link is here:
http://www.archive.org/details/JUGPD45_Wicket_Gesuato

The video was made by our estimateed jug leader (Lucio Benfante) and it 
is released using a Creative Commons license (all information in the link).



Bye,
Emanuele



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



Re: Wicket/Eclipse/Maven/m2eclipse - HTML files not refreshing

2009-01-16 Thread Emanuele Gesuato
I've the same problem in one project but we are not using maven, instead
of it we use ant. For starting/stopping tomcat inside eclipse we use
wtp.

In development mode we could change the java file but not the html. I've
tried to remove the *.html to Filtered resources in
java-compiler-building but without any luck. It doesn't work as
expected and the html file is not reloaded.

Also it seems that the reloading of the .class files is done by tomcat,
not by eclipse maybe i could try to remove the context autoreloading. 


On Thu, 2009-01-15 at 15:31 -0800, Tauren Mills wrote:
 Are there any wicket/eclipse/maven/m2eclipse users out there?  I'm
 trying to get my development environment working properly and need
 your help.
 
 Up until now, I've been developing WIcket applications in Eclipse and
 have not been using maven.  As long as my web.xml is set to
 development rather than deployment mode, changes I made to HTML files
 while debugging were immediately applied.
 
 Not anymore... I am now managing my projects with maven, having just
 added a pom file to my project.  I'm using the m2eclipse plugin in
 Eclipse and enabled dependency management on my project.
 Unfortunately, now my HTML file changes aren't being recognized any
 longer even with development mode turned on. I have to stop and start
 the app to see the HTML changes.
 
 My project's maven properties show these goals to invoke on resource
 changes:  process-resources resources:testResources.
 
 My pom includes:
 
 build
 sourceDirectorysrc/main/java/sourceDirectory
 testSourceDirectorysrc/test/java/testSourceDirectory
 resources
 resource
 filteringfalse/filtering
 directorysrc/main/resources/directory
 includes
 include**/include
 /includes
 /resource
 resource
 filteringfalse/filtering
 directorysrc/main/java/directory
 includes
 include**/include
 /includes
 excludes
 exclude**/*.java/exclude
 /excludes
 /resource
 /resources
 ...
 /build
 
 So, I'm wondering, does eclipse not think that a resource has been
 changed because the HTML files are within src/main/java instead of
 src/main/resources?  If I change my CSS files, which are in
 /src/main/webapp, the changes are reflected with a browser refresh.
 But if I change an HTML file, it is not.
 
 How do I configure this to work right?  Everything else seems to be
 working right, just not HTML refreshing.
 
 Thanks,
 Tauren
 
 -
 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



ModalWindow width as %

2009-01-09 Thread Emanuele Gesuato

Hi there,


In ModalWindow as defined in wicket-extension the width has a fixed 
length expressed in pixel (600px). I would like to have the width in % 
but the widthUnit is available only when the the component is not 
resizable.



In fact in ModalWindow.getWindowOpenJavascript() there is the following:

..
if (isResizable() == false)
{
buffer.append(settings.widthUnit=\ + getWidthUnit() + \;\n);
buffer.append(settings.heightUnit=\ + getHeightUnit() + \;\n);
}
...


How could i setting the width as % and mantain the resizability of the 
component ?


And why this behaviour is present ?


Thanks,
Emanuele


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



Re: ModalWindow width as %

2009-01-09 Thread Emanuele Gesuato

getWidthUnit() is not considered if the ModalWindow is resizable.

Nino Martinez wrote:

if getWidthUnit() arent final then override?

Emanuele Gesuato wrote:

Hi there,


In ModalWindow as defined in wicket-extension the width has a fixed 
length expressed in pixel (600px). I would like to have the width in 
% but the widthUnit is available only when the the component is not 
resizable.



In fact in ModalWindow.getWindowOpenJavascript() there is the following:

..
if (isResizable() == false)
{
buffer.append(settings.widthUnit=\ + getWidthUnit() + \;\n);
buffer.append(settings.heightUnit=\ + getHeightUnit() + \;\n);
}
...


How could i setting the width as % and mantain the resizability of 
the component ?


And why this behaviour is present ?


Thanks,
Emanuele


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




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





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



Re: Dojo 1.1 integration available from wicketstuff

2008-12-23 Thread Emanuele Gesuato

Stefan Fußenegger wrote:

There's now a little bit of documentation online:
http://wicketstuff.org/confluence/display/STUFFWIKI/wicketstuff-dojo-1.1

Cheers, Stefan



Hi,

First of all, good job.

Is there any plan to support the dojo context menu ?  :-)

We are using it but we've got several warnings with some deprecation 
calls on the html document in development that are quite annoying.
Also if i have different context menu in the same page and if these 
context menu has submenus, the submenus are sharing the same instance of 
the content component.


Example:
If i have menuA and menuB in two tables, tableA and tableB. If i right 
click on menuA or menuB in the java code i see that the referenced 
component is always on tableB. This only happens in the voices of the 
menu that are in a submenu.




Thanks for any help,
Emanuele


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



Adding images for sorting to HeadersToolbar

2008-12-19 Thread Emanuele Gesuato

Hi there,


We are using the default HeadersToolbar in an our customized DataTable, 
now we would like to add in every cell of the header two images (an up 
and down arrows) for helping the user sorting the table.


I think this is a common feature and i was wondering if there are some 
examples around.


Our context is that in the beginning either the images are displayed and 
once the user clicks on one of them, the other one have to disappear. It 
seems quite simple but i would like to see some examples around the net.



Thanks for any suggestion,
Emanuele


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



Re: treetable font and dimension

2008-12-19 Thread Emanuele Gesuato

francesco dicarlo wrote:

is it possible to decrease the width of the font of treetables?

and how is it done?

Francesco Dicarlo



how about using css ?


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



DOJO Debug messages written in the html document

2008-12-17 Thread Emanuele Gesuato

Hi all,


I began using DOJO Context Menu with wicket 1.3.4. I retrieved the 
component from the wicketstuff branch for wicket 1.3.x.


When i try to use it, i've got the following error printed (when using 
wicket in debug mode) on the html document itself and NOT in the ajax 
debug window:



DEBUG: DEPRECATED: dojo.widget.Manager.getImplementationName Could not 
locate widget implementation for panel in wicket.widget registered 
to namespace wicket. Developers must specify correct namespaces for 
all non-Dojo widgets -- will be removed in version: 0.5
DEBUG: dojo.widget.Parse: error:Error: Could not locate widget 
implementation for panel in wicket.widget registered to namespace 
wicket
DEBUG: DEPRECATED: dojo.widget.Manager.getImplementationName Could not 
locate widget implementation for panel in wicket.widget registered 
to namespace wicket. Developers must specify correct namespaces for 
all non-Dojo widgets -- will be removed in version: 0.5
DEBUG: dojo.widget.Parse: error:Error: Could not locate widget 
implementation for panel in wicket.widget registered to namespace 
wicket
DEBUG: DEPRECATED: dojo.widget.Manager.getImplementationName Could not 
locate widget implementation for panel in wicket.widget registered 
to namespace wicket. Developers must specify correct namespaces for 
all non-Dojo widgets -- will be removed in version: 0.5
DEBUG: dojo.widget.Parse: error:Error: Could not locate widget 
implementation for panel in wicket.widget registered to namespace 
wicket
DEBUG: DEPRECATED: dojo.widget.Manager.getImplementationName Could not 
locate widget implementation for border in wicket.widget registered 
to namespace wicket. Developers must specify correct namespaces for 
all non-Dojo widgets -- will be removed in version: 0.5
DEBUG: dojo.widget.Parse: error:Error: Could not locate widget 
implementation for border in wicket.widget registered to namespace 
wicket




I would like to have them printed to the ajax debug window or there is a 
 way to avoid them printed in the html document ?


I've got the error on Firefox 2.0.0.18 and Internet Explorer 7; in 
Firefox 3 i've got the error only one time, after refreshed the browser 
it never happened again.



The html and java are taken from the example of wicketstuff.
HTML:
...
body
wicket:extend
div wicket:id=container /
/wicket:extend
/body
...


JAVA:
...
DojoSimpleContainer container = new DojoSimpleContainer(container);
container.setHeight(500px);

DojoMenu menu = new DojoMenu(menu);
menu.addChild(new DojoMenuItem(about, About));
menu.addChild(new DojoMenuItem(edit, Edit));
container.add(new DojoContextualMenuBehavior(menu));

add(container);
...





I would like to have printed the error messages in the ajax debug window 
or found a way to resolve this deprecated messages or at least having 
them not printed at all.


Thanks for any help,
Emanuele






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



Re: DOJO Debug messages written in the html document

2008-12-17 Thread Emanuele Gesuato

Michael Sparer wrote:

I don't know how to redirect them to the Ajax Debug, but you could install
firebug and the debug messages will be caught there ... if you just want to
avoid the messages messing up your document.

regards,
Michael




So, this is why they aren't written on Firefox 3 :) ! Thanks !


Anyway, i would like to try the DOJO context menu from the trunk of 
wicketstuff but i haven't found it. Where is it ?

Is there a way to resolve these deprecated calls ?

Thanks


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



Re: Ajax response not completed

2008-12-16 Thread Emanuele Gesuato

Nino Saturnino Martinez Vazquez Wael wrote:
Beats me, seems like somethings wrong,maybe a bug..? I'd create a 
quickstart (really easy with maven,  
http://wicket.apache.org/quickstart.html ) and attach it to a jira issue..


If the code are somewhat working, and the only annoying thing are the 
mouse icon you could try to set the mouse icon manually..




Is it normal that the ajax response never get completed ? It remains in 
the Invoking pre-call handler(s); this is why the mouse remains in 
waiting state.


However, i've tried wicket 1.3.5 and problem remains.

I'm not very skilled with javascript but it seems that wicket has its 
own function to change the mouse pointer. How could i call them ? using 
AjaxRequestTarget.appendJavascript() ?


Thanks,
Emanuele




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



Re: Ajax response not completed

2008-12-15 Thread Emanuele Gesuato

Emanuele Gesuato wrote:

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



Here the code of the html and java part:

**html**
?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;

html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
titleJStore/title
/head
body

a href=# wicket:id=mylinkClick me/a

/body
/html





*** java ***
add(new AjaxFallbackLink(link){
@Override
public void onClick(AjaxRequestTarget target) {
PageParameters params = new PageParameters();
params.add(file, /home/eg/test.pdf);
params.add(type, application/pdf);

setResponsePage(FakePageForAjaxPrint.class, params);

}   
});


The other source code are available in the previous email.

I forgot to mention that i don't have any error on my browser (Firefox 
3.0.4). Javascript works fine but the mouse pointer still kepy busy.


I've just tried with firefox 2.0.0.18 but i've got the same problem.

The page i'm accessing is a bookmarkable page: could it be related ?



Thanks for any help,
Emanuele






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



Using YUI or DOJO for context menu ?

2008-12-15 Thread Emanuele Gesuato

Hi there,

I've seen two components for integrating a contextual menu in wicket: 
the yui and the dojo based.


Have you got experience in any of them ? What are the major differences ?

I'm just using the yui context menu, but i need to add an image on every 
MenuItem. It seems that this context menu doesn't have support for it: 
is it better to improve this component or passing to the dojo one (which 
seems to have this support).


I'm not very skilled with wicket and i need some help on how implmenting 
the image in the menuitem. I've seen that the MenuItem is not a 
Component and doesn't have an html counterpart. How could i change this 
component for adding this feature ?



Thanks for your help,
Emanuele


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



Re: Using ajax for generating a pdf

2008-12-14 Thread Emanuele Gesuato

Emanuele Gesuato ha scritto:





I forgot to mention i'm using the yui-context menu related to the wicket 
branch 1.3.0 of wicket-stuff. The ajax link i'm mentioning is just a 
menu item of the context menu that display a pdf.


Tomorrow i'll try to use a simple ajax link and let you know what happens :)


Any help would be appreciated,
Thanks,
Emanuele Gesuato

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



Using ajax for generating a pdf

2008-12-12 Thread Emanuele Gesuato

Hi there,

Reading previous posts i have discovered the existence of the yui 
context menu in wicket stuff that now i'm using in a project.


More specifically, i'm using wicket 1.3.4 with wicket-yui-core 1.3.0 
from the wicket 1.3.0 branch of wicketstuff.


I would like to do a non-ajax click in my context menu because i need to 
generate a pdf report and propose to the user the classic download 
window of the browser. Using ajax, the pdf is generated but the ajax 
response is empty and the user doesn't see anything.

This is my actual code in the MenuItem.onClick(AjaxRequestTarget, targetId):


IResourceStream stream = new ByteArrayResource(application/pdf, 
s.toByteArray()).getResourceStream();
		RequestCycle.get().setRequestTarget(new 
ResourceStreamRequestTarget(stream));		



With these lines if i do a normal submit the user could see the 
download window with the pdf generated. Using an ajax-click it doesn't work.


The YuiContextMenuBehaviour in the respond method calls the 
YuiContextMenu.onClick(AjaxRequestTarget, targetId). But in the 
YuiContextMenu there is a method onClick() which seems not called by 
anyone.


For me, it seems that the onClick() could resolve my issue (it doesn't 
use ajax) but i don't know why it is not called by anyone. Is it 
deprecated ?



Thanks,
Emanuele





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



Re: [OT] wicket users around the world

2008-12-12 Thread Emanuele Gesuato

Fabio Fioretti wrote:

Rome, Italy! :)

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




Padua (near Venice), Italy !


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



Ajax response not completed

2008-12-12 Thread Emanuele Gesuato

Hi there,

I'm sorry for sending two email the same day, but i've got a problem 
that is very strange for me. I'm using wicket 1.3.4 with the patch 
WICKET-1838 provided by Matej Knopp and i'm testing the page on firefox 
3.0.4.


When i click on an ajax link that generates a pdf, the file correctly 
shows to the user but the mouse is in waiting state and in the ajax 
debug window i've got ajax blocked in invoking pre-call handler.

Here the log:

INFO: Using XMLHttpRequest transport
INFO:
INFO: Initiating Ajax GET request on 
?wicket:interface=:3:table::IActivePageBehaviorListener:3:amp;wicket:ignoreIfNotActive=trueaction=StampatargetId=tablecontextMenuId=menurandom=0.7506497972643358

INFO: Invoking pre-call handler(s)...


When i click on the ajax link the following code is executed:
...

PageParameters params = new PageParameters();
params.add(file, /home/eg/test.pdf);
setResponsePage(FakePageForAjaxPrint.class, params);
...


The FakePageForAjaxPrint is an empty page mounted on a specific 
QueryStringUrlCodingStrategy that in the decode method does the following:



public IRequestTarget decode(RequestParameters requestParameters) {
	String filename = ((String[]) 
requestParameters.getParameters().get(file))[0];


final File file = new File(filename);
IResourceStream resourceStream = new FileResourceStream(file);

	ResourceStreamRequestTarget rsrt = new 
ResourceStreamRequestTarget(resourceStream) {

@Override
public String getFileName() {
return file.getName();
}
};
try {
resourceStream.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return rsrt;
}


So, when the link is clicked the pdf is showed in the download window of 
the browser, but the ajax is blocked in Invoking pre-call 
handler(s)... and the mouse pointer is in loading state.
I can click as many times i want in the ajax link and the pdf is always 
showed to the user.


How can i complete the ajax response ?


Sorry for the long email,
Thanks,
Emanuele



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



Re: FormTester.getTextComponentValue not equals with textfield

2008-09-25 Thread Emanuele Gesuato

Emanuele Gesuato wrote:

Hello,

I'm writing a testcase in which i try to compare the value of a 
textfield in a form with the value of a pojo.


This value is a BigDecimal.

This is the code:
FormTester ft = 
tester.newFormTester(GestisciListino.tags.pizzaForm.toString());
assertEquals(pizza.getPrezzo().toString(), 
ft.getTextComponentValue(Pizza.CAMPO_PREZZO));


if the BigDecimal is 5.00, 
ft.getTextComponentValue(Pizza.CAMPO_PREZZO) is 5, and the assertion 
fails. But if i try to use the form using the browser the value setted 
in the form is correctly 5.00. Why this difference ? I'm expecting 
that the value retrieved using ft.getTextComponentValue has to be equals 
with the value displayed by the browser. Am i missing something ?





Sorry, i forgot to mention i'm using wicket 1.3.4.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: reading a resource file

2008-09-22 Thread Emanuele Gesuato

eyalbenamram wrote:

Hi
I have a wicket application that is being deployed to tomcat using Eclipse
IDE.
I need to be able to read a .txt file from the application object. the
problem is
I cannot find where to put the txt file. I tried to put it everywhere in the
application, 
and under any directory in the tomact. 
for reading the file I used:


URL url = this.getServletContext().getResource(a.txt);

Please help
Thanks, Eyal.


Are you using maven ?

If yes you could put your a.txt in src/main/resources. It should work.


HTH,
Emanuele


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



FormTester.getTextComponentValue not equals with textfield

2008-09-22 Thread Emanuele Gesuato

Hello,

I'm writing a testcase in which i try to compare the value of a 
textfield in a form with the value of a pojo.


This value is a BigDecimal.

This is the code:
FormTester ft = 
tester.newFormTester(GestisciListino.tags.pizzaForm.toString());
assertEquals(pizza.getPrezzo().toString(), 
ft.getTextComponentValue(Pizza.CAMPO_PREZZO));


if the BigDecimal is 5.00, 
ft.getTextComponentValue(Pizza.CAMPO_PREZZO) is 5, and the assertion 
fails. But if i try to use the form using the browser the value setted 
in the form is correctly 5.00. Why this difference ? I'm expecting 
that the value retrieved using ft.getTextComponentValue has to be equals 
with the value displayed by the browser. Am i missing something ?



Thanks,
Emanuele

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket,tomcat and UTF-8

2008-08-29 Thread Emanuele Gesuato

Ray trace wrote:

ino its wierd

yes my browser says utf-8 .
the mysql  database is in utf-8.
hibernate is utf-8.

basically all is utf-8 except the incoming post data.arg.

property name=hibernate.connection.useUnicodetrue/property 
property name=hibernate.connection.characterEncodingUTF-8/property


database schema is created with utf-8  ...so that hibernate tools generate
the correct tables.
all though i dont think its hibernate causing the problems.



Have you tried using URIEncoding=UTF-8 in the connector tag of your 
tomcat server.xml ?


It should be similar to the following:

Connector port=8080 maxHttpHeaderSize=8192
   maxThreads=150 minSpareThreads=25 maxSpareThreads=75
   enableLookups=false redirectPort=8443 acceptCount=100
   connectionTimeout=2 disableUploadTimeout=true 			 
URIEncoding=UTF-8/



HTH,
Emanuele


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



testcase click button

2007-10-24 Thread Emanuele Gesuato

Hi there,

I'm writing a testcase but i don't know how to click in a type=button 
input component.


If i have a input type=submit .. / component i can click on it using 
something similar to:


FormTester form = tester.newFormTester(myformpath);
form.submit(mySubmitButtonId);

But using a input type=button / component form.submit doesn't work, 
the button is using an ajax call and the server-side method never get 
executed. How can i click on this button using a testcase ?


Thanks,
Emanuele

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Checking behaviour in testcase

2007-09-05 Thread Emanuele Gesuato

Hi there,

I'm trying to check the presence of a behaviour in a testcase.

I have a page with a checkbox and a button, if a user click on the 
button without selecting the checkbox, an alert box show a message. If i 
access to the page through a browser (firefox) the page runs fine and 
the alert box is correctly displayed. So, i would like to retrieve the 
behaviour from the form component after submitting the form itself, but 
i can't find any behaviour (the list is empty!).


Why ? Is there something wrong with the testcase ?

Here there are the testcase and the webpage (html and java).

Thanks,
Emanuele


Here is the Testcase:


public class TestSimplePage extends TestCase{

public void testSimplePage(){   
WicketTester tester = new WicketTester();

tester.startPage(SimplePage.class);

tester.submitForm(simpleForm);

		Form simpleForm = (Form) 
tester.getComponentFromLastRenderedPage(simpleForm);


assertNotNull(simpleForm.getBehaviors());
assertFalse(simpleForm.getBehaviors().isEmpty());
}
}

***



Here is the webpage:
***


public class SimplePage extends WebPage {
private static final long serialVersionUID = 8190084597165080916L;

public SimplePage(){
		CompoundPropertyModel simpleModel = new CompoundPropertyModel(new 
SimpleBean());

final Form form = new Form(simpleForm, simpleModel){

private static final long serialVersionUID = 
8176126527045127325L;

public void onSubmit(){ 
SimpleBean simple = (SimpleBean) 
getModelObject();
if (! simple.isSelected()){
add(new Alert(not selected));
}
}

};
form.add(new Button(btnok));
form.add(new CheckBox(selected));
add(form);
}

public class Alert extends AbstractBehavior {
private static final long serialVersionUID = 
3346789663630395006L;
private String msg;

public Alert(String msg) {
this.msg=msg;
}

@Override
public boolean isTemporary() {
return true;
}

@Override
public void renderHead(IHeaderResponse response) {
response.renderOnLoadJavascript(alert('+msg+'););
}

}

public class SimpleBean implements Serializable{

private static final long serialVersionUID = 
-2386033376652365201L;
private boolean selected;

public boolean isSelected() {
return selected;
}
public void setSelected(boolean selected) {
this.selected = selected;
}

}
}


and here the html page (only the form):

form name=simpleForm wicket:id=simpleForm
table
tr
TDbSelect/b/TD
td

input type=checkbox 
wicket:id=selected/td
/tr 
/table
br
input type=submit value=OK wicket:id=btnok
/form

***

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]