Ajax and updating DropDownChoice model object

2010-09-16 Thread Eric Reagan
Hello,
 I'm having some problems getting ajax to work with a updating the data
contained in the DropDownChoice default model object. My drop down choices
are dependent upon what is entered in a text box. I can get/update the text
box just fine but when I go and shove the list of choices into the
DropDownChoice default model object on ajax update the choices are are not
displayed. If in eclipse I do an inspect of my default model object after I
set it, the proper values are returned.

target.addComponent(getForm().get("contractChoices").setDefaultModelObject(s).setEnabled(true).setOutputMarkupId(true));

where right now S is a list that I just created with a value of abc,
123.

Thank you,

-- 
Eric Reagan


Re: Spring Security 3 with Wicket Auth Roles Problem

2010-08-09 Thread Eric Reagan
> I have in my Web Application
> addComponentInstantiationListener(getSpringInjector());
>
> protected SpringComponentInjector getSpringInjector()
> {
> return new SpringComponentInjector(this);
>
> }
>
> On Mon, Aug 9, 2010 at 11:16 AM, Martin Grigorov wrote:
>
>> It seems you need to configure Spring Injector in YourApp#init()
>>
>>
>> On Mon, Aug 9, 2010 at 6:04 PM, Eric Reagan  wrote:
>>
>>> Hello,
>>> I tried following
>>>
>>> https://cwiki.apache.org/WICKET/spring-security-and-wicket-auth-roles.htmlto
>>> setup spring security 3.0 and wicket auth roles in my application and
>>> I
>>> ran into a few problems that I was wondering if anyone else had seen. I
>>> am
>>> currently getting a java.lang.IllegalStateException: bean of type
>>> [org.springframework.security.authentication.AuthenticationManager] not
>>> found. Below is my web.xml, security xml file and a snippet of where the
>>> class is being called. Thanks for the help
>>>
>>> [web.xml]
>>> .
>>>
>>>contextConfigLocation
>>>
>>>
>>> classpath:/app-context/springApplicationContext.xml
>>>contextConfigLocation
>>>
>>>
>>> classpath:/app-context/applicationContext-security.xml
>>>
>>> ...
>>>
>>>  
>>>
>>>
>>> org.springframework.web.context.ContextLoaderListener
>>>  
>>>
>>> [applicationContext-security.xml]
>>> http://www.springframework.org/schema/beans";
>>>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>>   xmlns:security="http://www.springframework.org/schema/security";
>>>   xsi:schemaLocation="http://www.springframework.org/schema/beans
>>>
>>> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
>>>   http://www.springframework.org/schema/security
>>>
>>> http://www.springframework.org/schema/security/spring-security-3.0.xsd";
>>> >
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>>>    authorities="ROLE_ADMIN, ROLE_USER" />
>>>>>authorities="ROLE_USER" />
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> 
>>>
>>> [MySession.java]
>>>@SpringBean
>>>private AuthenticationManager authenticationManager;
>>>
>>>   public MySession()
>>>{
>>>super(request);
>>>injectDependencies();
>>>ensureDependenciesNotNull();
>>>}
>>>
>>>private void injectDependencies()
>>>{
>>>InjectorHolder.getInjector().inject(this); //When this method is
>>> tried the IllegalStateException error is thrown.
>>>}
>>>
>>> --
>>> Eric Reagan
>>>
>>
>>
>
>
> --
> Eric Reagan
>



-- 
Eric Reagan


Spring Security 3 with Wicket Auth Roles Problem

2010-08-09 Thread Eric Reagan
Hello,
 I tried following
https://cwiki.apache.org/WICKET/spring-security-and-wicket-auth-roles.htmlto
setup spring security 3.0 and wicket auth roles in my application and
I
ran into a few problems that I was wondering if anyone else had seen. I am
currently getting a java.lang.IllegalStateException: bean of type
[org.springframework.security.authentication.AuthenticationManager] not
found. Below is my web.xml, security xml file and a snippet of where the
class is being called. Thanks for the help

[web.xml]
.

contextConfigLocation

classpath:/app-context/springApplicationContext.xml
contextConfigLocation

classpath:/app-context/applicationContext-security.xml

...

  

org.springframework.web.context.ContextLoaderListener
  

[applicationContext-security.xml]
http://www.springframework.org/schema/beans";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xmlns:security="http://www.springframework.org/schema/security";
   xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
   http://www.springframework.org/schema/security

http://www.springframework.org/schema/security/spring-security-3.0.xsd";
>
























[MySession.java]
@SpringBean
private AuthenticationManager authenticationManager;

   public MySession()
{
super(request);
injectDependencies();
ensureDependenciesNotNull();
}

private void injectDependencies()
{
InjectorHolder.getInjector().inject(this); //When this method is
tried the IllegalStateException error is thrown.
}

-- 
Eric Reagan


Re: How to set the value of a Drop Down Choice

2010-07-27 Thread Eric Reagan
Martin,
Thanks for the advice. I had a mental fart and left out the setter
function. Once you add the setter...works like a charm. Thanks again.
Thank you,

On Tue, Jul 27, 2010 at 2:34 PM, Eric Reagan  wrote:

> Martin,
> I have the following. All I am getting is a null value. Am I setting
> the model object wrong?
>
> IModel stringObjectModel = new LoadableDetachableModel<
> String>()
> {
> /**
>  *
>  */
> private static final long serialVersionUID =
> 2165619560012612599L;
> private String text;
>
> @Override
> protected String load()
> {
> return text;
> }
>
> };
>
> stringObjectModel.setObject("abc");
>
> DropDownChoice programList = new
> DropDownChoice("users",stringObjectModel, users.getAll(), new
> IChoiceRenderer()
> {
> /**
>  * Generated
>  */
> private static final long serialVersionUID = -7278851941695545331L;
>
> @Override
> public Object getDisplayValue(Object object)
> {
> return object.toString();
> }
>
> @Override
> public String getIdValue(Object object, int index)
>     {
> object.toString()
> }
> }
> );
>
> programList.setDefaultModelObject(stringObjectModel);
>
>
> On Tue, Jul 27, 2010 at 2:33 PM, Eric Reagan  wrote:
>
>> Martin,
>> I have the following. All I am getting is a null value. Am I setting
>> the model object wrong?
>>
>> IModel stringObjectModel = new LoadableDetachableModel()
>> {
>> /**
>>  *
>>  */
>> private static final long serialVersionUID =
>> 2165619560012612599L;
>> private String text;
>>
>> @Override
>> protected String load()
>> {
>> return text;
>> }
>>
>> };
>>
>> stringObjectModel.setObject("abc");
>>
>> DropDownChoice programList = new
>> DropDownChoice("users",stringObjectModel, users.getAll(), new
>> IChoiceRenderer()
>> {
>> /**
>>  * Generated
>>  */
>> private static final long serialVersionUID = -7278851941695545331L;
>>
>> @Override
>> public Object getDisplayValue(Object object)
>> {
>> return object.toString();
>>     }
>>
>> @Override
>> public String getIdValue(Object object, int index)
>> {
>> object.toString()
>> }
>> }
>> );
>>
>> programList.setDefaultModelObject(stringObjectModel);
>>
>>
>>
>> On Tue, Jul 27, 2010 at 2:05 PM, Martin Makundi <
>> martin.maku...@koodaripalvelut.com> wrote:
>>
>>> Have you tried if setDefaultModelObject() works for you?
>>>
>>> **
>>> Martin
>>>
>>> 2010/7/27 Eric Reagan :
>>> > Hello,
>>> >  I was wondering how to set the currently selected value for a
>>> > DropDownList? Currently I have a .properties file which sets the value
>>> when
>>> > I have a null selection, however, I was wondering how do I change the
>>> > currently selected value to a different one (e.g. if I  am pulling a
>>> > previous selection from a database?)
>>> > Thank you,
>>> >
>>> > --
>>> > Eric Reagan
>>> >
>>>
>>
>>
>>
>> --
>> Eric Reagan
>>
>
>
>
> --
> Eric Reagan
>



-- 
Eric Reagan


Re: How to set the value of a Drop Down Choice

2010-07-27 Thread Eric Reagan
Martin,
I have the following. All I am getting is a null value. Am I setting the
model object wrong?

IModel stringObjectModel = new LoadableDetachableModel<
String>()
{
/**
 *
 */
private static final long serialVersionUID =
2165619560012612599L;
private String text;

@Override
protected String load()
{
return text;
}

};

stringObjectModel.setObject("abc");

DropDownChoice programList = new
DropDownChoice("users",stringObjectModel, users.getAll(), new
IChoiceRenderer()
{
/**
 * Generated
 */
private static final long serialVersionUID = -7278851941695545331L;

@Override
public Object getDisplayValue(Object object)
{
return object.toString();
}

@Override
public String getIdValue(Object object, int index)
{
object.toString()
}
}
);

programList.setDefaultModelObject(stringObjectModel);


On Tue, Jul 27, 2010 at 2:33 PM, Eric Reagan  wrote:

> Martin,
> I have the following. All I am getting is a null value. Am I setting
> the model object wrong?
>
> IModel stringObjectModel = new LoadableDetachableModel()
> {
> /**
>  *
>  */
> private static final long serialVersionUID =
> 2165619560012612599L;
> private String text;
>
> @Override
> protected String load()
> {
> return text;
> }
>
> };
>
> stringObjectModel.setObject("abc");
>
> DropDownChoice programList = new
> DropDownChoice("users",stringObjectModel, users.getAll(), new
> IChoiceRenderer()
> {
> /**
>  * Generated
>  */
> private static final long serialVersionUID = -7278851941695545331L;
>
> @Override
> public Object getDisplayValue(Object object)
> {
> return object.toString();
> }
>
> @Override
> public String getIdValue(Object object, int index)
> {
> object.toString()
> }
> }
> );
>
> programList.setDefaultModelObject(stringObjectModel);
>
>
>
> On Tue, Jul 27, 2010 at 2:05 PM, Martin Makundi <
> martin.maku...@koodaripalvelut.com> wrote:
>
>> Have you tried if setDefaultModelObject() works for you?
>>
>> **
>> Martin
>>
>> 2010/7/27 Eric Reagan :
>> > Hello,
>> >  I was wondering how to set the currently selected value for a
>> > DropDownList? Currently I have a .properties file which sets the value
>> when
>> > I have a null selection, however, I was wondering how do I change the
>> > currently selected value to a different one (e.g. if I  am pulling a
>> > previous selection from a database?)
>> > Thank you,
>> >
>> > --
>> > Eric Reagan
>> >
>>
>
>
>
> --
> Eric Reagan
>



-- 
Eric Reagan


How to set the value of a Drop Down Choice

2010-07-27 Thread Eric Reagan
Hello,
  I was wondering how to set the currently selected value for a
DropDownList? Currently I have a .properties file which sets the value when
I have a null selection, however, I was wondering how do I change the
currently selected value to a different one (e.g. if I  am pulling a
previous selection from a database?)
Thank you,

-- 
Eric Reagan


Survey -- Tool Success Theory Empirical Study - Apache Wicket

2010-05-03 Thread Eric Reagan
Hello All,
 I recieved an email entitled Tool Success Theory Empirical Study -
Apache Wicket. I was seeing if anyone else got this. Just wanted to make
sure that the request is valid before I go and fill out the survey.
Thanks

-- 
Eric Reagan


Missing markup files

2010-03-30 Thread Eric Reagan
All,
 I am getting an error message saying I am missing the Base markup for
my webpages. Before I was using the PathStripperLocator function
(link<http://cwiki.apache.org/WICKET/control-where-html-files-are-loaded-from.html#ControlwhereHTMLfilesareloadedfrom-InWicket1.3>).
To try and debug I moved all the html files into their associated packages
but I am still getting an error message stating that I am missing my markup
files. The only thing that I changed in my application is I added spring
(which I don't think this would affect where the html files are loaded from
but I could be wrong). In my log4j file I enabled logging for the
org.apache.wicket.util.resource and it is scanning through the packages
where my html files are located. Has anyone seen this problem before?
Thank you,
-- 
Eric Reagan


Starting web application thorws Invalid configuration type: 'null' for the configuration parameter

2010-03-26 Thread Eric Reagan
Hi,
  I am getting a really weird error in my web.xml file. So I have what
is copied below. I am getting an error message saying I have to be in either
development or deployment mode. (I tried switching putting deployment in and
it didn't work). I don't understand where my mistake was in configuring my
wicket app. I am trying to make a spring app with hibernate. The error seams
to switch between missing a filter for the opensessioninview (which is
defined and I have all the right jars in my classpath) and my configuration
being null. Has anyone seen this problem before?

http://java.sun.com/xml/ns/j2ee";
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
 version="2.4">


configuration
deployment


..


opensessioninview


org.springframework.orm.hibernate3.support.OpenSessionInViewFilter





opensessioninview
    /*

.

Thank you,
-- 
Eric Reagan


Spring problems

2010-03-24 Thread Eric Reagan
I am trying to setup a spring application and I can't seam to get past a
NoWebApplicationContext found.

I have followed the online tutorials (and the example code from the 1.4.7
directory) and I am still not having any luck.

In my web.xml file I have



servlet

org.apache.wicket.protocol.http.WicketServlet

applicationFactoryClassName

org.apache.wicket.spring.SpringWebApplicationFactory

1




contextConfigLocation
/WEB-INF/springContext.xml




in my springContext.xml file I have
   

and in my WebApplication file I have the generic default constructor

...
init()
getDebugSettings().setDevelopmentUtilitiesEnabled(true);
addComponentInstantiationListener(new
SpringComponentInjector(this));

Is there something I am missing in setting up Wicket and Spring?

thank you for the help.
-- 
Eric Reagan


Question about setting Lists

2010-03-05 Thread Eric Reagan
Hi,
  I am still new to Wicket and I think I might be missing something. I
am trying to create a list of items and then have a panel generate a
ListView which contains the previously created list (and all their children
and children's children..etc). In order to do this I created a class for the
List Items (ListItem) and a panel called (ListItemPanel). In order to
generate the ListView in my panel I need to be able to tell the panel which
list I want to iterate over. In order to do this in the calling page I made
my list and I went to go and set my variable inside of my panel, but my
setListToView(...) method which I had created won't appear. I have included
below the problem snippets. Thank you in advance for the help.

// Code

MyPage

ListItemPanel panel = new ListItemPanel("panel");
 ..generate all of the list items and put it into an ArrayList
 panel.setListToView(...panels) <This method can't be called
even though its a public method in my ListPanel class which extends Panel

thank you,

-- 
Eric Reagan


How to keep language .properties file in a separate folder from the html pages

2010-02-26 Thread Eric Reagan
I would like to keep my .html files in a seperate folder from the language
files and I was wondering how to do this? I keep my html files in
html/main/*.html and my language .properties files in
language/(languageName)/*.properties. I tried adding the following to my
MyWebApp. When I try and run my app there is a location error about not
being able to find my .properties file. I was wondering if anyone knew how
to fix/resolve this or if it would be better just to keep the .properites
file in the same directory as the html file.

@Override
protected void init()
{
super.init();
IResourceSettings resourceSettings = getResourceSettings();
resourceSettings.addResourceFolder("html/main");
resourceSettings.addResourceFolder("language/en-us");
resourceSettings.addResourceFolder("language/esp");
  .
resourceSettings.setResourceStreamLocator(new
PathStripperLocator());

}

-- 
Eric Reagan


Question about WicketTester and using my class which extends WebApplication

2010-02-25 Thread Eric Reagan
Hello,
 I am pretty well new to wicket and I am running into a problem I was
wondering if anyone knew how to solve. I have a class which extends the
WebApplication class. I have a static get method which is outlined below
  public static MyApp get(){
 return (MyApp) Application.get();
  }
 I then have the standard getHomePage() which returns null. In my Wicket
tester application I am trying to test what the getHomePage() for my app
returns. So when I try and construct a tester like WicketTester tester = new
WicketTester(MyApp.get()) I get the following error:
  org.apache.wicket.WicketRuntimeException there is no application
attached to the current thread.

 It seams to me that my MyApp application is null and not initialized?
My question really is how do I directly test my own WebApplication class
directly with wicket tester? For part of my tests I don't want to use the
default mock.

thank you,

-- 
Eric Reagan