Re: [Wicket-user] [Nuub] Best practise: Navigation Component

2007-05-31 Thread Johannes Schneider

Hi,

thanks for your answer. I was a surprised that there is no model 
abstraction of link in wicket...

I will take a deeper look at the tabs package - thanks for the hint.


Johannes Schneider

John Krasnay wrote:

One idea would be to create a class that represents the logical idea of
a link, e.g

public class NavEntry {
private String title;
private Class pageClass;
private PageParameters parameters;
...
}

Pass a list of these to the constructor of your panel, which then
renders these into actual links and labels.

If this is too restrictive, e.g. if you want different kinds of links,
not just BookmarkablePageLinks, you can defer creation of the link to
the NavEntry object:

public class NavEntry {
...
public abstract WebMarkupContainer createLink(String id);
}

public class BookmarkablePageNavEntry extends NavEntry {
private Class pageClass;
private PageParameters parameters;
public WebMarkupContainer createLink(String id) {
return new BookmarkablePageLink(pageClass, parameters);
}
}

A similar technique is used in the tabs package in wicket-extensions.

jk

On Tue, May 29, 2007 at 07:55:48PM +0200, Johannes Schneider wrote:

Hi,

I am new to Wicket and I really like the things I have seen so far. But 
I also have a few questions.
At the moment I create a small page. Therefore I have created a 
NavigationComponent (extends Panel) with its own markup file and some 
other resources (css, images).


Can anybody describe me the best way to add Links (most of them are 
BookmarkableLinks) and the corresponding Labels to this component?
At the moment I create a List of Links. Each of those links has a Label 
added. Those links are then provided to a DataView and given to the 
NavigationComponent.
I don't like this because I have to create the components manually 
(Links and Labels) with the correct ids. What approach would a wicket 
expert take?


Later I might reuse the NavigationComponent within another application. 
But therefore I would like to modify/replace the CSS and replace some 
images. What is the Wicket way to achive this?



Thanks in advance,


Johannes Schneider
--
Johannes Schneider
Im Lindenwasen 15
72810 Gomaringen

Fon +49 7072 9229972
Fax +49 7072 50
Mobil +49 178 1364488

[EMAIL PROTECTED]
http://www.johannes-schneider.info





-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


--
Johannes Schneider
Im Lindenwasen 15
72810 Gomaringen

Fon +49 7072 9229972
Fax +49 7072 50
Mobil +49 178 1364488

[EMAIL PROTECTED]
http://www.johannes-schneider.info


smime.p7s
Description: S/MIME Cryptographic Signature
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] [Nuub] Best practise: Navigation Component

2007-05-30 Thread John Krasnay
One idea would be to create a class that represents the logical idea of
a link, e.g

public class NavEntry {
private String title;
private Class pageClass;
private PageParameters parameters;
...
}

Pass a list of these to the constructor of your panel, which then
renders these into actual links and labels.

If this is too restrictive, e.g. if you want different kinds of links,
not just BookmarkablePageLinks, you can defer creation of the link to
the NavEntry object:

public class NavEntry {
...
public abstract WebMarkupContainer createLink(String id);
}

public class BookmarkablePageNavEntry extends NavEntry {
private Class pageClass;
private PageParameters parameters;
public WebMarkupContainer createLink(String id) {
return new BookmarkablePageLink(pageClass, parameters);
}
}

A similar technique is used in the tabs package in wicket-extensions.

jk

On Tue, May 29, 2007 at 07:55:48PM +0200, Johannes Schneider wrote:
 Hi,
 
 I am new to Wicket and I really like the things I have seen so far. But 
 I also have a few questions.
 At the moment I create a small page. Therefore I have created a 
 NavigationComponent (extends Panel) with its own markup file and some 
 other resources (css, images).
 
 Can anybody describe me the best way to add Links (most of them are 
 BookmarkableLinks) and the corresponding Labels to this component?
 At the moment I create a List of Links. Each of those links has a Label 
 added. Those links are then provided to a DataView and given to the 
 NavigationComponent.
 I don't like this because I have to create the components manually 
 (Links and Labels) with the correct ids. What approach would a wicket 
 expert take?
 
 Later I might reuse the NavigationComponent within another application. 
 But therefore I would like to modify/replace the CSS and replace some 
 images. What is the Wicket way to achive this?
 
 
 Thanks in advance,
 
 
 Johannes Schneider
 -- 
 Johannes Schneider
 Im Lindenwasen 15
 72810 Gomaringen
 
 Fon +49 7072 9229972
 Fax +49 7072 50
 Mobil +49 178 1364488
 
 [EMAIL PROTECTED]
 http://www.johannes-schneider.info



 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] [Nuub] Best practise: Navigation Component

2007-05-29 Thread Thomas Singer
Hi Johannes,

If you can hard code the links in your markup, it might be worth to try 
autolinking.

Tom


Johannes Schneider wrote:
 Hi,
 
 I am new to Wicket and I really like the things I have seen so far. But 
 I also have a few questions.
 At the moment I create a small page. Therefore I have created a 
 NavigationComponent (extends Panel) with its own markup file and some 
 other resources (css, images).
 
 Can anybody describe me the best way to add Links (most of them are 
 BookmarkableLinks) and the corresponding Labels to this component?
 At the moment I create a List of Links. Each of those links has a Label 
 added. Those links are then provided to a DataView and given to the 
 NavigationComponent.
 I don't like this because I have to create the components manually 
 (Links and Labels) with the correct ids. What approach would a wicket 
 expert take?
 
 Later I might reuse the NavigationComponent within another application. 
 But therefore I would like to modify/replace the CSS and replace some 
 images. What is the Wicket way to achive this?
 
 
 Thanks in advance,
 
 
 Johannes Schneider


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] [Nuub] Best practise: Navigation Component

2007-05-29 Thread Johannes Schneider
I don't want to hard code the links because I use the Component several 
times with differen links. I also would like to use the component in the 
next project too.



Johannes Schneider

Thomas Singer wrote:

Hi Johannes,

If you can hard code the links in your markup, it might be worth to try 
autolinking.


Tom


Johannes Schneider wrote:

Hi,

I am new to Wicket and I really like the things I have seen so far. But 
I also have a few questions.
At the moment I create a small page. Therefore I have created a 
NavigationComponent (extends Panel) with its own markup file and some 
other resources (css, images).


Can anybody describe me the best way to add Links (most of them are 
BookmarkableLinks) and the corresponding Labels to this component?
At the moment I create a List of Links. Each of those links has a Label 
added. Those links are then provided to a DataView and given to the 
NavigationComponent.
I don't like this because I have to create the components manually 
(Links and Labels) with the correct ids. What approach would a wicket 
expert take?


Later I might reuse the NavigationComponent within another application. 
But therefore I would like to modify/replace the CSS and replace some 
images. What is the Wicket way to achive this?



Thanks in advance,


Johannes Schneider



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


--
Johannes Schneider
Im Lindenwasen 15
72810 Gomaringen

Fon +49 7072 9229972
Fax +49 7072 50
Mobil +49 178 1364488

[EMAIL PROTECTED]
http://www.johannes-schneider.info


smime.p7s
Description: S/MIME Cryptographic Signature
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user