Re: How do I get the current page?

2015-01-02 Thread Martijn Dashorst
if(item.getModelObject().getDestPage().equals(getPage().getClass())) {
item.add(AttributeModifier.append(class, active));
}

Martijn


On Tue, Dec 30, 2014 at 7:48 PM, K kondetiudayki...@gmail.com wrote:
 Hi Aksarben

 i have a web application in which there are six links in main menu. i want
 my app to highlight the link that is selected.

 http://apache-wicket.1842946.n4.nabble.com/file/n4668907/Capture.png

 My code:


 ListHeaderListItems  is list of pojo item. my pojo has two fields
 label(String) and destPage(Class)

 My Mark-up:




 -
 K
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/How-do-I-get-the-current-page-tp1851661p4668907.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




-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

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



Re: How do I get the current page?

2014-12-30 Thread K
Hi i am working on the same thing and i have not been able to achieve the
desired outcome. 

i would appericiate any suggestions. i have posted complete details here

http://apache-wicket.1842946.n4.nabble.com/current-page-highlighting-td4668902.html
http://apache-wicket.1842946.n4.nabble.com/current-page-highlighting-td4668902.html
  

Thanks.

-
K
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-do-I-get-the-current-page-tp1851661p4668903.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 do I get the current page?

2014-12-30 Thread Richard W. Adams
Not inclined to click on untrusted links, for security reasons. When you 
say get the current page, where do you want to get it FROM? If you're in 
the page code itself, it's just this. If you want it from somewhere 
else, describe what you're trying to achieve.




From:   K kondetiudayki...@gmail.com
To: users@wicket.apache.org
Date:   12/30/2014 09:58 AM
Subject:Re: How do I get the current page?



Hi i am working on the same thing and i have not been able to achieve the
desired outcome. 

i would appericiate any suggestions. i have posted complete details here

http://apache-wicket.1842946.n4.nabble.com/current-page-highlighting-td4668902.html


http://apache-wicket.1842946.n4.nabble.com/current-page-highlighting-td4668902.html
 

Thanks.

-
K
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-do-I-get-the-current-page-tp1851661p4668903.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




**

This email and any attachments may contain information that is confidential 
and/or privileged for the sole use of the intended recipient.  Any use, review, 
disclosure, copying, distribution or reliance by others, and any forwarding of 
this email or its contents, without the express permission of the sender is 
strictly prohibited by law.  If you are not the intended recipient, please 
contact the sender immediately, delete the e-mail and destroy all copies.
**


Re: How do I get the current page?

2014-12-30 Thread K
Hi Aksarben

i have a web application in which there are six links in main menu. i want
my app to highlight the link that is selected.

http://apache-wicket.1842946.n4.nabble.com/file/n4668907/Capture.png 

My code:


ListHeaderListItems  is list of pojo item. my pojo has two fields
label(String) and destPage(Class) 

My Mark-up: 

   


-
K
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-do-I-get-the-current-page-tp1851661p4668907.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



How do I get the current page?

2007-11-06 Thread maentele

Hi everyone.
I am quite new to Wicket but I start to really like it ;-)
I have a problem on which I spent several hours of research and trying but
it wouldn't solve.

I have a navigation in which the navigationlinks have to be dynamically
added (dependent on which rights the logged-in user has). So I used a
ListView which uses a LoadableDetachableModel to define which links to add
to the navigation.

...
_li wicket:id=itemList
  _a class=menuItem wicket:id=menuListItem
_span wicket:id=itemName[itemName]_/span
  _/a
_/li
...

The current page shall have an other CSS-class (activeMenuItem) .
Therefore the navigation has to know, which page is the current one.

...
if (menuItem.getPage().equals(currentPage)) {
  page.add(new AttributeModifier(class, true, new
Model(activeMenuItem)));
}
...

My question/problem is: how do I get the currentPage (the currently active
link)?


I hope the description of the problem is sufficient.

Greetings from Germany
Thomas Jaeckle
-- 
View this message in context: 
http://www.nabble.com/How-do-I-get-the-current-page--tf4758474.html#a13607965
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How do I get the current page?

2007-11-06 Thread Al Maw

maentele wrote:

My question/problem is: how do I get the currentPage (the currently active
link)?


Just call Component#getPage()

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How do I get the current page?

2007-11-06 Thread thomas jaeckle


Al Maw wrote:
 
 Just call Component#getPage()
 

Shame on me ...
I thought I tried that once and it didn't work back then ...
Looks like I did something wrong.

Tanks very much, Al


Thomas Jaeckle
-- 
View this message in context: 
http://www.nabble.com/How-do-I-get-the-current-page--tf4758474.html#a13608876
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How do I get the current page?

2007-11-06 Thread Martijn Dashorst
It doesn't work until after adding the component to the page.

Martijn

On 11/6/07, thomas jaeckle [EMAIL PROTECTED] wrote:


 Al Maw wrote:
 
  Just call Component#getPage()
 

 Shame on me ...
 I thought I tried that once and it didn't work back then ...
 Looks like I did something wrong.

 Tanks very much, Al


 Thomas Jaeckle
 --
 View this message in context: 
 http://www.nabble.com/How-do-I-get-the-current-page--tf4758474.html#a13608876
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta4/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How do I get the current page?

2007-11-06 Thread Al Maw

Martijn Dashorst wrote:

It doesn't work until after adding the component to the page.


This is true.

So you need something like this (I've modified your variable names to 
make it more obvious what is what):


pageLink.add(new AttributeModifier(class, true,
new AbstractReadOnlyModel() {
public Object getObject() {
return
getPage().getClass().equals(menuItem.getPageClass())
? activeMenuItem
: AttributeModifier.VALUELESS_ATTRIBUTE_REMOVE;
}
}
);

Probably. ;-)

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]