Generate excel spreadsheet

2008-04-25 Thread Bushby

Does anyone have example code for generating an excel spreadsheet.  I am
using Wicket 1.3 and I have used wicket.contrib.jasperreports to
successfully generate pdf files in IE but FireFox returns nothing. 
 Changing JRPdfResource to JRCsvResource returns a comma separated list but
the type it is returning is html for IE and nothing is showing up for
FireFox.  Using JRXlsResource returns nothing in IE or FireFox.

What I am attempting is to have a form submit the query criteria and return
a pdf or excel file.

Code to generate the file
final File reportFile = new File( context.getRealPath( "reports/test.pdf" )
);
return new JRPdfResource( reportFile ).setReportParameters( parameters
).setReportDataSource( customDataSource );

Code on the form
protected void onSubmit( AjaxRequestTarget target, Form form )
{
 JRResource pdfResource = new JasperReportUtility().generateReport();
 ReportsPanel.this.addOrReplace( new EmbeddedJRReport( "report",
pdfResource ).setOutputMarkupId( true ) );
 target.addComponent( ReportsPanel.this );
}

Thanks
Bushby
-- 
View this message in context: 
http://www.nabble.com/Generate-excel-spreadsheet-tp16898366p16898366.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: AutoCompleteTextField user selection

2008-02-26 Thread Bushby

I have a panel which is backed by an over all CompoundPropertyModel.  It has
an inner panel which is my search panel and Labels.  Here is the search
panel code.

public class SearchPatientPanel extends Panel
{
private static final long serialVersionUID = 8413569236371190758L;
private PatientAutoCompleteTextField patientAutoCompleteTextField;
private Label searchLabel;
public SearchPatientPanel( String id )
{
super( id );
setOutputMarkupId( true );
final ModalWindow addPatientWindow;
add( addPatientWindow = new ModalWindow( "addPatientWindow" ) );

searchLabel = new Label( "searchLabel", "Enter any part of the 
patient's
name." );
searchLabel.setOutputMarkupId( true );
searchLabel.setVisible( false );
add( searchLabel );

patientAutoCompleteTextField = new PatientAutoCompleteTextField(
"lastName", new PatientAutoCompleteTextRenderer(), addPatientWindow );
patientAutoCompleteTextField.setOutputMarkupId( true );
patientAutoCompleteTextField.setVisible( false );
add( patientAutoCompleteTextField );

add( new AjaxLink( "search" )
{
private static final long serialVersionUID = 
-6622359946182548552L;

@Override
public void onClick( AjaxRequestTarget target )
{

SearchPatientPanel.this.patientAutoCompleteTextField.setVisible( true
);

SearchPatientPanel.this.searchLabel.setVisible( true );
target.addComponent( 
SearchPatientPanel.this );
}

});
}

public void hideSearch()
{
patientAutoCompleteTextField.setVisible( false );
patientAutoCompleteTextField.setModel( new Model() );
searchLabel.setVisible( false );
}
}

The AutoCompleteTextField has an AjaxUpdatingBehavior.

this.add( new AjaxFormComponentUpdatingBehavior( "onchange" )
{ 

private static final long serialVersionUID = 1L; 

public void onUpdate( AjaxRequestTarget target )
{ 

String selectedPatient = getModelValue();
if( StringUtils.isNotEmpty( selectedPatient ) )
{
if( StringUtils.contains( selectedPatient, "New 
Patient" ) )
{
System.out.println( "user wants to 
create a new patient" );
addPatientWindow.show( target );
}
else
{
Patient patient = getPatient( 
selectedPatient ) );
target.addComponent( patientDataPanel );
hideSearch( target );
}
}

   
} 
});

I type a couple characters into the autocomplete and then select from the
list.  The first time the onChange event is fired, I get the input.  The
second time the event is fired I get the selected text.

Thanks
Mike


Martin Funk-3 wrote:
> 
> Hi Michal,
> 
> could you come up with some code?
> 
> mf
> 
> 2008/2/22, Bushby <[EMAIL PROTECTED]>:
>>
>>
>> I have an AutoCompleteTextField which searches for a person object.  When
>> a
>> person is selected from the auto complete, I want to update the panel and
>> the model with the person's information.  I have tried adding an
>> AjaxFormComponentUpdatingBehavior, but it gets called twice.  Once with
>> the
>> text entered by the user, and the second with the text from the auto
>> complete.  How do I capture just the selection event?
>>
>> Thanks
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/AutoCompleteTextField-user-selection-tp15634452p15634452.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECT

AutoCompleteTextField user selection

2008-02-22 Thread Bushby

I have an AutoCompleteTextField which searches for a person object.  When a
person is selected from the auto complete, I want to update the panel and
the model with the person’s information.  I have tried adding an
AjaxFormComponentUpdatingBehavior, but it gets called twice.  Once with the
text entered by the user, and the second with the text from the auto
complete.  How do I capture just the selection event?  

Thanks

-- 
View this message in context: 
http://www.nabble.com/AutoCompleteTextField-user-selection-tp15634452p15634452.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Implementation question of WebMarkupContainer

2007-10-18 Thread Bushby

I missed a piece of the functionality.  If the user were to select another
menu item, I need to replace the html.  So I could create a new label with
the new html, replace the label within the container, and then render the
container?

Thanks
Bushby


Martijn Dashorst wrote:
> 
> Use:
> 
> add(new Label("contents",
> contentsFromDatabase).setEscapeModelStrings(false)));
> 
> instead.
> 
> Martijn
> 
> On 10/18/07, Bushby <[EMAIL PROTECTED]> wrote:
>>
>> I have a use case where an admin manages html for the user side of an
>> application.  The html is stored in the database.  When the user selects
>> a
>> link from a menu the html is then pulled from the database and displayed.
>>
>> I have created a custom object extending WebMarkupContainer. I override
>> the
>> onComponentTagBody method to get the response object and write the html
>> to
>> the response.  Is this the correct way to do this?, meaning clean and
>> reusable, or should I be looking at creating a resource and adding it
>> with
>> the application object.
>>
>> Thanks
>> Bushby
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Implementation-question-of-WebMarkupContainer-tf4649417.html#a13282634
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> Buy Wicket in Action: http://manning.com/dashorst
> Apache Wicket 1.3.0-beta4 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta4/
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Implementation-question-of-WebMarkupContainer-tf4649417.html#a13283133
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Implementation question of WebMarkupContainer

2007-10-18 Thread Bushby

I have a use case where an admin manages html for the user side of an
application.  The html is stored in the database.  When the user selects a
link from a menu the html is then pulled from the database and displayed.

I have created a custom object extending WebMarkupContainer. I override the
onComponentTagBody method to get the response object and write the html to
the response.  Is this the correct way to do this?, meaning clean and
reusable, or should I be looking at creating a resource and adding it with
the application object.

Thanks
Bushby

-- 
View this message in context: 
http://www.nabble.com/Implementation-question-of-WebMarkupContainer-tf4649417.html#a13282634
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Page Expired Clustering?

2007-09-26 Thread Bushby

Thanks for the push in the right direction.  I believe we have the problem
solved.  We needed to add a session-descriptor in the weblogic.xml file.


PersistentStoreType
replicated_if_clustered


Again thanks for the quick response.  You helped save the wicket project. 
It was hours from going to struts because of time issues.



Bushby wrote:
> 
> The home page gets displayed and the only 2 things on the page are links
> to other pages.  One of the links goes to a page with 2 TextFields, 2
> DatePickers, and a button.  The other page has fields to capture typical
> credit card information.  The form for this page has a Spring service but
> it does not hold reference.  It asks the application for the bean.  All
> pojo's are Serializable.
> 
> 
> 
> Matej Knopp-2 wrote:
>> 
>> Also, are you sure everything on you page and in session is serializable?
>> 
>> -Matej
>> 
>> On 9/26/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
>>> > I am having trouble with a wicket application returning page expired
>>> when any
>>> > link or button is clicked on.  When the application is deployed on a
>>> server
>>> > with an Apache Weblogic integration the application works fine.  When
>>> the
>>> > application is deployed on a server with an Apache Weblogic cluster
>>> all
>>> > links and buttons return page expired.  I am using Wicket 1.2.6 and
>>> JDK 1.4.
>>> > The wicket application is also integrated with hibernate and Spring. 
>>> Any
>>> > help would be greatly appreciated.
>>>
>>> Do you use sticky sessions? Make sure the HttpSession gets replicated.
>>>
>>> Eelco
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>> 
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Page-Expired-Clustering--tf4519473.html#a12902031
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Page Expired Clustering?

2007-09-26 Thread Bushby

I am pretty certain we use sticky sessions.  I am checking with our server
admins.


Eelco Hillenius wrote:
> 
>> I am having trouble with a wicket application returning page expired when
>> any
>> link or button is clicked on.  When the application is deployed on a
>> server
>> with an Apache Weblogic integration the application works fine.  When the
>> application is deployed on a server with an Apache Weblogic cluster all
>> links and buttons return page expired.  I am using Wicket 1.2.6 and JDK
>> 1.4.
>> The wicket application is also integrated with hibernate and Spring.  Any
>> help would be greatly appreciated.
> 
> Do you use sticky sessions? Make sure the HttpSession gets replicated.
> 
> Eelco
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Page-Expired-Clustering--tf4519473.html#a12901809
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Page Expired Clustering?

2007-09-26 Thread Bushby

The home page gets displayed and the only 2 things on the page are links to
other pages.  One of the links goes to a page with 2 TextFields, 2
DatePickers, and a button.  The other page has fields to capture typical
credit card information.  The form for this page has a Spring service but it
does not hold reference.  It asks the application for the bean.  All pojo's
are Serializable.



Matej Knopp-2 wrote:
> 
> Also, are you sure everything on you page and in session is serializable?
> 
> -Matej
> 
> On 9/26/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
>> > I am having trouble with a wicket application returning page expired
>> when any
>> > link or button is clicked on.  When the application is deployed on a
>> server
>> > with an Apache Weblogic integration the application works fine.  When
>> the
>> > application is deployed on a server with an Apache Weblogic cluster all
>> > links and buttons return page expired.  I am using Wicket 1.2.6 and JDK
>> 1.4.
>> > The wicket application is also integrated with hibernate and Spring. 
>> Any
>> > help would be greatly appreciated.
>>
>> Do you use sticky sessions? Make sure the HttpSession gets replicated.
>>
>> Eelco
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Page-Expired-Clustering--tf4519473.html#a12901368
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Page Expired Clustering?

2007-09-25 Thread Bushby

I am having trouble with a wicket application returning page expired when any
link or button is clicked on.  When the application is deployed on a server
with an Apache Weblogic integration the application works fine.  When the
application is deployed on a server with an Apache Weblogic cluster all
links and buttons return page expired.  I am using Wicket 1.2.6 and JDK 1.4. 
The wicket application is also integrated with hibernate and Spring.  Any
help would be greatly appreciated.

-- 
View this message in context: 
http://www.nabble.com/Page-Expired-Clustering--tf4519473.html#a12892290
Sent from the Wicket - User mailing list archive at Nabble.com.


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