DataView - AjaxFallBackLink works only when outside DataView Link is once called

2011-05-02 Thread devush
Hi,

 I have one link within the DataView and one directly attached to the
Panel. The link within the DataView is added to the item within the
populateItem() method.  This links gives me error when called *when*
the page is created:

WicketMessage: org.apache.wicket.WicketRuntimeException: component
events:dc:events:1:f:show_lk not found on page mypage[id = 2],
listener interface = [RequestListenerInterface name=IBehaviorListener,
method=public abstract void
org.apache.wicket.behavior.IBehaviorListener.onRequest()]

But, when I click another AjaxFallbackLink which is outside the
DataView then the link within the DataView starts working. I should be
calling something good in the link which is directly on the Panel.
Code of the AjaxFallbackLink#onClick outside the DataView is:
AjaxFallbackLink sort2_lk = new AjaxFallbackLink(sort2_lk) {
public void onClick(AjaxRequestTarget target) { 
   dataContainer.remove(events);
DataView dataView = createEventsDataView(list);
dataContainer.add(dataView);
target.addComponent(dataContainer);
}
};
dataContainer.add(sort2_lk);

Dataview is added to the panel using:
 final WebMarkupContainer dataContainer = new
WebMarkupContainer(dc);
dataContainer.setOutputMarkupId(true);
dataContainer.setOutputMarkupPlaceholderTag(true);
 

DataView dataView = createEventsDataView(basicCommentWebs);
dataContainer.add(dataView);
dataContainer.add(setNavigator(dataContainer, dataView));
add(dataContainer);


private DataView createEventsDataView(ListBasicCommentWeb list) {
final DataView dv = new DataView(events, new ListDataProvider(
list)) {
@Override
protected void populateItem(final Item item) {
 ...
   Form f = new Form(f);
AjaxFallbackLink hide_lk = new
AjaxFallbackLink(show_lk) {
@Override
public void onClick(AjaxRequestTarget 
target) {
System.out.println(\n Hide on 
onClick);
//mcp.setVisible(false);
//target.addComponent(mcp);
}
};
f.add(show_lk);
   }

I have added setOutputMarkupId(true) and
setOutputMarkupPlaceholderTag(true) on the Form and links also, but
results are still the same.

What i am doing special in the case of AjaxFallBackLink which is
attached directly to the Panel?
thanks
devush

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



IndexedParamUrlCodingStrategy pageparameter null

2011-04-03 Thread devush
Hi,

(Wicket 1.4.8 in the development mode)

I am mounting my page like this:

mount(new IndexedParamUrlCodingStrategy(/i/about, AboutPage.class));

I am able to call  /i/about without any problems, but when I call
/i/about/somevalue I expect to have PageParameters not null.

I am calling this in my web page, but p is always null.
PageParameters p = getPageParameters();

Is not that the PageParameters should have 0=somevalue, which i should
be getting  by p.getString(0);


thanks,
devush

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



Re: IndexedParamUrlCodingStrategy pageparameter null

2011-04-03 Thread devush
Hi,
 Thanks, yes I have ignored that. It is now working. You have saved my weekend!
thanks
devush
PS: Sorry, by mistake I directly replied to Martin.

On 3 April 2011 17:54, Martin Grigorov mgrigo...@apache.org wrote:
 I guess you forgot to call super(pageParameters) in your page ctor

 On Sun, Apr 3, 2011 at 7:48 PM, devush devushan...@gmail.com wrote:

 Hi,

 (Wicket 1.4.8 in the development mode)

 I am mounting my page like this:

 mount(new IndexedParamUrlCodingStrategy(/i/about, AboutPage.class));

 I am able to call  /i/about without any problems, but when I call
 /i/about/somevalue I expect to have PageParameters not null.

 I am calling this in my web page, but p is always null.
 PageParameters p = getPageParameters();

 Is not that the PageParameters should have 0=somevalue, which i should
 be getting  by p.getString(0);


 thanks,
 devush

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




 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com


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



Servlet Mapping Expectations

2011-03-05 Thread devush
Hi,
 I have following settings in web.xml

   servlet-mapping
servlet-namemyserv/servlet-name
url-pattern/app/*/url-pattern
  /servlet-mapping


I expect that all requests such as:
/app
/app/abc
/app/xyz

should come to the servlet. But only /app currently works.

Moreover, I want to access the getRequestURL part from the servlet API
also, so that i can use the  information in the application logic.

I am able to do this in the normal servlet and then forward the
request to the wicket but in that case the URL at the client remains
the same and causes problems later in the application.


thanks
devush

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



Re: Servlet Mapping Expectations

2011-03-05 Thread devush
Hi,
 I am able to get the request related information from both Request
and WebRequest. Thanks for that. This i am able to do in the WebPage.
My WebApplication getHomePage is called when ever I call /app or
/app/, so I have to intercept the request before that.

I am trying with mount(String, Package), but that lead to the specific
URL only. This is in the init() method of WebApplication.
My basic requirement is to serve pages like /app/user1 /app/user2
/app/user2/profile etc.

Do i have to create new* methods as described at
https://cwiki.apache.org/WICKET/request-processing-overview.html

Do I have to implement IRequestCodingStrategy and attach it to Request Cycle?
thanks
devush



On 05/03/2011, Martin Grigorov mgrigo...@apache.org wrote:
 Hi,

 On Sat, Mar 5, 2011 at 4:03 PM, devush devushan...@gmail.com wrote:

 Hi,
  I have following settings in web.xml

   servlet-mapping
servlet-namemyserv/servlet-name
url-pattern/app/*/url-pattern
  /servlet-mapping


 I expect that all requests such as:
 /app
 /app/abc
 /app/xyz


 should come to the servlet. But only /app currently works.

 They actually come but since you don't have mounts at /abc or /xyz Wicket
 decides there is nothing to do for them.
 /app matches on the App's home page.


 Moreover, I want to access the getRequestURL part from the servlet API
 also, so that i can use the  information in the application logic.

 I am able to do this in the normal servlet and then forward the
 request to the wicket but in that case the URL at the client remains
 the same and causes problems later in the application.

 See if Wicket's Request#getPath() (Wicket 1.4.x) or #getUrl() (Wicket
 1.5.x) returns what you need.
 Otherwise you can always use the underlying HttpServletRequest:
 - 1.4.x - WebRequest#getHttpServletRequest()
 - 1.5.x - (HttpServletRequest) Request#getContainerRequest()


 thanks
 devush

 -
 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



Unexpected RuntimeException with PagingNavigator

2010-01-04 Thread devush

Dear All,
I am trying to get a Pagingnavigator using DataView.
I get following exception(Jetty 6.1.4 DEVELOPMENT mode, Wicket 1.4.5 ):
---
Unexpected RuntimeException:
WicketMessage: The component(s) below failed to render. A common problem is
that you have added a component in code but forgot to reference it in the
markup (thus the component will never be rendered).
1. [MarkupContainer [Component id = pageLink]]
2. [Component id = pageNumber]
3. [MarkupContainer [Component id = pageLink]]
4. [Component id = pageNumber]
5. [MarkupContainer [Component id = pageLink]]
6. [Component id = pageNumber]
Root cause:org.apache.wicket.WicketRuntimeException: The component(s) below
failed to render. A common problem is that you have added a component in
code but forgot to reference it in the markup (thus the component will never
be rendered).
1. [MarkupContainer [Component id = pageLink]]
2. [Component id = pageNumber]
3. [MarkupContainer [Component id = pageLink]]
4. [Component id = pageNumber]
5. [MarkupContainer [Component id = pageLink]]
6. [Component id = pageNumber]
at org.apache.wicket.Page.checkRendering(Page.java:1162)
at org.apache.wicket.Page.renderPage(Page.java:922)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:261)

Current Class extends the WebPage. My code looks like:

IDataProviderContact itemDataProvider = new IDataProviderContact() {
public Iterator iterator(int first, int count) {
   Object[] objs = list.toArray();
   List outList = new ArrayList();
   for (int i = first; i  count; i++) {   // i know this is not clean
   Contact c = (Contact) objs[i];
   outList.add(c);
   }
   return outList.iterator();
}

public IModelContact model(final Contact object) {
   return new LoadableDetachableModel() {

   @Override
   protected Contact load() {
   return (Contact) object;
   }
   };
   }
   public int size() {
   return list.size();
   }
   public void detach() {}
   };
DataView dataView = new DataView(mywork, itemDataProvider, 5) {
   protected void populateItem(Item item) {
   Contact contact = (Contact) item.getModelObject();
   item.add(new Label(id, contact.getId()));
   }
};
dataView.setItemsPerPage(5);
add(dataView);
add(new PagingNavigation(nav, dataView));

It works fine if I take the PagingNavigation out of code.

My HTML Code is:
table cellspacing=0 class=dataview 
tbody
tr wicket:id=mywork
tdspan wicket:id=idTest ID/span/td
/tr
/tbody
/table
span wicket:id=navnavigation controls here/span

Apart from this, i also tried with
   new DataView(mywork, new ListDataProvider(list))

any ideas where I am wrong.
regards,
devush 



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