Programmatic component tree manipulation

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Programmatic component tree manipulation

VAUCHER Laurent
  Hi,

  I discovered Wicket yesterday and read all documentation I could find
(not the entire Javadoc, mind you).
I tried playing a little with the framework and found it nice, as it
seems to solve the right problems (in my point of view).

  I currently have two questions :

  - How are component tree differences between HTML and Java resolved?
It seems at first that there must be a perfect match between the two
(runtime error when a component is missing from any of them).

  - Is it possible (and how) to programmatically manipulate the
component tree (adding, removing, moving...)


  Thanks.


Laurent.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://ads.osdn.com/?ad_idv37&alloc_id865&op=click">http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: Programmatic component tree manipulation

jdonnerstag
On 1/5/06, VAUCHER Laurent <[hidden email]> wrote:

>   Hi,
>
>   I discovered Wicket yesterday and read all documentation I could find
> (not the entire Javadoc, mind you).
> I tried playing a little with the framework and found it nice, as it
> seems to solve the right problems (in my point of view).
>
>   I currently have two questions :
>
>   - How are component tree differences between HTML and Java resolved?
> It seems at first that there must be a perfect match between the two
> (runtime error when a component is missing from any of them).
>

Yes, there has to be a 1:1 match (in name and hierarchy). Though there
is a setting availabe to disable the check I strongly suggest not to
do it.

>   - Is it possible (and how) to programmatically manipulate the
> component tree (adding, removing, moving...)
>

In most (98%) cases you'll add(myComponent) only. Due to the concept
of Wicket and Pages you should rarely require remove(). (move = remove
+ add).
A Page derives from MarkupContainer and as the name implies it is a
container. Panel and Border and several more Components are containers
as well. By adding components like Label, TextField, Panel etc. to a
container you the build the component tree.

Juergen

>
>   Thanks.
>
>
> Laurent.
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> <a href="http://ads.osdn.com/?ad_idv37&alloc_id865&opclick">http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
> _______________________________________________
> Wicket-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://ads.osdn.com/?ad_idv37&alloc_id865&op=click">http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: Programmatic component tree manipulation

VAUCHER Laurent
In reply to this post by VAUCHER Laurent
  Well, I finally found a way to do mostly what I need, using a
ListView, and nested Panel objects.

The model for the ListView can be programmatically modified anytime and
each model element can be used to create a panel. That's nice. I did not
try to plug this to a 'datamodel' yet, but it's a good start.


Laurent.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://ads.osdn.com/?ad_idv37&alloc_id865&op=click">http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: Programmatic component tree manipulation

jdonnerstag
The examples are usually a good source of information and the
phonebook application in sourceforge project wicket-stuff provides
best practices for database integration and make use of some more
high-level components.

Juergen

On 1/5/06, VAUCHER Laurent <[hidden email]> wrote:

>  Well, I finally found a way to do mostly what I need, using a
> ListView, and nested Panel objects.
>
> The model for the ListView can be programmatically modified anytime and
> each model element can be used to create a panel. That's nice. I did not
> try to plug this to a 'datamodel' yet, but it's a good start.
>
>
> Laurent.
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> <a href="http://ads.osdn.com/?ad_idv37&alloc_id865&opclick">http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
> _______________________________________________
> Wicket-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://ads.osdn.com/?ad_idv37&alloc_id865&op=click">http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user