You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Stefan Selariu <st...@gmail.com> on 2008/06/04 14:04:40 UTC

recursive component

Hi guys!

I need to make generate something like this dynamically:

<div wicket:id="level1"> <!-- node component -->
  <div> <!-- caption -->
    <span wicket:id="text" />
  </div>
  <div style="margin-left: 24px;"> <!-- children -->
    <div wicket:id="level2-1"> <!-- node component -->
      <div> <!-- caption -->
        <a href="#" wicket:id="link">select</a>
      </div>
      <div style="margin-left: 24px;"> <!-- children -->
        <div wicket:id="level3"> <!-- node component -->
          <div> <!-- caption -->
            <span wicket:id="name" />
          </div>
          <div style="margin-left: 24px;"> <!-- children -->
          </div>
        </div>
      </div>
    </div>
    <div wicket:id="level2-2"> <!-- node component -->
      <div> <!-- caption -->
        <span wicket:id="text" />
      </div>
      <div style="margin-left: 24px;"> <!-- children -->
      </div>
    </div>
  </div>
</div>

This is a tree for which every node has a caption and children.
Can I create a wicket component for the tree node that supports my
example?

I need a component that behaves like the Loop but in a recursive way :)

Best regards,
Stefan


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: recursive component

Posted by Stefan Selariu <st...@gmail.com>.
Thanks, I know now where I went wrong.

Best regards,
Stefan

On Wed, 2008-06-04 at 06:16 -0700, Alexis wrote:
> Here's a basic treeview component i use (The backing models contain TreeNode
> objects)
> I made it abstract so the implementors just provide the fragment or panels
> that represent nodes.
> 
> TreeView.java : 
> 
> public abstract class TreeView extends Panel {
>     
>     public TreeView(String markupId, final IModel rootNodeModel) {
>         super(markupId, rootNodeModel);
>         add(new TreeNodeView("node", rootNodeModel));
>     }
>     
>     protected abstract Component newComponentForTreeNodeDescription(ListItem
> markupContainer, String markupId, TreeNode treeNode); 
>     
>     protected abstract Component newComponentForTreeNodeChildren(ListItem
> markupContainer, String markupId, TreeNode treeNode);
>     
>     private class TreeNodeView extends ListView {
>         
>         public TreeNodeView(String markupId, final IModel treeNodeModel) {
>             super(markupId, new LoadableDetachableModel() {
>                 protected Object load() {
>                     TreeNode node = (TreeNode)treeNodeModel.getObject();
>                     List children = node.getChildren();
>                     return children;
>                 };
>             });
>         }
>         
>         @Override
>         protected void populateItem(ListItem item) {
>             TreeNode currentChild = (TreeNode)item.getModelObject();
>             item.setOutputMarkupId(true);
>             item.add(newComponentForTreeNodeDescription(item, "node_desc",
> currentChild));
>             item.add(newComponentForTreeNodeChildren(item, "children",
> currentChild));
>         }
>         
>     }
>     
> }
> 
> TreeView.html :
> 
> <wicket:panel>
> 	<li wicket:id="node">
> 		
> 		<ul wicket:id="children">
> 		</ul>
> 	</li>
> 	<wicket:child/>
> </wicket:panel>
> 
> 
> 
> 
> 
> Stefan Selariu-2 wrote:
> > 
> > Hi guys!
> > 
> > I need to make generate something like this dynamically:
> > 
> > <div wicket:id="level1"> <!-- node component -->
> >   <div> <!-- caption -->
> >     
> >   </div>
> >   <div style="margin-left: 24px;"> <!-- children -->
> >     <div wicket:id="level2-1"> <!-- node component -->
> >       <div> <!-- caption -->
> >          # select 
> >       </div>
> >       <div style="margin-left: 24px;"> <!-- children -->
> >         <div wicket:id="level3"> <!-- node component -->
> >           <div> <!-- caption -->
> >             
> >           </div>
> >           <div style="margin-left: 24px;"> <!-- children -->
> >           </div>
> >         </div>
> >       </div>
> >     </div>
> >     <div wicket:id="level2-2"> <!-- node component -->
> >       <div> <!-- caption -->
> >         
> >       </div>
> >       <div style="margin-left: 24px;"> <!-- children -->
> >       </div>
> >     </div>
> >   </div>
> > </div>
> > 
> > This is a tree for which every node has a caption and children.
> > Can I create a wicket component for the tree node that supports my
> > example?
> > 
> > I need a component that behaves like the Loop but in a recursive way :)
> > 
> > Best regards,
> > Stefan
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> > 
> > 
> > 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: recursive component

Posted by Alexis <al...@gmail.com>.
Here's a basic treeview component i use (The backing models contain TreeNode
objects)
I made it abstract so the implementors just provide the fragment or panels
that represent nodes.

TreeView.java : 

public abstract class TreeView extends Panel {
    
    public TreeView(String markupId, final IModel rootNodeModel) {
        super(markupId, rootNodeModel);
        add(new TreeNodeView("node", rootNodeModel));
    }
    
    protected abstract Component newComponentForTreeNodeDescription(ListItem
markupContainer, String markupId, TreeNode treeNode); 
    
    protected abstract Component newComponentForTreeNodeChildren(ListItem
markupContainer, String markupId, TreeNode treeNode);
    
    private class TreeNodeView extends ListView {
        
        public TreeNodeView(String markupId, final IModel treeNodeModel) {
            super(markupId, new LoadableDetachableModel() {
                protected Object load() {
                    TreeNode node = (TreeNode)treeNodeModel.getObject();
                    List children = node.getChildren();
                    return children;
                };
            });
        }
        
        @Override
        protected void populateItem(ListItem item) {
            TreeNode currentChild = (TreeNode)item.getModelObject();
            item.setOutputMarkupId(true);
            item.add(newComponentForTreeNodeDescription(item, "node_desc",
currentChild));
            item.add(newComponentForTreeNodeChildren(item, "children",
currentChild));
        }
        
    }
    
}

TreeView.html :

<wicket:panel>
	<li wicket:id="node">
		
		<ul wicket:id="children">
		</ul>
	</li>
	<wicket:child/>
</wicket:panel>





Stefan Selariu-2 wrote:
> 
> Hi guys!
> 
> I need to make generate something like this dynamically:
> 
> <div wicket:id="level1"> <!-- node component -->
>   <div> <!-- caption -->
>     
>   </div>
>   <div style="margin-left: 24px;"> <!-- children -->
>     <div wicket:id="level2-1"> <!-- node component -->
>       <div> <!-- caption -->
>          # select 
>       </div>
>       <div style="margin-left: 24px;"> <!-- children -->
>         <div wicket:id="level3"> <!-- node component -->
>           <div> <!-- caption -->
>             
>           </div>
>           <div style="margin-left: 24px;"> <!-- children -->
>           </div>
>         </div>
>       </div>
>     </div>
>     <div wicket:id="level2-2"> <!-- node component -->
>       <div> <!-- caption -->
>         
>       </div>
>       <div style="margin-left: 24px;"> <!-- children -->
>       </div>
>     </div>
>   </div>
> </div>
> 
> This is a tree for which every node has a caption and children.
> Can I create a wicket component for the tree node that supports my
> example?
> 
> I need a component that behaves like the Loop but in a recursive way :)
> 
> Best regards,
> Stefan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/recursive-component-tp17645117p17646533.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: recursive component

Posted by Stefan Selariu <st...@gmail.com>.
I'm sorry but reading that didn't help. I was not able to find the
answer for my problem. Maybe I'm to tired.

If I do this:

<wicket:panel>
	<div wicket:id="sibling"> -- Loop is used here
		<div>
			<div wicket:id="caption"> -- this comes from the page markup
		</div>
		<div>
			<div wicket:id="content" /> -- this comes from the page markup
		</div>
	</div>
</wicket:panel>


Am I able to create pages like this?

<body>
	<div wicket:id="level1"> -- my panel
		<div> -- caption for level1
			<span wicket:id="text" />
			<span wicket:id="text2" />
		</div>
		<div> -- content for level1
			<div wicket:id="level2-1"> -- my panel
				<div> -- caption for level2-1
					<span wicket:id="label" />
				</div>
				<div> -- empty content for level2-1
				</div>
			</div>
			 <div wicket:id="level2-2"> -- my panel
				<div> -- caption for level2-2
					<span wicket:id="text" />
				</div>
				<div> -- content for level2-2
					<table>
					<tr wicket:id="items">
					...
					</tr>
					</table>
				</div>
			</div>
		</div>
	</div>
</body>

My problem is I don't know how to connect the panel instance with the
right caption and content. Each node caption differs not in the data but
also in the layout. And this is available also for the content.

Thanks,
Stefan

On Wed, 2008-06-04 at 14:35 +0200, Martijn Dashorst wrote:
> Yes. you are wrong.
> 
> Read about Models:
> http://cwiki.apache.org/WICKET/working-with-wicket-models.html
> 
> Martijn
> 
> On Wed, Jun 4, 2008 at 2:29 PM, Stefan Selariu <st...@gmail.com> wrote:
> > Thanks for the answers.
> >
> > The only annoying thing is that I have to create a different panel for
> > each node since the captions differ on each level. Or am I wrong?
> >
> > Stefan
> >
> > On Wed, 2008-06-04 at 14:22 +0200, Jan Kriesten wrote:
> >> hi stefan,
> >>
> >> > The think is the markup is required to be like this. The only thing I'd
> >> > like to reduce is the written java code. In short I'd like to create a
> >> > reusable node component that I can configure (with populateCaption() and
> >> > populateChildren() callback methods perhaps) just like the Loop :)
> >>
> >> martijns solution still applies - just make your own panels with the needed
> >> methods?!
> >>
> >> regards, --- jan.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: how to pass parameters while setting page expired error page

Posted by Eyal Golan <eg...@gmail.com>.
have you checked this thread?
http://www.nabble.com/setPageExpiredErrorPage%28PageExpired.class%29--%3E-Login-page-loaded-instead-of-PageExpired-page-td17596262.html#a17596262


On Wed, Jun 4, 2008 at 4:04 PM, Patel, Sanjay <sa...@nemours.org> wrote:
> I want to redirect to LoginPage if session expires and want to show
> message that "your session expired, please login again."
> Is there any way that I can pass parameters to LoginPage ??
>
> getApplicationSettings().setPageExpiredErrorPage(LoginPage.class);
>
> Thanks,
> Sanjay.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Eyal Golan
egolan74@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

RE: how to pass parameters while setting page expired error page

Posted by "Patel, Sanjay " <sa...@NEMOURS.ORG>.
I want to redirect to LoginPage when session expires. If I can pass page
parameter while setting expired page, I can use that parameter in
LoginPage to know that LoginPage is called because of Session is
expired.

 getApplicationSettings().setPageExpiredErrorPage(LoginPage.class, new
PageParameters("pageExpired=true"));

and in LoginPage

...
	public LoginPage(final PageParameters parameters) {		
		super(parameters);
		parameters.getString("pageExpired")

		if(pageExpired == true)
			error("Your session is Expired. Pleae login
again.", this);
		...
	}
...


-----Original Message-----
From: Patel, Sanjay [mailto:sapatel@NEMOURS.ORG] 
Sent: Wednesday, June 04, 2008 12:26 PM
To: users@wicket.apache.org
Subject: RE: how to pass parameters while setting page expired error
page

I want to pass some param so I can know in LoginPage that it is called
because of session expired and I can show appropriate message (e.g your
session is expired, please login again.)

-----Original Message-----
From: Johan Compagner [mailto:jcompagner@gmail.com]
Sent: Wednesday, June 04, 2008 12:11 PM
To: users@wicket.apache.org
Subject: Re: how to pass parameters while setting page expired error
page

What param is that? What info do you want to pass in?



On 6/4/08, Patel, Sanjay <sa...@nemours.org> wrote:
> I want to redirect to LoginPage if session expires and want to show 
> message that "your session expired, please login again."
> Is there any way that I can pass parameters to LoginPage ??
>
> getApplicationSettings().setPageExpiredErrorPage(LoginPage.class);
>
> Thanks,
> Sanjay.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: how to pass parameters while setting page expired error page

Posted by James Carman <ja...@carmanconsulting.com>.
getSession().info() and add a FeedbackPanel to your login page?

On Wed, Jun 4, 2008 at 12:25 PM, Patel, Sanjay <sa...@nemours.org> wrote:
> I want to pass some param so I can know in LoginPage that it is called
> because of session expired and I can show appropriate message (e.g your
> session is expired, please login again.)
>
> -----Original Message-----
> From: Johan Compagner [mailto:jcompagner@gmail.com]
> Sent: Wednesday, June 04, 2008 12:11 PM
> To: users@wicket.apache.org
> Subject: Re: how to pass parameters while setting page expired error
> page
>
> What param is that? What info do you want to pass in?
>
>
>
> On 6/4/08, Patel, Sanjay <sa...@nemours.org> wrote:
>> I want to redirect to LoginPage if session expires and want to show
>> message that "your session expired, please login again."
>> Is there any way that I can pass parameters to LoginPage ??
>>
>> getApplicationSettings().setPageExpiredErrorPage(LoginPage.class);
>>
>> Thanks,
>> Sanjay.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: how to pass parameters while setting page expired error page

Posted by "Patel, Sanjay " <sa...@NEMOURS.ORG>.
That's what I am doing right now. I was just wondering if there is
another way so there is no need to create another page just to add one
line (info(xxx)). 

Thanks for your time.
Sanjay.

-----Original Message-----
From: Johan Compagner [mailto:jcompagner@gmail.com] 
Sent: Thursday, June 05, 2008 3:39 AM
To: users@wicket.apache.org
Subject: Re: how to pass parameters while setting page expired error
page

class SessionExpiredLoginPage extends LoginPage() {
    SessionExpiredLoginPage()
   {
            super();
            info(xxxxxx)
   }
}


On Wed, Jun 4, 2008 at 6:25 PM, Patel, Sanjay <sa...@nemours.org>
wrote:

> I want to pass some param so I can know in LoginPage that it is called

> because of session expired and I can show appropriate message (e.g 
> your session is expired, please login again.)
>
> -----Original Message-----
> From: Johan Compagner [mailto:jcompagner@gmail.com]
> Sent: Wednesday, June 04, 2008 12:11 PM
> To: users@wicket.apache.org
> Subject: Re: how to pass parameters while setting page expired error 
> page
>
> What param is that? What info do you want to pass in?
>
>
>
> On 6/4/08, Patel, Sanjay <sa...@nemours.org> wrote:
> > I want to redirect to LoginPage if session expires and want to show 
> > message that "your session expired, please login again."
> > Is there any way that I can pass parameters to LoginPage ??
> >
> > getApplicationSettings().setPageExpiredErrorPage(LoginPage.class);
> >
> > Thanks,
> > Sanjay.
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: how to pass parameters while setting page expired error page

Posted by Johan Compagner <jc...@gmail.com>.
class SessionExpiredLoginPage extends LoginPage()
{
    SessionExpiredLoginPage()
   {
            super();
            info(xxxxxx)
   }
}


On Wed, Jun 4, 2008 at 6:25 PM, Patel, Sanjay <sa...@nemours.org> wrote:

> I want to pass some param so I can know in LoginPage that it is called
> because of session expired and I can show appropriate message (e.g your
> session is expired, please login again.)
>
> -----Original Message-----
> From: Johan Compagner [mailto:jcompagner@gmail.com]
> Sent: Wednesday, June 04, 2008 12:11 PM
> To: users@wicket.apache.org
> Subject: Re: how to pass parameters while setting page expired error
> page
>
> What param is that? What info do you want to pass in?
>
>
>
> On 6/4/08, Patel, Sanjay <sa...@nemours.org> wrote:
> > I want to redirect to LoginPage if session expires and want to show
> > message that "your session expired, please login again."
> > Is there any way that I can pass parameters to LoginPage ??
> >
> > getApplicationSettings().setPageExpiredErrorPage(LoginPage.class);
> >
> > Thanks,
> > Sanjay.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

RE: how to pass parameters while setting page expired error page

Posted by "Patel, Sanjay " <sa...@NEMOURS.ORG>.
I want to pass some param so I can know in LoginPage that it is called
because of session expired and I can show appropriate message (e.g your
session is expired, please login again.)

-----Original Message-----
From: Johan Compagner [mailto:jcompagner@gmail.com] 
Sent: Wednesday, June 04, 2008 12:11 PM
To: users@wicket.apache.org
Subject: Re: how to pass parameters while setting page expired error
page

What param is that? What info do you want to pass in?



On 6/4/08, Patel, Sanjay <sa...@nemours.org> wrote:
> I want to redirect to LoginPage if session expires and want to show 
> message that "your session expired, please login again."
> Is there any way that I can pass parameters to LoginPage ??
>
> getApplicationSettings().setPageExpiredErrorPage(LoginPage.class);
>
> Thanks,
> Sanjay.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: how to pass parameters while setting page expired error page

Posted by Johan Compagner <jc...@gmail.com>.
What param is that? What info do you want to pass in?



On 6/4/08, Patel, Sanjay <sa...@nemours.org> wrote:
> I want to redirect to LoginPage if session expires and want to show
> message that "your session expired, please login again."
> Is there any way that I can pass parameters to LoginPage ??
>
> getApplicationSettings().setPageExpiredErrorPage(LoginPage.class);
>
> Thanks,
> Sanjay.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: how to pass parameters while setting page expired error page

Posted by James Carman <ja...@carmanconsulting.com>.
Or in the session as sort of a "flash" memory.

On Wed, Jun 4, 2008 at 10:53 AM, Ryan Gravener <ry...@ryangravener.com> wrote:
> I haven't had to deal with this issue yet, but perhaps you can put this
> information in a cookie and read it when necessary?
>
> On Wed, Jun 4, 2008 at 9:04 AM, Patel, Sanjay <sa...@nemours.org> wrote:
>
>> I want to redirect to LoginPage if session expires and want to show
>> message that "your session expired, please login again."
>> Is there any way that I can pass parameters to LoginPage ??
>>
>> getApplicationSettings().setPageExpiredErrorPage(LoginPage.class);
>>
>> Thanks,
>> Sanjay.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Ryan Gravener
> http://twitter.com/ryangravener
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: how to pass parameters while setting page expired error page

Posted by Ryan Gravener <ry...@ryangravener.com>.
I haven't had to deal with this issue yet, but perhaps you can put this
information in a cookie and read it when necessary?

On Wed, Jun 4, 2008 at 9:04 AM, Patel, Sanjay <sa...@nemours.org> wrote:

> I want to redirect to LoginPage if session expires and want to show
> message that "your session expired, please login again."
> Is there any way that I can pass parameters to LoginPage ??
>
> getApplicationSettings().setPageExpiredErrorPage(LoginPage.class);
>
> Thanks,
> Sanjay.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Ryan Gravener
http://twitter.com/ryangravener

how to pass parameters while setting page expired error page

Posted by "Patel, Sanjay " <sa...@NEMOURS.ORG>.
I want to redirect to LoginPage if session expires and want to show
message that "your session expired, please login again."
Is there any way that I can pass parameters to LoginPage ??

getApplicationSettings().setPageExpiredErrorPage(LoginPage.class);

Thanks,
Sanjay.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: recursive component

Posted by Martijn Dashorst <ma...@gmail.com>.
Yes. you are wrong.

Read about Models:
http://cwiki.apache.org/WICKET/working-with-wicket-models.html

Martijn

On Wed, Jun 4, 2008 at 2:29 PM, Stefan Selariu <st...@gmail.com> wrote:
> Thanks for the answers.
>
> The only annoying thing is that I have to create a different panel for
> each node since the captions differ on each level. Or am I wrong?
>
> Stefan
>
> On Wed, 2008-06-04 at 14:22 +0200, Jan Kriesten wrote:
>> hi stefan,
>>
>> > The think is the markup is required to be like this. The only thing I'd
>> > like to reduce is the written java code. In short I'd like to create a
>> > reusable node component that I can configure (with populateCaption() and
>> > populateChildren() callback methods perhaps) just like the Loop :)
>>
>> martijns solution still applies - just make your own panels with the needed
>> methods?!
>>
>> regards, --- jan.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: recursive component

Posted by Stefan Selariu <st...@gmail.com>.
Thanks for the answers.

The only annoying thing is that I have to create a different panel for
each node since the captions differ on each level. Or am I wrong?

Stefan

On Wed, 2008-06-04 at 14:22 +0200, Jan Kriesten wrote:
> hi stefan,
> 
> > The think is the markup is required to be like this. The only thing I'd
> > like to reduce is the written java code. In short I'd like to create a
> > reusable node component that I can configure (with populateCaption() and
> > populateChildren() callback methods perhaps) just like the Loop :)
> 
> martijns solution still applies - just make your own panels with the needed 
> methods?!
> 
> regards, --- jan.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: recursive component

Posted by Jan Kriesten <ja...@renitence.de>.
hi stefan,

> The think is the markup is required to be like this. The only thing I'd
> like to reduce is the written java code. In short I'd like to create a
> reusable node component that I can configure (with populateCaption() and
> populateChildren() callback methods perhaps) just like the Loop :)

martijns solution still applies - just make your own panels with the needed 
methods?!

regards, --- jan.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: recursive component

Posted by Stefan Selariu <st...@gmail.com>.
Some corrections :)

I don't need to generate wicket markup.
The example is the desirable wicket markup that will support the
dynamical generation.
Each node component is thought as a Loop.

The think is the markup is required to be like this. The only thing I'd
like to reduce is the written java code. In short I'd like to create a
reusable node component that I can configure (with populateCaption() and
populateChildren() callback methods perhaps) just like the Loop :)

The node structure is fixed:
<div>
        <div>
                -- caption components --
        </div>
        <div style="margin-left: 24px;">
                -- children components --
        </div>
</div>

I hope I was clearer this time :D

Stefan

On Wed, 2008-06-04 at 15:04 +0300, Stefan Selariu wrote:
> Hi guys!
> 
> I need to make generate something like this dynamically:
> 
> <div wicket:id="level1"> <!-- node component -->
>   <div> <!-- caption -->
>     <span wicket:id="text" />
>   </div>
>   <div style="margin-left: 24px;"> <!-- children -->
>     <div wicket:id="level2-1"> <!-- node component -->
>       <div> <!-- caption -->
>         <a href="#" wicket:id="link">select</a>
>       </div>
>       <div style="margin-left: 24px;"> <!-- children -->
>         <div wicket:id="level3"> <!-- node component -->
>           <div> <!-- caption -->
>             <span wicket:id="name" />
>           </div>
>           <div style="margin-left: 24px;"> <!-- children -->
>           </div>
>         </div>
>       </div>
>     </div>
>     <div wicket:id="level2-2"> <!-- node component -->
>       <div> <!-- caption -->
>         <span wicket:id="text" />
>       </div>
>       <div style="margin-left: 24px;"> <!-- children -->
>       </div>
>     </div>
>   </div>
> </div>
> 
> This is a tree for which every node has a caption and children.
> Can I create a wicket component for the tree node that supports my
> example?
> 
> I need a component that behaves like the Loop but in a recursive way :)
> 
> Best regards,
> Stefan
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: recursive component

Posted by Martijn Dashorst <ma...@gmail.com>.
RecursivePanel extends Panel {
    public RecursivePanel() {
        if(somecondition) add(new RecursivePanel("recurse"));
        else add(new EmptyPanel("recurse"));
    }
}

<wicket:panel>
    <span wicket:id="recurse"></span>
</wicket:panel>

Martijn

On Wed, Jun 4, 2008 at 2:04 PM, Stefan Selariu <st...@gmail.com> wrote:
> Hi guys!
>
> I need to make generate something like this dynamically:
>
> <div wicket:id="level1"> <!-- node component -->
>  <div> <!-- caption -->
>    <span wicket:id="text" />
>  </div>
>   <div style="margin-left: 24px;"> <!-- children -->
>     <div wicket:id="level2-1"> <!-- node component -->
>      <div> <!-- caption -->
>        <a href="#" wicket:id="link">select</a>
>      </div>
>       <div style="margin-left: 24px;"> <!-- children -->
>         <div wicket:id="level3"> <!-- node component -->
>          <div> <!-- caption -->
>            <span wicket:id="name" />
>          </div>
>          <div style="margin-left: 24px;"> <!-- children -->
>          </div>
>        </div>
>      </div>
>    </div>
>     <div wicket:id="level2-2"> <!-- node component -->
>      <div> <!-- caption -->
>        <span wicket:id="text" />
>      </div>
>       <div style="margin-left: 24px;"> <!-- children -->
>      </div>
>    </div>
>  </div>
> </div>
>
> This is a tree for which every node has a caption and children.
> Can I create a wicket component for the tree node that supports my
> example?
>
> I need a component that behaves like the Loop but in a recursive way :)
>
> Best regards,
> Stefan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3