Re: EmailAddressValidator triggers on empty input field

2011-02-18 Thread hrbaer

Any idea?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/EmailAddressValidator-triggers-on-empty-input-field-tp3299464p3312795.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: EmailAddressValidator triggers on empty input field

2011-02-18 Thread hrbaer

Finally I got it.

If you add setType( String.class ) to your TextField the
EmailAddressValidator triggers on null/empty input. If you leave this
everything works fine...

I thought it would be useful to declare my inputfields as a certain type.
Obviously it's not needed but also the outcome of this type is an error.

Can anybody provide the sense of setting the type?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/EmailAddressValidator-triggers-on-empty-input-field-tp3299464p3313014.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: how to access component values within a dynamic table?

2011-02-21 Thread hrbaer

No idea how to deal with multiple panels within a listView (because of the
name clash)?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-access-component-values-within-a-dynamic-table-tp3310939p3316929.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: how to access component values within a dynamic table?

2011-02-22 Thread hrbaer

Sorry, but I just don't get this :(
I'm totally missing the forest through the trees...so I tried to reduce the
example to the very minimum. Maybe someone can provide me an idea how to
deal with my issue?!

This is the scenario: 
I have a form with two rows. Within each row there is one label and one
inputfield. The inputfield get's provided by a Panel. If I submit the form
there is only one entry within getModelObject(). The key is (of course) the
wicket:id of the input field and the value is the value of the second input
field.

How can I achieve that I get both value's??

My Java file (Test.java)
public class Test extends WebPage {

public Test() {
add( new TestForm( TestForm ) );
}

@SuppressWarnings(serial)
public final class TestForm extends FormValueMap {

public TestForm( final String id ) {

super( id, new CompoundPropertyModelValueMap( new ValueMap() )
);
setMarkupId( id );

ArrayListString list = new ArrayListString();
list.add( Frage 1 );
list.add( Frage 2 );
add( new ListViewString( ListFragen, list ) {

protected void populateItem( ListItemString item 
) {

item.add( new Label( Frage, 
item.getModelObject() ) );
item.add( new Input_Panel( Input ) );

}
});

}

public final void onSubmit() {
ValueMap valueMap = getModelObject();
// within valueMap the only key is PanelInput with the value 
of
the second input field!!
}

}
}

the corresponding markup (Test.html)
form wicket:id=TestForm

table class=inhalt width=100% border=0
tr wicket:id=ListFragen
td colspan=2 span wicket:id=FragePlatzhalter /span/td
td colspan=2 span wicket:id=InputPlatzhalter /span/td
/tr
tr
td colspan=2nbsp;/td
td colspan=2
input type=submit value=Speichern
input type=reset value=Abbrechen
/td
/tr
/table

/form

My Panel (Input_Panel.java)
public class Input_Panel extends Panel {
public Input_Panel( String id ) {
super(id);
add ( new TextFieldString( PanelInput ) );
}
}

the corresponding markup (Input_Panel.html)
wicket:panel
input wicket:id=PanelInput type=text size=30 maxlength=30
/wicket:panel
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-access-component-values-within-a-dynamic-table-tp3310939p3318845.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: how to access component values within a dynamic table?

2011-02-22 Thread hrbaer

Hi Hans, this is working!!
Thanks you very much.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-access-component-values-within-a-dynamic-table-tp3310939p3319092.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



(...) is managed by a different Object Manager

2011-02-24 Thread hrbaer

Hi all,

I try to store data within my database using JDO but I get the following
exception: ...is managed by a different Object Manager. So I tried a view
constallations but I didn't find the solution yet.

First of all here are my POJOs
-
// KATALOG
@PersistenceCapable
public class Katalog implements IClusterable {

  @PrimaryKey
  @Persistent( valueStrategy = IdGeneratorStrategy.IDENTITY )
  private Long id;
  private ArrayListQuestion fragen;
  private Long userId; 
  (...)

  ...according Setter/Getter

}

// QUESTION
@PersistenceCapable
public class Question implements IClusterable {

  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Key id;
  (...)

  ...according Setter/Getter

}

// EINTRAG
@PersistenceCapable
public class Eintrag implements IClusterable {

  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Key id;
  private Long katalogId;
  private ArrayListQuestion listFragen;
  (...)

  ...according Setter/Getter

}
-



Then I have a java file where I load all Katalog entries:
-
public Uebersicht() {

  PersistenceManager pm = PMF.getPersistenceManager();
  Query query = pm.newQuery( Katalog.class, userId == +Constants.USER_ID
);
  listKatalog = new ArrayListKatalog( (ListKatalog) query.execute() );
  // 1) pm.close();

  final RepeatingView repeatingViewFragen = new RepeatingView(
Constants.LIST_QUESTIONS );
  repeatingViewFragen.setOutputMarkupId( true );
  add( repeatingViewFragen );

  add( new ListViewKatalog( Constants.LIST_KATALOG, listKatalog ) {

protected void populateItem( ListItemKatalog item ) {

Katalog katalog = item.getModelObject();
item.add( new Label( Constants.TEXT, katalog.getName() ) );
item.add( new Label( Anzahl, Anzahl Fragen:  + new Integer(
katalog.getFragen().size() ).toString() ) );

PageParameters param = new PageParameters();
param.put( katalogID, katalog.getId() );
item.add( new BookmarkablePageLink( Details_Link, Details.class,
param ) );

PageParameters parameters = new PageParameters();
parameters.put( katalogID, katalog.getId() );
item.add( new BookmarkablePageLink( Eintrag_erfassen_Link,
EnterEintrag.class, parameters ) );

   }
});

  // 2) pm.close();

}
-

And here are my behaviour variations:

1 + 2)  If I close the PM here katalog.getFragen() (within the populateItem
method) returns null - NullPointerException!?
3) If I don't close the PM I cannot save a new Eintrag (within
EnterEintrag.java) because of
org.datanucleus.exceptions.NucleusUserException: Object with id
com.google.appengine.api.datastore.Key:Katalog(9)/Question(10) is managed
by a different Object Manager

Can anybody help with solving this issue? Why can't I close my PM without
loosing the access on fragen?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/is-managed-by-a-different-Object-Manager-tp3322642p3322642.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: (...) is managed by a different Object Manager

2011-02-25 Thread hrbaer

Meanwhile I tested a bit more and you really can reduce the example of
eager/lazy-loading.

After using Google a while I tried to add 
@Persistent( defaultFetchGroup=true )
private ArrayListQuestion fragen;
to my POJO. 

But now I get the following (console) output: WARN  [DataNucleus.MetaData]
- Meta-data warning for de.web.guestbook.model.Katalog.fragen: The datastore
does not support joins and therefore cannot honor requests to place related
objects in the default fetch group.  The field will be fetched lazily on
first access.  You can modify this warning by setting the
datanucleus.appengine.ignorableMetaDataBehavior property in your config.  A
value of NONE will silence the warning.  A value of ERROR will turn the
warning into an exception..

Nethertheless I do load the list of Fragen eagerly. 
So my only open point is: Is there a best practice to handle this kind of
warning or should I just ignore it?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/is-managed-by-a-different-Object-Manager-tp3322642p3324133.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: (...) is managed by a different Object Manager

2011-02-25 Thread hrbaer

Out of the frying pan into the fire :(

Given is a table with all KATALOG entities. Within each row there is a count
of the size of QUESTION, f.eg.: 
Row 1: name of the KATALOG - katalog.getFragen().size() -
CREATE_EINTRAG-Link
Row 2: name of the KATALOG - katalog.getFragen().size() -
CREATE_EINTRAG-Link
Row 3: name of the KATALOG - katalog.getFragen().size() -
CREATE_EINTRAG-Link

If I start the server I can add new KATALOG entities with an amount of
QUESTIONs. Everything is fine. But once I store a new EINTRAG to a selected
KATALOG the list of QUESTIONs of this KATALOG is empty. And further more if
I save a new KATALOG with e.g. 2 QUESTIONs they don't get displayed within
my overview. It's alwasy 0.

This is how I create a new EINTRAG:


Eintrag eintrag = new Eintrag();
eintrag.setKatalogId( selectedKatalog.getId() ); // I load the KATALOG by
the KATALOG-ID at the beginning of the constructor via PageParameter
eintrag.setVorname( (String) getModelObject().get( Constants.VORNAME ) );
eintrag.setNachname( (String) getModelObject().get( Constants.NACHNAME ) );
eintrag.setEmail( (String) getModelObject().get( Constants.EMAIL ) );
eintrag.setListFragen( selectedKatalog.getFragen());
return eintrag;


It seems like I remove the already stored list of QUESTIONs of the KATALOG
and add them to EINTRAG.
What am I doing wrong?

Thanks in advance.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/is-managed-by-a-different-Object-Manager-tp3322642p3324221.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



update label using (Ajax)Link

2011-03-15 Thread hrbaer
Hi,

I try to update a component (vorname within my example) once the user
click on a link within a table. 
(In fact it doesn't matter if it is an ajax link or a normal one. My
example is using an ajax link.)

This im my JAVA code:

public class Test extends WebPage {

private Eintrag selectedEintrag = new Eintrag();

public Test( PageParameters parameters ) {

ArrayList listEintraege = ladeEintraege( parameters );

final Label vorname = new Label( Vorname, 
selectedEintrag.getVorname()
); //just empty in first instance
auswahlVorname.setOutputMarkupId( true );
add( auswahlVorname );

add( new ListView( List, listEintraege ) {

protected void populateItem( final ListItem item ) {

  Eintrag eintrag = item.getModelObject();
  item.add( new Label( Info, eintrag.getInfo() ) );
  item.add(new AjaxFallbackLink(Details_Link){

@Override
public void onClick( AjaxRequestTarget target ) {

selectedEintrag = item.getModelObject();
target.addComponent( vorname );

  }

});

  }

  });

}

}


Can anybody provide me some information's why this is not working (no update
at all)?
Isn't it possible to bind my Label component to a private property and
update this property during the onclick method?

Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/update-label-using-Ajax-Link-tp3356575p3356575.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: update label using (Ajax)Link

2011-03-15 Thread hrbaer
Thanks Ernesto for you quick reply. Unfortunatelly this is not working :(

But if I debug within the onClick method of my AjaxLink
item.getModelObject() returns null?
Any idea why this happens? Or is this just a problem with my debugging
configuration of eclipse?

I would expect I can access Eintrag within the onClick method by using
item.getModelObject()?

Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/update-label-using-Ajax-Link-tp3356575p3356755.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: update label using (Ajax)Link

2011-03-15 Thread hrbaer
Sorry @ all,

I just forgot to restart the server so the approach with the
AbstractReadOnlyModel is working!

Thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/update-label-using-Ajax-Link-tp3356575p3356773.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



dynamic navigation/side content depending on login status

2011-03-17 Thread hrbaer
Hi,

how can I display navigation points and page content depending on the login
status?
I have a login box and only after a sucessfully authentication I want to

1.) extend the existing navigation 
2.) make content visible on (already) public sites

Seems like I have to create my own Session object (or is there already one
given with wicket?) and need to check whether a user is already logged in or
not?

Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-navigation-side-content-depending-on-login-status-tp3384641p3384641.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: dynamic navigation/side content depending on login status

2011-03-17 Thread hrbaer
Meanwhile I already implemented the part if there is a visible link to a page
that requires authentication the user get's redirected to the login page.

But how can I make links invisible if a user is not logged in?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-navigation-side-content-depending-on-login-status-tp3384641p3384763.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: dynamic navigation/side content depending on login status

2011-03-17 Thread hrbaer
Thanks...that was really an easy one :)

But while playing around with this topic I do have a few other questions:

Within the wicket signin example I have to provide a method called
newSession( Request request, Response response ) within my
TestApplication.java file. So if I call /test/* and this URL is mapped with
TestApplication.java I would assume the first time I get a new session.
Afterwards I don't, right?

So to access the test page you have to be logged in. You can achieve this by
clicking on the link and log in and you will get forwarded to the page.
Fine. But the second opportunity I want to provide is via a seperate login
page. So that the user can log in before he access the test page. After
logged in via the login page and calling the test page you shouldn't get a
redirect to the login page again.

And now I get some problems. Within the onSubmit() method of my Login.java
file there is the following code
---
public final void onSubmit() {

SignInSession session = (SignInSession) getSession();

if ( !session.isSignedIn() ){

ValueMap values = getModelObject();
if ( session.authenticate( (String) values.get( Username ), 
(String)
values.get( Password ) ) ) {

if ( !continueToOriginalDestination() ) {
setResponsePage( getApplication().getHomePage() 
);
}

}
else {
info( error );
}

}
else{
setResponsePage( getApplication().getHomePage() );
}

}
---

But within my LoginApplication.java file I don't have a method newSession(
Request request, Response response ). Because I don't want to create for
every xxxApplication.java file a new Session. I want to share one sessions
for all xxxApplication.java files. So if I access the login page directly
and submit the form I get an exception because I cannot cast to
SignInSession because I only have (per default) a WebSession.

I could create a new SignInSession but the constructor of this class need a
Request object which I don't have within my onSubmit method. And even if I
would have the Request object how can I ensure that my new createt
SignInSession object get's shared by all other classes. I would expect even
if I create such a new session object and would call TestApplication.java a
new SignInSession object get's created, isn't it?

Hopefully I get the problem across to you?! Otherwise just let me know and I
try to explain it in a better way...

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-navigation-side-content-depending-on-login-status-tp3384641p3384920.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: dynamic navigation/side content depending on login status

2011-03-18 Thread hrbaer
Thanks Michael for the hint.

I already adapt that example and this is working - at least in parts.

Those are my two pain points at the moment:
1.) share one session
2.) seperate Login page

Regarding 1.):
I've implemented two Links. Both do need a authentication so both
xxxApplication.java extend AuthenticatedWebApplication and provide the
methods getHomepage(), getWebSessionClass(), getSignInPageClass() and
init(). In both xxxApplication.java files the methot getWebSessionClass
return MyAuthenticatedWebSession.class.
But, if I first click on link 1 I get a redirect to the login page. After
successfully login I get the content of link 1. If I click link 1 again no
login is necesarry. After that I click on link 2 (which also needs
authentication) and get redirected to the login page again. But my
assumption was that if I'm already marked as logged in I don't have to login
again?!? Obviously I get another instance of the
MyAuthenticatedWebSession.class. 
How can I avoid another login once I'm already logged in?

Regarding 2.):
Apart from the configuration of the xxxApplication.java files I want to
offer the user a seperat login page. In fact I want to reuse the existing
one for the two links. Because of the fact that this class is extending the
SignInPage I don't have to care about input fields and onSubmit method. But
if I call my login.html directly and submit the form I get the following
exception: java.lang.ClassCastException:
org.apache.wicket.protocol.http.WebSession. But within my html there is only
 span wicket:id=signInPanel/ and nothing within the associated java
file.

Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-navigation-side-content-depending-on-login-status-tp3384641p3386832.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: dynamic navigation/side content depending on login status

2011-03-21 Thread hrbaer
Hi all, any idea how do share sessions?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-navigation-side-content-depending-on-login-status-tp3384641p3394125.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: dynamic navigation/side content depending on login status

2011-03-21 Thread hrbaer

Isammoc OFF wrote:
 
 I don't really understand why you have two xxxApplication.java for only
 two
 links. In my mind, I would make only one xxxApplication.java for both
 pages.

If both links would be on the same page - yes. But if you have several pages
you need a separate xxxApplication.java file anyway (ok - not necessarily
but in most of the cases).
So let's assume there is a page A with a link and a page B with a link and
both need authentication.


Isammoc OFF wrote:
 
 This problem is common : Single Sign On (SSO).
 IMHO, you may share cookies and check if the user is connected to the
 other
 application(s) thru web services.
In fact there is only one application so from my point of view there is no
need of implementing a SSO.
The only thing I want to achieve is that a user don't have to login twice if
he click on link A on page A and afterwards on link B on page B (both need
authentication).

There must be some easy solution for this issue, isn't it?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-navigation-side-content-depending-on-login-status-tp3384641p3395024.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: dynamic navigation/side content depending on login status

2011-03-24 Thread hrbaer
Hi,

thanks for your feedback, Isammoc and Zilvinas.

But I don't get your point. In fact I would assume I already did everything
like the example you provided but still I get a login page even if the user
already authenticated successfully before.

@ Isammoc: You told me that I don't have to create two xxxApplication files
that extend WebApplication.
But if there a two separat pages that both would need authentication first
how can I ensure that this login will take place if I configure only one
xxxApplication which extends AthenticatedWebApplication with the relevant
methods getWebSessionClass() and getSignInPageClass()?

This is my code:
-
MyAuthenticatedWebSession
public class MyAuthenticatedWebSession extends AuthenticatedWebSession {

public MyAuthenticatedWebSession( Request request ) {
super(request);
}

@Override
public boolean authenticate( final String username, final String
password ) {

PersistenceManager pm = PMF.getPersistenceManager();
List listUser = new ArrayList();

try {

 Query query = pm.newQuery( User.class, password == 
\+
password +\  username == + username );
listUser = (List) query.execute();

return listUser.isEmpty()? false : true;

} 
catch( Exception e ){
info( Es ist ein technischer Fehler aufgetreten...bitte
versuchen Sie es später noch einmal. );
}
finally {
pm.close();
}

return false;

}

@Override
public Roles getRoles() {
return isSignedIn() ? new Roles( Roles.ADMIN ) : null;
}
}

Page A (A_Application.java)
public class A_Application extends AuthenticatedWebApplication {

public A_Application() {}

@Override
public Class ? extends Page getHomePage() {
return Uebersicht.class;
}

@Override
protected Class? extends AuthenticatedWebSession getWebSessionClass()
{
return MyAuthenticatedWebSession.class;
}

@Override
protected Class? extends WebPage getSignInPageClass() {
return Login.class;
}

@Override
protected void init() {
super.init();
getResourceSettings().setResourcePollFrequency(null); 
}

}

corresponding class to page A 
@AuthorizeInstantiation(ADMIN)
public class Uebersicht extends WebPage {
  ...
}


Page B (B_Application.java)
public class B_Application extends AuthenticatedWebApplication {

public B_Application() {}

@Override
public Class ? extends Page getHomePage() {
return Fragen.class;
}

@Override
protected Class? extends AuthenticatedWebSession getWebSessionClass()
{
return MyAuthenticatedWebSession.class;
}

@Override
protected Class? extends WebPage getSignInPageClass() {
return Login.class;
}

protected void init() {
super.init();
getResourceSettings().setResourcePollFrequency(null);  
}

}

corresponding class to page B 
@AuthorizeInstantiation(ADMIN)
public class Frage extends WebPage {
  ...
}
-

At the moment if I click on a link which call's page A I get redirected to
my login page. After a successfully login I get redirected to my markup of
page A. If I click again on the link no login is necessary. But there is the
exact same scenario if I click on a link which call's page B - even if I
already logged in successfully.

How can I achieve that a user don't need to authenticate for each page which
requires authentication? I would like to share these information over all
pages once a user is already logged in successfully.

I think I still need some assistance :(

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-navigation-side-content-depending-on-login-status-tp3384641p3402193.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: dynamic navigation/side content depending on login status

2011-03-24 Thread hrbaer
Maybe I missed one interesting detail.

While searching the web for some examples/explanaitions for my problem I
found a few threads where the author of the thread had to explain why he
uses multiple xxxApplication files. For some reasons a lot of users are of
the opinion that you should only use one xxxApplication file for your war.

In my case I use for each (navigation)link on my page a separat servlet
mapping within the web.xml.
So if a user call's a link which should appear on page A there is a separat
mapping for /a/*, the same for page B and so on.

Is this in general a bad approach? 
Could this explain my problems with authentication?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-navigation-side-content-depending-on-login-status-tp3384641p3402431.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: dynamic navigation/side content depending on login status

2011-03-24 Thread hrbaer
Ok, I modified my application so there is only one xxxApplication file. And
as already assumed now it is working. 

Because I'm still playing around with this framework it's not really a pain
for me. I will refactor my application and that's it.

But there are still two open question I have in mind:
1.) Is there any solution for this issue (authentication) if there is more
than one xxxApplication file in place?
2.) Is it state of the art to have only one xxxApplication file within a
war? What are the disadvantages/advantegs to have one/multiple
xxxApplication files in place?

Thanks in advance and sorry for the bulk of mails.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-navigation-side-content-depending-on-login-status-tp3384641p3402788.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: hide empty table

2011-03-27 Thread hrbaer
Thanks shetc.

Meanwhile I did some additional research and beside add a WebMarkupContainer
which I can make (in-/)visible there is another option: wicket:enclosure.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/hide-empty-table-tp3409461p3409570.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



make link invisible via onclick

2011-03-28 Thread hrbaer
Hi,

is there a possibility to make a link invisible itself via onClick?
At the moment I get an error The local variable link may not have been
initialized.

code:
--
final Link link = new Link( test ) {

@Override
public void onClick() {
  link.setVisible( false );
}
};
--

Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/make-link-invisible-via-onclick-tp3411327p3411327.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: make link invisible via onclick

2011-03-28 Thread hrbaer
this works like a charm - thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/make-link-itself-invisible-via-onclick-tp3411327p3411347.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



issue with input type=reset

2011-03-28 Thread hrbaer
Hi all,

let's assume there is a form with an input field an two buttons: submit and
reset.
Within the java code I add a new form component (extends Form) with an input
field and implement the onSubmit() method.

But: Is there a chance to implement some onReset() method so I can do some
more stuff apart from cleaning the input field (which I cannot influence)?

Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/issue-with-input-type-reset-tp3411379p3411379.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: issue with input type=reset

2011-03-28 Thread hrbaer
Meanwhile I tried to add another submit button and just labeling that as a
reset button.
This is almost working but after calling the onSubmit method of my reset
button the onSubmit method of my form get's triggered as well?!

This is my button:
-
Button resetButton  = new Button(reset) {

public void onSubmit() {
doSomething();
}
};
add( resetButton );
-

And idea how to avoid that behaviour?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/issue-with-input-type-reset-tp3411379p3411408.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: issue with input type=reset

2011-03-28 Thread hrbaer
thanks - that's it.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/issue-with-input-type-reset-tp3411379p3411433.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



flexible authentication

2011-03-29 Thread hrbaer
Hi all,

my web application is using the wicket authentication approach
(AuthenticatedWebSession) and all my secure java files are marked with
@AuthorizeInstantiation(ADMIN)
So once I added this annotation there is no chance to bypass the
authentication.

But what if there is the need to be flixible? What if for some users the
page A should be secure and for others don't?

Let's assume there is is page with e.g. contact informations and a user can
decide for his own if the page should be accessible with or without
authentication. How can I achieve that without using the wicket approach? At
the moment it don't think that the wicket approach is the right one?!

Thanks in advance.

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

2011-03-29 Thread hrbaer
it's not about to bash the framework.

Because I'm still a beginner I just want to make sure that this approach is
not working for me. It seems like the demo implementation just allows two
options:
- need authentication
- don't need authentication
but there is no option to make it more flexible.

What I'm interested in is if there is any chance to use out of the box
functionality of wicket to solve this issue.

Thanks in advance.

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



problems with spring integration

2011-03-29 Thread hrbaer
Hi all,

I did some research within the forum but I didn't find the answer yet :(

I tried to integrate Spring (using 
https://cwiki.apache.org/WICKET/spring.html#Spring-ApplicationObjectApproach
Spring + WICKET ) but I still have an error. 

I added the following lines to my web.xml:

wicket
org.apache.wicket.protocol.http.WicketServlet

applicationFactoryClassName
org.apache.wicket.spring.SpringWebApplicationFactory

1



contextConfigLocation
/WEB-INF/applicationContext.xml


org.springframework.web.context.ContextLoaderListener


Within my xxxApplication file I added:
public class HomeApplication extends AuthenticatedWebApplication {

private UserService userService;

public void setUserService( UserService userService ) {
this.userService = userService;
}
public UserService getUserService() {
return this.userService;
}

(...)

And within my java file there is:
public class Test extends WebPage {
   private UserService getUserService() {
  return ( (xxxApplication) getApplication()).getUserService();
   }

   (...)

}

So if I start the server I invoke the setter of the method setUserService of
my xxxApplication class.
But once I call getUserService() of my java file the return value is null!?

Any ideas? 
Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/problems-with-spring-integration-tp3416484p3416484.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: flexible authentication

2011-03-29 Thread hrbaer
Thanks for all the good hints ... let me check the links/advices.
Hopefully there is no need to ask any further questions :)

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/flexible-authentication-tp3415413p3416489.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: problems with spring integration

2011-03-30 Thread hrbaer
I added wicket-spring-annot to my project, removed all of the previous spring
code and just added getComponentInstantiationListeners().add(new
SpringComponentInjector(this)); to the init method of my xxxApplication
class.

But now I'm getting an error:
The type org.apache.wicket.injection.ComponentInjector cannot be resolved.
It is indirectly referenced from required .class files

Any idea?
Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/problems-with-spring-integration-tp3416484p3418401.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: problems with spring integration

2011-03-30 Thread hrbaer
No, I don't. So adding wicket-ioc.jar to my project solves this problem.

But because of the fact I don't have a default constructor I get an
exception.
My constructor looks like public Test( PageParameters params ){ ... }.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/problems-with-spring-integration-tp3416484p3418449.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: problems with spring integration

2011-03-30 Thread hrbaer
Just to summarize my status:

I've added addComponentInstantiationListener( new
SpringComponentInjector(this) ); to the init method of my xxxApplication
file, I added  to my applicationContext and withing my WebPage I have this
code:

public class Test extends WebPage {

@SpringBean
private UserService userService;

public Test( PageParameters params ) {

(...)

}

If I add



to the applicationContext I get the error Could not instantiate bean class
[de.Test]: No default constructor found;

If I don't add this line I get the error message WicketMessage: Can't
instantiate page using constructor public
de.Test(org.apache.wicket.PageParameters) and argument
Root cause:
java.lang.ClassNotFoundException: net.sf.cglib.proxy.Callback (...)

At the moment I'm at a loss. Every help would be appreciated.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/problems-with-spring-integration-tp3416484p3418488.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: problems with spring integration

2011-04-01 Thread hrbaer
This works like a charm - thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/problems-with-spring-integration-tp3416484p3421269.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



changing image on locale change

2011-04-01 Thread hrbaer
Hi all,

is there any chance to change an image once the user choose another
language?
With a text it's very easy because the only thing you have to provide are
the different language property files.

Let's assume there is a dropdown with different languages. I've added
DropDownChoices and implemented the onSelectionChanged method. If the user
choose another option the only thing I have to do is to set the Locale to
the choosen language.

Is there a similar functionality for images?

At the moment I've tried a little bit with this:
--
Image imageGerman = new Image( someImage, new ResourceReference(
Home.class, images/logo.png ) );
Image imageUK = new Image( someImage, new ResourceReference( Home.class,
images/logo2.png ) );
add( isLocaleGerman() ? imageGerman : imageUK );
--
But this is only working if the page constructor is called.

Any ideas?
Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/changing-image-on-locale-change-tp3421291p3421291.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: changing image on locale change

2011-04-01 Thread hrbaer
Thanks Igor.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/changing-image-on-locale-change-tp3421291p3421371.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 within modal window should reload parent page

2011-04-08 Thread hrbaer
Hi all,

at the moment I have a modal window with a link in it.
If I click the link (it's a BookmarkablePageLink) the new page get's loaded
within the modal window. But what I want to achieve is that the modal window
get's closed and the parent page get's redirected to the new page.

How can I achieve that?
Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/link-within-modal-window-should-reload-parent-page-tp3437508p3437508.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 within modal window should reload parent page

2011-04-09 Thread hrbaer
I tried to add a AjaxLink but I didn't get it so far.
This is my code:

public class ModalPage extends WebPage{

public ModalPage( final ModalWindow modalwindow ){

add( new AjaxLink( link ) {

public void onClick( final AjaxRequestTarget target ) {

modalwindow.close( target );
target.appendJavascript(window.location=' + urlFor(
Home.class, new PageParameters() ) + '); 

}

});

}

}

The current effect: The modal windows get's closed but no redirect took
place.
Any idea?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/link-within-modal-window-should-reload-parent-page-tp3437508p3438418.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 within modal window should reload parent page

2011-04-10 Thread hrbaer
Ok, thanks. This is working.
But if a user clicks on the link within the modal page a confirmation dialog
pops up.

http://apache-wicket.1842946.n4.nabble.com/file/n3439885/dialog.jpg 
(It's about a warning message for the user if he want's to leave the page
(because of the redirect)).

Would assume that is a functionality of the browser, isn't it?
Any chance to avoid that pop up?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/link-within-modal-window-should-reload-parent-page-tp3437508p3439885.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 within modal window should reload parent page

2011-04-11 Thread hrbaer
Thanks for the hint but the behaviour is still present.

I added your code to both ModalPage and parent Webpage but the popup still
appears.
Any idea?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/link-within-modal-window-should-reload-parent-page-tp3437508p3441529.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 within modal window should reload parent page

2011-04-11 Thread hrbaer
It does!
I didn't expect that the modalwindow.close( target ); triggers the
WindowClosedCallback function.

Thanks!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/link-within-modal-window-should-reload-parent-page-tp3437508p3443067.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 within modal window should reload parent page

2011-04-11 Thread hrbaer
ok - I just realised that the WindowCloseCallback method gets triggered if a
user clicks on the link but also if he wants to close the popup. That's not
that good :(
Is there a chance to differ whether the user uses the link or just click on
the x button to close the popup?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/link-within-modal-window-should-reload-parent-page-tp3437508p3443126.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 within modal window should reload parent page

2011-04-13 Thread hrbaer


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/link-within-modal-window-should-reload-parent-page-tp3437508p3447299.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 within modal window should reload parent page

2011-04-13 Thread hrbaer

MZemeck wrote:
 The only thing that comes to mind is storing a flag in session. 
That is the approach I already implemented but with the same discomfiture
you mentioned before.

Meanwhile I tried to add the embedded javascript but without any success
yet.
I added the code both to my modalpage.html and the parent page .html. Do I
have to add any information's to the link or anything else??

--
2. or embed javascipt to base page:

  
--

Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/link-within-modal-window-should-reload-parent-page-tp3437508p3447308.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