Re: can't set 'id' attribute to tr tag

2009-04-19 Thread Khlystov Alexandr


Resolved by myself. I just need to add other elements for listView item 
under the new WebMarkupContainer.


Thanks, Igor.

Khlystov Alexandr пишет:

Error:

WicketMessage: Unable to find component with id 'id' in 
[MarkupContainer [Component id = idTr]]. This means that you declared 
wicket:id=id in your markup, but that you either did not add the 
component to your page at all, or that the hierarchy does not match.



Code:

JAVA: (colored code here: http://rafb.net/p/D9Hg5838.html)
HTML: (http://rafb.net/p/pAao6a88.html)

JAVA plain:
@AuthorizeInstantiation(ADMIN)
public class AdminNavPage extends ThreeColumnBasePage {

@SpringBean(name=navigationManager)
private NavigationManager navigationManager;

public AdminNavPage() {
super();
HashMapString, String hashMap = new HashMapString, String();
hashMap.put(date, new Date().toString());
add(new Label(labelText, new StringResourceModel(parametrizedText, 
this,

new Model(new Simple();
ListNavItem usersNavList = 
navigationManager.getNavigation(NavigationType.ALL);


//TODO implement the list VIEW
add(new ListView(listview, usersNavList) {
@Override
protected void populateItem(ListItem item) {
final NavItem navItem = (NavItem) item.getModelObject();
item.add(new WebMarkupContainer(idTr){

@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
tag.put(id, rowId+navItem.getId());
}
});
item.add(new Label(id, navItem.getId()+));
item.add(new TextLink(name, new Model(navItem.getName())){
@Override
public void onClick() {
setResponsePage(navItem.getPageClass());
}
});
item.add(new Label(order, navItem.getOrder()+));
}
});
}

static class Simple implements Serializable {
private String date = new Date().toString();
Simple() {
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
}
}

HTML plain:
?xml version=1.0 encoding=UTF-8 ?
!-- $Id: NavigationPage.html 69 2009-04-11 19:09:47Z akhlystov $ --
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;


html xmlns=http://www.w3.org/1999/xhtml; 
xmlns:wicket=http://wicket.sourceforge.net/;

xml:lang=en lang=en

head
/head
body
wicket:extend

div class=mainCenterTable
table width=100% cellpadding=10px cellspacing=0px border=0px
tr
tdspan wicket:id=labelText/span


div class=horLine/div

table class=buttonsTable cellpadding=0px cellspacing=0px 
border=0px

tr
td
div class=buttonsTableDiv
div class=tableGroupButtonLeftinput id=actionAdd
class=buttonInactive type=button value=Add
onmouseout=changeC(this.id,'buttonInactive');
onmouseover=changeC(this.id,'buttonActive'); //div

div class=tableGroupButtonRightinput id=actionDisable
class=buttonInactive type=button value=Remove
onmouseout=changeC(this.id,'buttonInactive');
onmouseover=changeC(this.id,'buttonActive'); //div
/div
/td
/tr
/table

div class=horLine/div

table class=itemsTable cellpadding=0px cellspacing=2px 
border=0px

tr class=itemsTableHeaderTr
td class=itemsTableHeaderTdSysteminput type=checkbox
class=tableCheckbox/input/td
td class=itemsTableHeaderTd width20percenta href=#Header 
1/aimg

src=images/list/listHeaderArrowDown.gif //td
td class=itemsTableHeaderTd width20percenta href=#Header 
2/aimg

src=images/list/listHeaderArrowUp.gif //td
td class=itemsTableHeaderTd width60percenta href=#Header 
3/a/td

!-- tdnbsp;/td just for correct width percent --
/tr
tr
td class=rowHeaderLine /
td class=rowHeaderLine /
td class=rowHeaderLine /
td class=rowHeaderLine /
/tr
wicket:container wicket:id=listview
tr wicket:id=idTr id=row4 class=itemsTableTr 
onmouseover=changeLC(this.id,1);

onmouseout=changeLC(this.id,0);
td class=itemsTableTdSysteminput type=checkbox 
class=tableCheckbox/input/td

td wicket:id=id class=itemsTableTdItem 32 id/td
td class=itemsTableTda wicket:id=name href=# Item 32 
caption/a/td

td wicket:id=order class=itemsTableTdItem 32 status/td
/tr
tr
td class=rowLine /
td class=rowLine /
td class=rowLine /
td class=rowLine /
/tr
/wicket:container
/table

div class=horLine/div

/td
/tr
/table
/div
/wicket:extend
/body
/html


it should be webmarkupcontainer, and it should work just fine. paste
your complete code with markup and markupcontainer for the whole
page/panel.

-igor

On Sat, Apr 18, 2009 at 4:03 AM, Khlystov Alexandr a...@ovservice.org 
wrote:

Hello again!

I can't set 'id' attribute to the tr tag:

WicketMessage: Expected close tag for tr id=rowId1
onmouseout=changeLC(this.id,0); class=itemsTableTr wicket:id=idTr
onmouseover=changeLC(this.id,1);

JAVA:
add(new ListView(listview, usersNavList) {
@Override
protected void populateItem(ListItem item) {
final NavItem navItem = (NavItem) item.getModelObject();
item.add(new WebComponent(idTr){

@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
tag.put(id, rowId+navItem.getId());
}
});
...

HTML:
wicket:container wicket:id=listview
tr wicket:id=idTr id=row4 class=itemsTableTr
onmouseover=changeLC(this.id,1);

Re: LinkTree breaks when using twice instances of Firefox (with Unexpected RuntimeException)

2009-04-19 Thread Live Nono
hi

In case some one is interested, i found the solution : adding
getPageSettings().setAutomaticMultiWindowSupport(true); solves the
issue.

I'm quite surprised though because the javadocs of this setting says
it's enabled by default, which doesn't seem to be the case in fact.
Should I open a jira issue for this ?

bye
nono




2009/4/18 Live Nono liven...@gmail.com:
 Hi

 I've just spotted the same behavior within the wicket examples page
 itself, there :
 http://www.wicket-library.com/wicket-examples/ajax/tree/simple.1

 Open two tabs/windows of the same browser and then play with the tree
 in one page and then the others, then it'll fail internal error it
 says...

 In fact the state of the tree seems to be shared among the two pages :
 do some changes on one page and then refresh the other page (with F5),
 it'll have the state of the previous one.

 Is it an expected behavior for you ? If so, could someone tell me why
 and if it's possible to avoid it ?

 thanks in advance
 nono

 2009/4/17, Live Nono liven...@gmail.com:
 Hi

 I'm still working on this tree need and I've discovered this issue :
 - opening the page tree in Firefox (or Iceweasel in my ubuntu)
 - navigating the tree
 - opening the page tree in another tab or instance of firefox
 - navigating the tree in this second instance
 - when willing again to navigate in the first page, it breaks with an
 Unexpected RuntimeException

 However, browsing in 2 different browsers at the same time isn't an
 issue (at least with Iceweasel and epiphany, the gnome web browser).
 When using 2 epiphany (tabs or instances) at the same time, the issue
 is the same.

 My detailed config is Mozilla/5.0 (X11; U; Linux i686; en-US;
 rv:1.9.0.7) Gecko/2009032803 Iceweasel/3.0.6 (Debian-3.0.6-1) with
 iceweasel 3.0.6 and epiphany/gnome web browser 2.22.3

 The page in question is heavy on the Ajax side, so perhaps it isn't
 directly TreeLink related.

 Am I missing something or... ?

 Thanks in advance
 nono



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



remember me at login page feature

2009-04-19 Thread Khlystov Alexandr


Good day.

Can anyone, please, give an example, or direct wicket API description 
about remember me at login page feature.


Thanks in advance.

--
Khlystov Alexandr


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



Re: remember me at login page feature

2009-04-19 Thread Martin Makundi
 Can anyone, please, give an example, or direct wicket API description about
 remember me at login page feature.

Are you familiar with regular wicket authentication?

In remember me you just use e.g., a cookie id to load the user's
credentials from db.

Nothing special.

  private static Cookie getCookie(String cookieName) {
WebRequestCycle requestCycle = (WebRequestCycle) RequestCycle.get();
WebRequest webRequest = (WebRequest) requestCycle.getRequest();
Cookie cookie = webRequest.getCookie(cookieName);
if (cookie == null) {
  MapString, Cookie cookieMap = threadlocalJUnitTestCookies.get();
  cookie = (cookieMap != null) ? cookieMap.get(cookieName) : null;
} else if (threadlocalJUnitTestCookies.get() != null) {
  /*
   * We had not yet found a way to support cookies in JUnit testing.
   * threadlocalJUnitTestCookies should not have a value when webRequest
   * contains cookies.
   */
  throw new IllegalStateException();
}
return cookie;
  }

  /**
   * @param user
   */
  public static void bindAuthorizationCookie(Person user) {
// Fetch current cookie
Cookie cookie = getAuthorizationCookie();

String encryptedValue;
// Check if session already has the user id
Long cookiePersonId = TakpAuthorizationStrategy.parsePersonId(cookie);

// Check if the previous id was the current user id
if ((cookiePersonId != null)  (cookiePersonId.equals(user.getId( {
  // Reset the cookie id if it was the current user
  encryptedValue = -1;
} else {
  // If it was some other user, keep it as it is
  return;
}

// Check if the user already has an authorization cookie
if (cookie == null) {
  // Set new cookie into user response
  cookie = new Cookie(AUTHORIZATION_COOKIE, encryptedValue);
} else {
  // Update the authorization key
  cookie.setValue(encryptedValue);
}

cookie.setMaxAge(AUTHORIZATION_COOKIE_EXPIRATION);
cookie.setPath(/);
setCookie(cookie);
  }


**
Martin



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



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



Re: remember me at login page feature

2009-04-19 Thread Khlystov Alexandr


Thanks, for reply Martin!

Yes I use wicket authentication, my app:
public class HelloWebApplication extends AuthenticatedWebApplication {

As I see it is manual operation, and wicket doesn't support this in API.

Than I should manually create encryptedKey, and set it to cookie value, 
and be able to recognize it, yes?


If so, could you please provide more code on your 
TakpAuthorizationStrategy class ( registration and implementation)


2nd question is:
In order to use your code I need redirect not logged user with defined 
remember me cookie from LoginPage to desired page, instead of showing 
the LoginPage. But is it possible change this behavior: redirecting not 
logged user from base page to login page and then back to base page.TO 
THIS: login user automatically in some interceptor when trying to access 
base page (without redirecting to LoginPage).


Martin Makundi пишет:

Can anyone, please, give an example, or direct wicket API description about
remember me at login page feature.



Are you familiar with regular wicket authentication?

In remember me you just use e.g., a cookie id to load the user's
credentials from db.

Nothing special.

  private static Cookie getCookie(String cookieName) {
WebRequestCycle requestCycle = (WebRequestCycle) RequestCycle.get();
WebRequest webRequest = (WebRequest) requestCycle.getRequest();
Cookie cookie = webRequest.getCookie(cookieName);
if (cookie == null) {
  MapString, Cookie cookieMap = threadlocalJUnitTestCookies.get();
  cookie = (cookieMap != null) ? cookieMap.get(cookieName) : null;
} else if (threadlocalJUnitTestCookies.get() != null) {
  /*
   * We had not yet found a way to support cookies in JUnit testing.
   * threadlocalJUnitTestCookies should not have a value when webRequest
   * contains cookies.
   */
  throw new IllegalStateException();
}
return cookie;
  }

  /**
   * @param user
   */
  public static void bindAuthorizationCookie(Person user) {
// Fetch current cookie
Cookie cookie = getAuthorizationCookie();

String encryptedValue;
// Check if session already has the user id
Long cookiePersonId = TakpAuthorizationStrategy.parsePersonId(cookie);

// Check if the previous id was the current user id
if ((cookiePersonId != null)  (cookiePersonId.equals(user.getId( {
  // Reset the cookie id if it was the current user
  encryptedValue = -1;
} else {
  // If it was some other user, keep it as it is
  return;
}

// Check if the user already has an authorization cookie
if (cookie == null) {
  // Set new cookie into user response
  cookie = new Cookie(AUTHORIZATION_COOKIE, encryptedValue);
} else {
  // Update the authorization key
  cookie.setValue(encryptedValue);
}

cookie.setMaxAge(AUTHORIZATION_COOKIE_EXPIRATION);
cookie.setPath(/);
setCookie(cookie);
  }


**
Martin

  

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





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



  



--
Khlystov Alexandr


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



Re: remember me at login page feature

2009-04-19 Thread Martin Makundi
 If so, could you please provide more code on your TakpAuthorizationStrategy
 class ( registration and implementation)

All significant part is there, rest is confidential.

 In order to use your code I need redirect not logged user with defined
 remember me cookie from LoginPage to desired page, instead of showing the
 LoginPage. But is it possible change this behavior: redirecting not logged
 user from base page to login page and then back to base page.TO THIS: login
 user automatically in some interceptor when trying to access base page
 (without redirecting to LoginPage).

If remember me the user is remembered, then login is not necessary
at all. Otherwise, normal login interception applies. There is a good
example in Pro wicket pdf book, you can find it online.

**
Martin

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



Submitting form via Ajax isn't working

2009-04-19 Thread HHB
Hey,
I have a form and I want to submit it via Ajax:

wicket:panel
form wicket:id=form
div wicket:id=feedback/div
table width=100% cellpadding=2 cellspacing=2
tr
tdlabelwicket:message key=name/
/label/td
tdspan wicket:id=nameBorder
input type=text wicket:id=name//span/td
/tr
tr
tdwicket:message key=note//td
tdtextarea cols=20 rows=10 
wicket:id=note/textarea/td
/tr
tr
td colspan=2
input wicket:id=create type=button value=Create Group//td
/tr
/table
/form
/wicket:panel

public CreateGroupPanel(String id) {
super(id);
setOutputMarkupId(true);
final Form form = new Form(form, 
new CompoundPropertyModel(new Group()));
add(form);
form.add(new FeedbackPanel(feedback));
form.add(new 
FormComponentFeedbackBorder(nameBorder).add(new
TextField(name).setRequired(true)));
form.add(new TextArea(note));
form.add(new AjaxSubmitLink(create) {
@Override
protected void onSubmit(AjaxRequestTarget target, 
Form form) {
Group group = (Group) form.getModelObject();
System.out.println(Logging:  + group);
}
});
}

But nothing is got print on the console.
Any ideas what is going wrong?
FireFox 3.0.7
Ubuntu 8.10
Wicket 1.3.5
Thanks.


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



Re: Submitting form via Ajax isn't working

2009-04-19 Thread Martin Makundi
You should implement the onError method of the button and update
feedback panel to see possible validation errors.

**
Martin

2009/4/19 HHB hubaghd...@yahoo.ca:
 Hey,
 I have a form and I want to submit it via Ajax:

 wicket:panel
form wicket:id=form
div wicket:id=feedback/div
table width=100% cellpadding=2 cellspacing=2
tr
tdlabelwicket:message key=name/
 /label/td
tdspan wicket:id=nameBorder
 input type=text wicket:id=name//span/td
/tr
tr
tdwicket:message key=note//td
tdtextarea cols=20 rows=10 
 wicket:id=note/textarea/td
/tr
tr
td colspan=2
 input wicket:id=create type=button value=Create Group//td
/tr
/table
/form
 /wicket:panel

public CreateGroupPanel(String id) {
super(id);
setOutputMarkupId(true);
final Form form = new Form(form,
 new CompoundPropertyModel(new Group()));
add(form);
form.add(new FeedbackPanel(feedback));
form.add(new
 FormComponentFeedbackBorder(nameBorder).add(new
 TextField(name).setRequired(true)));
form.add(new TextArea(note));
form.add(new AjaxSubmitLink(create) {
@Override
protected void onSubmit(AjaxRequestTarget target,
 Form form) {
Group group = (Group) form.getModelObject();
System.out.println(Logging:  + group);
}
});
}

 But nothing is got print on the console.
 Any ideas what is going wrong?
 FireFox 3.0.7
 Ubuntu 8.10
 Wicket 1.3.5
 Thanks.


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



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



Re: Submitting form via Ajax isn't working

2009-04-19 Thread Clint Popetz
All looks good to me, my guess is that you aren't entering in a name,
and so you're failing validation, but you haven't implemented onError
to add the feedback panel to the target in that  case.  Also, your
feedback panel probably needs setOutputMarkupId(true) to be of any
use, given that you're submitting with ajax.

-Clint

On Sun, Apr 19, 2009 at 9:11 AM, HHB hubaghd...@yahoo.ca wrote:
 Hey,
 I have a form and I want to submit it via Ajax:

 wicket:panel
    form wicket:id=form
        div wicket:id=feedback/div
        table width=100% cellpadding=2 cellspacing=2
            tr
                tdlabelwicket:message key=name/
 /label/td
                tdspan wicket:id=nameBorder
 input type=text wicket:id=name//span/td
            /tr
            tr
                tdwicket:message key=note//td
                tdtextarea cols=20 rows=10 
 wicket:id=note/textarea/td
            /tr
            tr
                td colspan=2
 input wicket:id=create type=button value=Create Group//td
            /tr
        /table
    /form
 /wicket:panel

    public CreateGroupPanel(String id) {
        super(id);
        setOutputMarkupId(true);
        final Form form = new Form(form,
 new CompoundPropertyModel(new Group()));
        add(form);
        form.add(new FeedbackPanel(feedback));
        form.add(new
 FormComponentFeedbackBorder(nameBorder).add(new
 TextField(name).setRequired(true)));
        form.add(new TextArea(note));
        form.add(new AjaxSubmitLink(create) {
           �...@override
            protected void onSubmit(AjaxRequestTarget target,
 Form form) {
                Group group = (Group) form.getModelObject();
                System.out.println(Logging:  + group);
            }
        });
    }

 But nothing is got print on the console.
 Any ideas what is going wrong?
 FireFox 3.0.7
 Ubuntu 8.10
 Wicket 1.3.5
 Thanks.


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



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



Re: Submitting form via Ajax isn't working

2009-04-19 Thread HHB

Yes, you are right.
My isssue is solved now, thanks.


cpopetz wrote:
 
 All looks good to me, my guess is that you aren't entering in a name,
 and so you're failing validation, but you haven't implemented onError
 to add the feedback panel to the target in that  case.  Also, your
 feedback panel probably needs setOutputMarkupId(true) to be of any
 use, given that you're submitting with ajax.
 
 -Clint
 
 On Sun, Apr 19, 2009 at 9:11 AM, HHB hubaghd...@yahoo.ca wrote:
 Hey,
 I have a form and I want to submit it via Ajax:

 wicket:panel
    form wicket:id=form
        div wicket:id=feedback/div
        table width=100% cellpadding=2 cellspacing=2
            tr
                tdlabelwicket:message key=name/
 /label/td
                td
 input type=text wicket:id=name//td
            /tr
            tr
                tdwicket:message key=note//td
                tdtextarea cols=20 rows=10
 wicket:id=note/textarea/td
            /tr
            tr
                td colspan=2
 input wicket:id=create type=button value=Create Group//td
            /tr
        /table
    /form
 /wicket:panel

    public CreateGroupPanel(String id) {
        super(id);
        setOutputMarkupId(true);
        final Form form = new Form(form,
 new CompoundPropertyModel(new Group()));
        add(form);
        form.add(new FeedbackPanel(feedback));
        form.add(new
 FormComponentFeedbackBorder(nameBorder).add(new
 TextField(name).setRequired(true)));
        form.add(new TextArea(note));
        form.add(new AjaxSubmitLink(create) {
           �...@override
            protected void onSubmit(AjaxRequestTarget target,
 Form form) {
                Group group = (Group) form.getModelObject();
                System.out.println(Logging:  + group);
            }
        });
    }

 But nothing is got print on the console.
 Any ideas what is going wrong?
 FireFox 3.0.7
 Ubuntu 8.10
 Wicket 1.3.5
 Thanks.


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


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

-- 
View this message in context: 
http://www.nabble.com/Submitting-form-via-Ajax-isn%27t-working-tp23123367p23123825.html
Sent from the Wicket - User 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: LinkTree breaks when using twice instances of Firefox (with Unexpected RuntimeException)

2009-04-19 Thread Igor Vaynberg
yes

-igor

On Sun, Apr 19, 2009 at 1:54 AM, Live Nono liven...@gmail.com wrote:
 hi

 In case some one is interested, i found the solution : adding
 getPageSettings().setAutomaticMultiWindowSupport(true); solves the
 issue.

 I'm quite surprised though because the javadocs of this setting says
 it's enabled by default, which doesn't seem to be the case in fact.
 Should I open a jira issue for this ?

 bye
 nono




 2009/4/18 Live Nono liven...@gmail.com:
 Hi

 I've just spotted the same behavior within the wicket examples page
 itself, there :
 http://www.wicket-library.com/wicket-examples/ajax/tree/simple.1

 Open two tabs/windows of the same browser and then play with the tree
 in one page and then the others, then it'll fail internal error it
 says...

 In fact the state of the tree seems to be shared among the two pages :
 do some changes on one page and then refresh the other page (with F5),
 it'll have the state of the previous one.

 Is it an expected behavior for you ? If so, could someone tell me why
 and if it's possible to avoid it ?

 thanks in advance
 nono

 2009/4/17, Live Nono liven...@gmail.com:
 Hi

 I'm still working on this tree need and I've discovered this issue :
 - opening the page tree in Firefox (or Iceweasel in my ubuntu)
 - navigating the tree
 - opening the page tree in another tab or instance of firefox
 - navigating the tree in this second instance
 - when willing again to navigate in the first page, it breaks with an
 Unexpected RuntimeException

 However, browsing in 2 different browsers at the same time isn't an
 issue (at least with Iceweasel and epiphany, the gnome web browser).
 When using 2 epiphany (tabs or instances) at the same time, the issue
 is the same.

 My detailed config is Mozilla/5.0 (X11; U; Linux i686; en-US;
 rv:1.9.0.7) Gecko/2009032803 Iceweasel/3.0.6 (Debian-3.0.6-1) with
 iceweasel 3.0.6 and epiphany/gnome web browser 2.22.3

 The page in question is heavy on the Ajax side, so perhaps it isn't
 directly TreeLink related.

 Am I missing something or... ?

 Thanks in advance
 nono



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



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



Scribd

2009-04-19 Thread John Armstrong
Before I start into it, has anyone built a scribd component?

John-

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



Cometd Servlet mapping for wickestuff-push example

2009-04-19 Thread Paolo Marrone

Hi all,
first of all, I'm sorry for a wicketstuff question posted on this list, 
but I cannot find a mailing list for wicketstuff, so I hope someone can 
help me.


I'm a happy user of wicket (great framework!), and because I need also 
the server-side push feature, I gave a look to the wicketstuff-dojo-1.1 
project, that includes an implementation of server-push based on 
Dojo-cometd.


I'm able to run the example within the embedded jetty server, without 
modifications, but because I need to use Glassfish (it is the servlet 
container we use in production), I tried to run the wicketstuff-push 
examples on a Glassfish v3 server, but without success.

The problem, in my opinion, depends on the content of web.xml.
This is the original web.xml (it works on jetty, but not on Glassfish):

web-app id=WebApp_ID
   display-namewicketstuff-push-examples/display-name
   welcome-file-list
   welcome-fileindex.html/welcome-file
   welcome-fileindex.htm/welcome-file
   welcome-fileindex.jsp/welcome-file
   welcome-filedefault.html/welcome-file
   welcome-filedefault.htm/welcome-file
   welcome-filedefault.jsp/welcome-file
   /welcome-file-list
/web-app


I added the following lines to web.xml in order to make the application 
compatible with wicket:


   ...
   filter
   filter-namePushExamples/filter-name
   filter-class
   org.apache.wicket.protocol.http.WicketFilter
   /filter-class
   init-param
   param-nameapplicationClassName/param-name
   param-value
   org.wicketstuff.push.examples.application.ExampleApplication
   /param-value
   /init-param
   /filter
   filter-mapping
   filter-namePushExamples/filter-name
   url-pattern/*/url-pattern
   /filter-mapping
   ...

with the above new web.xml the webapp apparently seems to work in 
Glassfish (I can reach the home page, that contains just a list of links 
to launch all the wicketstuff-push examples), but when I try to launch 
some Cometd based example, I get the following error:


WicketMessage: Can't instantiate page using constructor public 
org.wicketstuff.push.examples.pages.WicketCometdChat(org.apache.wicket.PageParameters) 
and argument


Root cause:

javax.servlet.ServletException: Error searching for cometd Servlet
at 
org.wicketstuff.push.cometd.CometdAbstractBehavior.getCometdServletPath(CometdAbstractBehavior.java:232)
at 
org.wicketstuff.push.cometd.CometdAbstractBehavior.clinit(CometdAbstractBehavior.java:28)
at 
org.wicketstuff.push.cometd.CometdService.addChannelListener(CometdService.java:74)
at 
org.wicketstuff.push.examples.pages.WicketAbstractChat.init(WicketAbstractChat.java:49)
at 
org.wicketstuff.push.examples.pages.WicketCometdChat.init(WicketCometdChat.java:13)

at java.lang.reflect.Constructor.newInstance(Constructor.java:513)


It seems that the cometd servlet mapping cannot be found.
My questions are:

- Why the original web.xml can work in jetty? Where does it get the 
wicket filter definition, and the cometd servlet mapping?


- Someone tried the wicketstuff-push example on a different servlet 
container? If yes, which is the right web.xml file to use?


Please help me.
Thank you
Paolo Marrone





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



Re: Good practice for temporary resource reference

2009-04-19 Thread Xhelas

Well, nobody has the same probelm as me? Is that a stupid question?


Xhelas wrote:
 
 I am doing an application with a lot of dynamical image creation. These
 images need to be cached client side, but their life time is bounded by
 the suer session's lifetime. So I create a lot of image resource
 references which url is used but the client. What I did not get in the APi
 is the way do forget those references, to unbind them to the
 application. 
 Is there a canonical way to do so?
 
 Thanks for your reading.
 
 Alexandre
 

-- 
View this message in context: 
http://www.nabble.com/Good-practice-for-temporary-resource-reference-tp22773495p23128552.html
Sent from the Wicket - User 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: Good practice for temporary resource reference

2009-04-19 Thread Xhelas

Yes it could. I figured out to override newSessionStore in the application to
have control over the undbind session call. I would have then remove the
request references registred in the session during its life time at this
time. I beleive that I have to remove my ResourceReference from the
SharedResources of the application. 
I don't know if it it the correct way to do this. I found it by browsing the
wicket source code (thanks it is open source).

Anyone has tried to do something like that?

Regards

Alexandre


Scott Swank wrote:
 
 Does it make sense to just store them in the Wicket Session?
 
 Scott
 
 
 On Sun, Apr 19, 2009 at 4:38 PM, Xhelas xhe...@yahoo.fr wrote:

 Well, nobody has the same probelm as me? Is that a stupid question?


 Xhelas wrote:

 I am doing an application with a lot of dynamical image creation. These
 images need to be cached client side, but their life time is bounded by
 the suer session's lifetime. So I create a lot of image resource
 references which url is used but the client. What I did not get in the
 APi
 is the way do forget those references, to unbind them to the
 application.
 Is there a canonical way to do so?

 Thanks for your reading.

 Alexandre


 --
 View this message in context:
 http://www.nabble.com/Good-practice-for-temporary-resource-reference-tp22773495p23128552.html
 Sent from the Wicket - User 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


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

-- 
View this message in context: 
http://www.nabble.com/Good-practice-for-temporary-resource-reference-tp22773495p23129153.html
Sent from the Wicket - User 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



Custom URL Handling

2009-04-19 Thread Matthew Welch
I have been happily using HybridUrlCodingStrategy for the common pages of my
current app, however I am now beginning to implement a section which has
slightly different requirements for the URL and while I have some idea about
where I can start to implement this custom URL handling, I would like the
advice of those more experienced that I to make sure I'm not heading down a
rathole.

My application will serve many different organizations. All users will see
the same set of pages, but the organization that they are choosing to view
(users can view the data from any organization) will affect the data on
those pages. I would like the urls to be something like this:

http://myapp.com/organization1/calendar
http://myapp.com/organization1/events

http://myapp.com/organization2/calendar
http://myapp.com/organization2/events

I would need to know the organization part of the URL before retrieving the
data for the page, so in reality it's nothing more that page parameter. In
all other respects, I would like to keep the functionality provided by
HybridUrlCodingStrategy, so would my best bet be to extend that strategy? Is
there somewhere else I should be inserting custom code to intercept the URL
before it gets to the coding strategy instead?

Matt


Re: Custom URL Handling

2009-04-19 Thread David Leangen


Matt,

I have done something similar, but depending on the version of Wicket  
you use, I wouldn't necessary recommend it. Things can get a little  
messy.


I did this in 1.3.x. IIRC, I was told this was made easier in 1.4.


What version are you using?

=dml



On Apr 20, 2009, at 1:54 PM, Matthew Welch wrote:

I have been happily using HybridUrlCodingStrategy for the common  
pages of my
current app, however I am now beginning to implement a section which  
has
slightly different requirements for the URL and while I have some  
idea about
where I can start to implement this custom URL handling, I would  
like the
advice of those more experienced that I to make sure I'm not heading  
down a

rathole.

My application will serve many different organizations. All users  
will see
the same set of pages, but the organization that they are choosing  
to view
(users can view the data from any organization) will affect the data  
on

those pages. I would like the urls to be something like this:

http://myapp.com/organization1/calendar
http://myapp.com/organization1/events

http://myapp.com/organization2/calendar
http://myapp.com/organization2/events

I would need to know the organization part of the URL before  
retrieving the
data for the page, so in reality it's nothing more that page  
parameter. In

all other respects, I would like to keep the functionality provided by
HybridUrlCodingStrategy, so would my best bet be to extend that  
strategy? Is
there somewhere else I should be inserting custom code to intercept  
the URL

before it gets to the coding strategy instead?

Matt



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