Custom PagingNavigation Back-Button -Problem

2011-07-14 Thread brazz
I wrote a custom PagingNavigation which renders page links in the form:
[1-5...11-15 *16-20* 21-25...196-200]. The page size is adjustable by a
DropDownChoice. 

Everything works fine until i hit the back-button and then click on one of
the links (e.g. 11-15). What happens then is that in class
RequestListenerInterface the request doesn't get processed in the invoke
method, which results in an empty DataView (because my custom
PagingNavigation class does not get called):

if (!component.isEnabledInHierarchy() || !component.isVisibleInHierarchy())
{
// just return so that we have a silent fail and just 
re-render the
// page
log.warn(component not enabled or visible; ignoring 
call. Component:  +
component);
return;
}

I already searched the mailing list and found, that this has been introduced
because of a security problem. On the one hand i removed every code line
which sets components visibility or enablement to false. That didn't solve
the problem. 

On the other hand even if that worked, i'd have no idea how to get around
this problem, as i  have to set the visibility of loopItems (i overwrote
method populateItem in class PagingNavigation) because not every page has
a corresponding link and when instead i call remove() on the loopItems,
wicket exits with an exception that the component is null. 

Thanks for any suggestions!!!

Here's the code of my customized PagingNavigation class:

public class CustomPagingNavigation extends PagingNavigation  {

private static final long serialVersionUID = -3614988044938070942L;

private BrowsingItems f;

private PagingNavigationLinkVoid link;

private int currentPage;

private BrowsingItems.BrowsingItem selectedBi;

private BrowsingItems.BrowsingItem pageMatchingBi;

private IPageable pageable;

private int offset = 1;

private IASPPagingDimensionsProvider dimensionsProvider;

private BrowsingItems.BrowsingItem nextBrowsingItem = null;

public CustomPagingNavigation(String id, IPageable pageable,
IPagingLabelProvider labelProvider, 
IASPPagingDimensionsProvider
dimensionsProvider) {
super(id, pageable, labelProvider);
this.dimensionsProvider = dimensionsProvider;
this.pageable = pageable;

setViewSize(dimensionsProvider.getRecordCount() /
dimensionsProvider.getItemsPerPage());
f = newBrowsingItems();
f.setOffset(1);
}


@Override
protected void populateItem(LoopItem loopItem) {
setViewSize(dimensionsProvider.getRecordCount() /
dimensionsProvider.getItemsPerPage());
if (f.getCurrentPage() = f.getPages())
f.setOffset(f.getLastPageOffset());
if (f.getOffset()  0)
f.setOffset(1);
if (f.getOffset()  f.getRecordCount())
f.setOffset(f.getLastPageOffset());
currentPage = loopItem.getIteration();
pageMatchingBi = findMatchingPage(f.getBrowsingItems(), 
currentPage);
if (pageMatchingBi != null) {
boolean selected = false;
if (selectedBi == null) {
selectedBi = f.getBrowsingItems()[0];
}
if (selectedBi != null  
selectedBi.equals(pageMatchingBi)) {
selected = true;
}
link = new 
ASPBrowsingItemPageNavigationLinkVoid(pageLink,
pageable, currentPage, pageMatchingBi, 
selected) {
private static final long serialVersionUID = 
7412763652723598668L;

@Override
public void onClick() {
super.onClick();
selectedBi = this.getBrowsingItem();
offset = 
this.getBrowsingItem().getFrom();
newBrowsingItems();
getPage().setRedirect(true);
// Return the current page.
setResponsePage(getPage());
}
};
loopItem.add(link);
loopItem.add(new Label(separator, nbsp;)
.setEscapeModelStrings(false));
nextBrowsingItem = 
f.findNextBrowsingItem(pageMatchingBi);
if(nextBrowsingItem != null  

Autocomplete Text field

2011-07-14 Thread Wiliam Bacchi

Hi,

it seems to me that autocomplete text field fires twice onchange event 
when you tab out of the field after selecting an item with arrows.


It does not happen if you select the item pressing enter or clicking 
with the mouse.


I read that this behaviour was present even for enter key and mouse 
click and that it has been modifyied. I was wondering if it was possible 
to avoid double onchange call also when tab key is used.


Thanks, William.


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



Re: BookmarkableLink to download a CSV file

2011-07-14 Thread Martin Grigorov
see IMarkupResourceStreamProvider

I recommend you to use a resource instead. You can inject the Spring
bean with Injector.get().inject(this) in the constructor

On Thu, Jul 14, 2011 at 1:18 AM, Jeffrey Schneller
jeffrey.schnel...@envisa.com wrote:
 I want to have a link that when hit will download a csv file.  I would
 prefer to use a Page or a component that I can use the @SpringBean
 notation on so the csv file data can be retrieved via my service layer
 beans.



 I can generate the file using a WebPage with the following in my
 constructor for the page where sb is my StringBuilder holding the data.

                                WebResponse response = (WebResponse)
 this.getResponse();

                                java.io.OutputStream cout =
 response.getOutputStream();

                                try {


 cout.write(sb.toString().getBytes());

                                                cout.flush();

                                                cout.close();

                                } catch (IOException e) {

                                                // TODO Auto-generated
 catch block

                                                e.printStackTrace();

                                }

 My page also overrides setHeaders to set the proper headers, ContentType
 and Header specifying download and file name.



 The problem with this is the following 2 errors are thrown:

 011-07-13 17:58:23,910 ERROR org.apache.wicket.RequestCycle
 RequestCycle:1529 - Markup of type 'html' for component
 'com.company.myPage' not found. Enable debug messages for
 org.apache.wicket.util.resource to get a list of all filenames tried.:
 [Page class = com.company.myPage, id = 4, version = 0]

 org.apache.wicket.markup.MarkupNotFoundException: Markup of type 'html'
 for component ' com.company.myPage ' not found. Enable debug messages
 for org.apache.wicket.util.resource to get a list of all filenames
 tried.: [Page class = com.company.myPage, id = 4, version = 0]



 2011-07-13 17:58:24,549 ERROR
 org.apache.wicket.protocol.http.WicketFilter WicketFilter:507 - closing
 the buffer error

 java.lang.IllegalStateException: getOutputStream() has already been
 called for this response





 Any ideas?







-- 
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



Re: Autocomplete Text field

2011-07-14 Thread Wiliam Bacchi

Il 14/07/2011 9.32, Wiliam Bacchi ha scritto:

Hi,

it seems to me that autocomplete text field fires twice onchange event 
when you tab out of the field after selecting an item with arrows.


It does not happen if you select the item pressing enter or clicking 
with the mouse.


I read that this behaviour was present even for enter key and mouse 
click and that it has been modifyied. I was wondering if it was 
possible to avoid double onchange call also when tab key is used.


Thanks, William.


Just to add that double firing happens with firefox 5.0 on windows xp.



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



Re: Skip validation on nested form's form level validators

2011-07-14 Thread Martin Grigorov
Christian,

Can you try the patch in https://issues.apache.org/jira/browse/WICKET-3899 ?

On Mon, Jul 11, 2011 at 10:02 PM, Christian Huber hub...@butterbrot.org wrote:
 Hi,

 well i _could_ decouple the two forms but that would kinda break my usecase
 and also the layout due to the changed component hierarchy.

 Removing and readding the validators does not strike me as a good idea
 though, that would mean that the outer form would have knowledge about the
 internals of the inner form, which would break not only cohesion but also
 the law of demeter.

 I was thinking that since there is a defined way to let a form decide for
 itself if it's component's validators should be executed that there might
 also be a similar way to do this for form level validators. But it seems
 that this is not the case. So I guess I will try disabling the default form
 processing on the outer form and call it's component's validators manually
 in the onsubmit method of the corresponding button.

 Anyway thanks for your time.

 Am 11.07.2011 15:01, schrieb Andrea Del Bene:

 Hi,

 why don't simply put the inner form out of the outer one? Anyway, you
 could remove inner form's validators before the outer form is submitted and
 add them again when submit process is over (onFormSubmitted() )

 Hi all,

 I have two forms nested within each other (wicket 1.4.17). The inner form
 adds data to the model of the outer form via ajax when it's button is
 pressed while the outer form saves the data to the database when the outer
 form's submit button is pressed.

 Both forms have validators attacehd to them and their components. and of
 course the inner form's validators must not be executed when the outer form
 is submitted. Having the inner form implement IFormVisitorParticipant and
 then check if the submitting button was it's own avoids the inner form's
 component's validators to be executed. But validators applied to the inner
 form directly (e.g. EqualInputValidators etc.) are still executed and in my
 case causing the request to die horribly because the requred data just is
 not there.

 I was looking for an elegant way to solve this but since all validate
 methods in the hierarchy are final I cannot hook any code into the form's on
 validation cycle. The method onValidate is not called (I guess that is
 because the form is validated as the outer form's child). All other methods
 that allow me to achieve the deisred behavior (like isEnabled) are too
 general cause side effects like disabling the form. At the moment the only
 way I can think of is to disable default form processing and then call the
 validators manually which is not very appealing to me.

 Is there another way how this can be done?

 Cheers,
 Chris



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


 --
 The Sanity Resort http://sanityresort.blogspot.com/




-- 
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



Re: introducing wicket:for attribute

2011-07-14 Thread Erik van Oosten
Its not @literal that removes the linebreaks. If you combine it with 
pre it works. (No need to add code as well.)


*pre{@literal
* label wicket:for=name
* span class=label-textName/span:
* /label
* input wicket:id=name type=text/
* }/pre
*

Regards,
Erik.


Op 13-07-11 17:55, Igor Vaynberg schreef:

sweet, too bad  @literal does not preserve linebreaks. what we really
need is a CDATA like javadoc tag.

-igor

On Wed, Jul 13, 2011 at 4:12 AM, Erik van Oostene.vanoos...@grons.nl  wrote:

Amazing stuff!

You can write straight html in javadoc with the {@literal} syntax. E.g.:

*p
* Given markup like this:
*
*code{@literal
*label wicket:for=namespan
class=label-textName/span:/labelinput wicket:id=name type=text/
* }/code
*
* If the {@code name} component has its label set to 'First Name' the
resulting output will be:
*code{@literal
*label for=name5span class=label-textFirst
Name/span:/labelinput name=name type=text id=name5/
* }/code

Regards,
Erik.


Op 13-07-11 01:50, Igor Vaynberg wrote:

based on some feedback i changed the class name of the inner span from
text to label-text to reduce chance of css collisions

-igor

On Fri, Jul 8, 2011 at 9:22 PM, Igor Vaynbergigor.vaynb...@gmail.com
  wrote:

just implemented the wicket:for attribute. check out the javadoc here:


http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/AutoLabelResolver.java?view=markuppathrev=1144589

1.4.x only for now, still needs to be forward-ported to trunk.

feedback?

-igor





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



Generate ajax link

2011-07-14 Thread Lurtz Nazgul
Hi all;

I can generate normal links in to my dynamic menu

lia href='?thePanel=com.test.PanelOne'/a/li
...

I wonder if i can generate those links in ajax link format ?

Thanks.

Re: Howto mark a FormComponent as invalid without having a feedbackmessage?

2011-07-14 Thread rebecca
Hello Dears,

Regarding Matt's question from 2008 - Is there a way to mark a form
component as invalid without using the error() method?


Rebecca

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Howto-mark-a-FormComponent-as-invalid-without-having-a-feedbackmessage-tp1871821p3667147.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: Howto mark a FormComponent as invalid without having a feedbackmessage?

2011-07-14 Thread Martin Grigorov
Looking at the code the answer is No.

On Thu, Jul 14, 2011 at 1:29 PM, rebecca rivka.shis...@gmail.com wrote:
 Hello Dears,

 Regarding Matt's question from 2008 - Is there a way to mark a form
 component as invalid without using the error() method?


 Rebecca

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Howto-mark-a-FormComponent-as-invalid-without-having-a-feedbackmessage-tp1871821p3667147.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





-- 
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



Re: Howto mark a FormComponent as invalid without having a feedbackmessage?

2011-07-14 Thread rebecca
thanks Martin:-(

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Howto-mark-a-FormComponent-as-invalid-without-having-a-feedbackmessage-tp1871821p3667171.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: Howto mark a FormComponent as invalid without having a feedbackmessage?

2011-07-14 Thread Martin Grigorov
What is the use case ?

On Thu, Jul 14, 2011 at 1:42 PM, rebecca rivka.shis...@gmail.com wrote:
 thanks Martin:-(

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Howto-mark-a-FormComponent-as-invalid-without-having-a-feedbackmessage-tp1871821p3667171.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





-- 
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



Re: Generate ajax link

2011-07-14 Thread Andrea Del Bene

Hi,

you can use Loop component to generate a dynamic number of links. For 
example:




HTML code:

ol title=Menù class=main_menu
li style=list-style: none; wicket:id=itemList
a wicket:id=menuItem/a
/li
/ol



Java  code:


 ListAbstractLink linkList = ...
Loop loop = new Loop(itemList, linkList.size()) {
@Override
protected void populateItem(LoopItem item) {
AbstractLink curLink = linkList.get(item.getIndex());
item.add(curLink);
}
};




Hi all;

I can generate normal links in to my dynamic menu

lia href='?thePanel=com.test.PanelOne'/a/li
...

I wonder if i can generate those links in ajax link format ?

Thanks.



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



IHeaderContributor of invisible Components

2011-07-14 Thread Benedikt Rothe

I have a problem with IHeaderContributor and invisible Components:

A Panel MyPanel implements IHeaderContributor.
The renderHead-Methods adds some JavaScript-References.

When the page is rendered this panel is invisible.
So these JavaScript-References are not loaded when the page is loaded.

Later visibility is switched within an Ajax-Call and the MyPanel will be 
rendered.

But than my JavaScript is not loaded.

Strange: During the Ajax-Call the renderHead-Method of MyPanel is even 
called, but

the call doesn't provoke anything concerning the output to the browser.

Any suggestions?
Benedikt





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



Re: Generate ajax link

2011-07-14 Thread Lurtz Nazgul
I mean; generating ajax link  format

Instead of 

lia href='?thePanel=com.test.PanelOne'/a/li

I want to generate ajax link on the fly 

Example : 
a onclick=var 
wcall=wicketAjaxGet('wicket/page?2-1.IBehaviorListener.0-c1--link',function() { 
}.bind(this),function() { }.bind(this), function() {return Wicket.$('idc') != 
null;}.bind(this));return !wcall; id=idc href=#increment/a

Any suggestions ?

Thanks.





From: Andrea Del Bene adelb...@ciseonweb.it
To: users@wicket.apache.org
Sent: Thu, July 14, 2011 2:00:32 PM
Subject: Re: Generate ajax link

Hi,

you can use Loop component to generate a dynamic number of links. For example:



HTML code:

ol title=Menù class=main_menu
li style=list-style: none; wicket:id=itemList
a wicket:id=menuItem/a
/li
/ol



Java  code:


ListAbstractLink linkList = ...
Loop loop = new Loop(itemList, linkList.size()) {
@Override
protected void populateItem(LoopItem item) {
AbstractLink curLink = linkList.get(item.getIndex());
item.add(curLink);
}
};



 Hi all;
 
 I can generate normal links in to my dynamic menu
 
 lia href='?thePanel=com.test.PanelOne'/a/li
 ...
 
 I wonder if i can generate those links in ajax link format ?
 
 Thanks.


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

Re: Why is stateless from making my page stateful?

2011-07-14 Thread Mike Mander

Hello again,

call me stupid, but i don't get it (ImageButton loading shared image 
resource). What i did so far is:

Application.init()
code
String key = new CompressedResourceReference(WicketApplication.class, 
res/img/search_go.png).getSharedResourceKey();

mountSharedResource(img/search_go.png, key);
/code

MyComponent.init
form.add(new ImageButton(doSearch, new 
ResourceReference(img/search_go.png)));


MyComponent.html
input wicket:id=doSearch type=image name=submit class=submit /

But the statelessChecker still complains on my ImageButton:

Root cause:

java.lang.IllegalArgumentException: '[Page class = HomePage, id = 0, 
version = 0]' claims to be stateless but isn't. Offending component: 
[MarkupContainer [Component id = doSearch, page = HomePage, path = 
0:ambiance:search:searchSlot:doSearch.ImageButton, isVisible = true, 
isVersioned = true]]
at 
org.apache.wicket.devutils.stateless.StatelessChecker.onBeforeRender(StatelessChecker.java:98)
at 
org.apache.wicket.Application.notifyPostComponentOnBeforeRenderListeners(Application.java:1202)

at org.apache.wicket.Component.internalBeforeRender(Component.java:1067)

I couldn't find any doc for adding an image to shared resources and use 
it by component.


Can someone please help me out here?
Thanks
Mike


by making them shared ?!

On Tue, Jul 12, 2011 at 3:55 PM, Mike Manderwicket-m...@gmx.de  wrote:

Thanks Martin for the dev-utils hint. You're right for my problem.
It seems that all my images have the statelessHint = false.

But: How can i make my image resource references stateless?

Thanks
Mike


I think ImageButton is the component that makes it stateful.

To be sure use wicket-devutils, annotate the page with
@StatelessComponent and add StatelessChecker as
IComponentOnBeforeRenderListener in your application.

On Tue, Jul 12, 2011 at 2:14 PM, Mike Manderwicket-m...@gmx.dewrote:

Hi,

i use a page with a border. I add a panel with a stateless form to the
border and the page gets stateful. Why?
The symtoms are - NotSerializableExceptions and RuntimeException if i
click
the submit.
Form action:

../../../../Overview.html/gdw_exact/Party/of/47/wicket:interface/:0:ambiance:search:searchSlot::IFormSubmitListener::

I'm definitly doing something stupid, but i can't see what. Maybe someone
can point me to a doc or something.

Thanks
Mike

ShopBorder.java
code
public class ShopBorder extends Border {

public ShopBorder(String id) {
super(id);
add(searchSlot());
}

private Component searchSlot() {
return new SearchSlot(search) {
@Override
protected void setSearchterm(String searchterm) {
getPage().getPageParameters().put(sTerm, searchterm);
setResponsePage(getPage().getClass(),
getPage().getPageParameters());
};
};
}
}
/code

SearchSlot.java
code
public abstract class SearchSlot extends Panel {

public SearchSlot(String id) {
super(id);
IModelStringterm = new ModelString();
StatelessFormStringform = new
StatelessFormString(searchSlot,
term) {
@Override
protected void onSubmit() {
setSearchterm(getModelObject());
super.onSubmit();
}
};
form.add(new TextFieldString(searchTerm, term));
form.add(new ImageButton(doSearch, new
CompressedResourceReference(WicketApplication.class, res/img/go.png)));
add(form);
}

protected abstract void setSearchterm(String searchterm);
}
/code

-
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








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



Re: Generate ajax link

2011-07-14 Thread Martin Grigorov
See how AjaxLink generates its markup.

On Thu, Jul 14, 2011 at 2:31 PM, Lurtz Nazgul lu...@ymail.com wrote:
 I mean; generating ajax link  format

 Instead of

 lia href='?thePanel=com.test.PanelOne'/a/li

 I want to generate ajax link on the fly

 Example :
 a onclick=var
 wcall=wicketAjaxGet('wicket/page?2-1.IBehaviorListener.0-c1--link',function() 
 {
 }.bind(this),function() { }.bind(this), function() {return Wicket.$('idc') !=
 null;}.bind(this));return !wcall; id=idc href=#increment/a

 Any suggestions ?

 Thanks.




 
 From: Andrea Del Bene adelb...@ciseonweb.it
 To: users@wicket.apache.org
 Sent: Thu, July 14, 2011 2:00:32 PM
 Subject: Re: Generate ajax link

 Hi,

 you can use Loop component to generate a dynamic number of links. For example:



 HTML code:

 ol title=Menù class=main_menu
 li style=list-style: none; wicket:id=itemList
 a wicket:id=menuItem/a
 /li
 /ol



 Java  code:


 ListAbstractLink linkList = ...
 Loop loop = new Loop(itemList, linkList.size()) {
                @Override
                protected void populateItem(LoopItem item) {
                    AbstractLink curLink = linkList.get(item.getIndex());
                    item.add(curLink);
                }
            };



 Hi all;

 I can generate normal links in to my dynamic menu

 lia href='?thePanel=com.test.PanelOne'/a/li
 ...

 I wonder if i can generate those links in ajax link format ?

 Thanks.


 -
 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



Re: Why is stateless from making my page stateful?

2011-07-14 Thread Martin Grigorov
That's why we have examples :
http://www.wicket-library.com/wicket-examples/images/wicket/bookmarkable/org.apache.wicket.examples.source.SourcesPage?SourcesPage_class=org.apache.wicket.examples.images.Homesource=ImagesApplication.java

If this doesn't help then do something like:

WebComponent img = new WebComponent(img);
CharSequence url = urlFor(new PackageResourceReference(Some.class, some.png));
img.add(AttributeModifier.append(src, url));


On Thu, Jul 14, 2011 at 2:44 PM, Mike Mander wicket-m...@gmx.de wrote:
 Hello again,

 call me stupid, but i don't get it (ImageButton loading shared image
 resource). What i did so far is:
 Application.init()
 code
 String key = new CompressedResourceReference(WicketApplication.class,
 res/img/search_go.png).getSharedResourceKey();
 mountSharedResource(img/search_go.png, key);
 /code

 MyComponent.init
 form.add(new ImageButton(doSearch, new
 ResourceReference(img/search_go.png)));

 MyComponent.html
 input wicket:id=doSearch type=image name=submit class=submit /

 But the statelessChecker still complains on my ImageButton:

 Root cause:

 java.lang.IllegalArgumentException: '[Page class = HomePage, id = 0, version
 = 0]' claims to be stateless but isn't. Offending component:
 [MarkupContainer [Component id = doSearch, page = HomePage, path =
 0:ambiance:search:searchSlot:doSearch.ImageButton, isVisible = true,
 isVersioned = true]]
 at
 org.apache.wicket.devutils.stateless.StatelessChecker.onBeforeRender(StatelessChecker.java:98)
 at
 org.apache.wicket.Application.notifyPostComponentOnBeforeRenderListeners(Application.java:1202)
 at org.apache.wicket.Component.internalBeforeRender(Component.java:1067)

 I couldn't find any doc for adding an image to shared resources and use it
 by component.

 Can someone please help me out here?
 Thanks
 Mike

 by making them shared ?!

 On Tue, Jul 12, 2011 at 3:55 PM, Mike Manderwicket-m...@gmx.de  wrote:

 Thanks Martin for the dev-utils hint. You're right for my problem.
 It seems that all my images have the statelessHint = false.

 But: How can i make my image resource references stateless?

 Thanks
 Mike

 I think ImageButton is the component that makes it stateful.

 To be sure use wicket-devutils, annotate the page with
 @StatelessComponent and add StatelessChecker as
 IComponentOnBeforeRenderListener in your application.

 On Tue, Jul 12, 2011 at 2:14 PM, Mike Manderwicket-m...@gmx.de
  wrote:

 Hi,

 i use a page with a border. I add a panel with a stateless form to the
 border and the page gets stateful. Why?
 The symtoms are - NotSerializableExceptions and RuntimeException if i
 click
 the submit.
 Form action:


 ../../../../Overview.html/gdw_exact/Party/of/47/wicket:interface/:0:ambiance:search:searchSlot::IFormSubmitListener::

 I'm definitly doing something stupid, but i can't see what. Maybe
 someone
 can point me to a doc or something.

 Thanks
 Mike

 ShopBorder.java
 code
 public class ShopBorder extends Border {

    public ShopBorder(String id) {
        super(id);
        add(searchSlot());
    }

    private Component searchSlot() {
        return new SearchSlot(search) {
            @Override
            protected void setSearchterm(String searchterm) {
                getPage().getPageParameters().put(sTerm, searchterm);
                setResponsePage(getPage().getClass(),
 getPage().getPageParameters());
            };
        };
    }
 }
 /code

 SearchSlot.java
 code
 public abstract class SearchSlot extends Panel {

    public SearchSlot(String id) {
        super(id);
        IModelString    term = new ModelString();
        StatelessFormString    form = new
 StatelessFormString(searchSlot,
 term) {
            @Override
            protected void onSubmit() {
                setSearchterm(getModelObject());
                super.onSubmit();
            }
        };
        form.add(new TextFieldString(searchTerm, term));
        form.add(new ImageButton(doSearch, new
 CompressedResourceReference(WicketApplication.class,
 res/img/go.png)));
        add(form);
    }

    protected abstract void setSearchterm(String searchterm);
 }
 /code

 -
 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






 -
 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

Re: Why is stateless from making my page stateful?

2011-07-14 Thread Mike Mander

Thanks Martin,

SharedResourceReference and your solution seems to be 1.5. I'm using 
1.4.17. Is there something for 1.4.x?


Mike



That's why we have examples :
http://www.wicket-library.com/wicket-examples/images/wicket/bookmarkable/org.apache.wicket.examples.source.SourcesPage?SourcesPage_class=org.apache.wicket.examples.images.Homesource=ImagesApplication.java

If this doesn't help then do something like:

WebComponent img = new WebComponent(img);
CharSequence url = urlFor(new PackageResourceReference(Some.class, some.png));
img.add(AttributeModifier.append(src, url));


On Thu, Jul 14, 2011 at 2:44 PM, Mike Manderwicket-m...@gmx.de  wrote:

Hello again,

call me stupid, but i don't get it (ImageButton loading shared image
resource). What i did so far is:
Application.init()
code
String key = new CompressedResourceReference(WicketApplication.class,
res/img/search_go.png).getSharedResourceKey();
mountSharedResource(img/search_go.png, key);
/code

MyComponent.init
form.add(new ImageButton(doSearch, new
ResourceReference(img/search_go.png)));

MyComponent.html
input wicket:id=doSearch type=image name=submit class=submit /

But the statelessChecker still complains on my ImageButton:

Root cause:

java.lang.IllegalArgumentException: '[Page class = HomePage, id = 0, version
= 0]' claims to be stateless but isn't. Offending component:
[MarkupContainer [Component id = doSearch, page = HomePage, path =
0:ambiance:search:searchSlot:doSearch.ImageButton, isVisible = true,
isVersioned = true]]
at
org.apache.wicket.devutils.stateless.StatelessChecker.onBeforeRender(StatelessChecker.java:98)
at
org.apache.wicket.Application.notifyPostComponentOnBeforeRenderListeners(Application.java:1202)
at org.apache.wicket.Component.internalBeforeRender(Component.java:1067)

I couldn't find any doc for adding an image to shared resources and use it
by component.

Can someone please help me out here?
Thanks
Mike


by making them shared ?!

On Tue, Jul 12, 2011 at 3:55 PM, Mike Manderwicket-m...@gmx.dewrote:

Thanks Martin for the dev-utils hint. You're right for my problem.
It seems that all my images have the statelessHint = false.

But: How can i make my image resource references stateless?

Thanks
Mike


I think ImageButton is the component that makes it stateful.

To be sure use wicket-devutils, annotate the page with
@StatelessComponent and add StatelessChecker as
IComponentOnBeforeRenderListener in your application.

On Tue, Jul 12, 2011 at 2:14 PM, Mike Manderwicket-m...@gmx.de
  wrote:

Hi,

i use a page with a border. I add a panel with a stateless form to the
border and the page gets stateful. Why?
The symtoms are - NotSerializableExceptions and RuntimeException if i
click
the submit.
Form action:


../../../../Overview.html/gdw_exact/Party/of/47/wicket:interface/:0:ambiance:search:searchSlot::IFormSubmitListener::

I'm definitly doing something stupid, but i can't see what. Maybe
someone
can point me to a doc or something.

Thanks
Mike

ShopBorder.java
code
public class ShopBorder extends Border {

public ShopBorder(String id) {
super(id);
add(searchSlot());
}

private Component searchSlot() {
return new SearchSlot(search) {
@Override
protected void setSearchterm(String searchterm) {
getPage().getPageParameters().put(sTerm, searchterm);
setResponsePage(getPage().getClass(),
getPage().getPageParameters());
};
};
}
}
/code

SearchSlot.java
code
public abstract class SearchSlot extends Panel {

public SearchSlot(String id) {
super(id);
IModelString  term = new ModelString();
StatelessFormString  form = new
StatelessFormString(searchSlot,
term) {
@Override
protected void onSubmit() {
setSearchterm(getModelObject());
super.onSubmit();
}
};
form.add(new TextFieldString(searchTerm, term));
form.add(new ImageButton(doSearch, new
CompressedResourceReference(WicketApplication.class,
res/img/go.png)));
add(form);
}

protected abstract void setSearchterm(String searchterm);
}
/code

-
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






-
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: Why is stateless from making my page stateful?

2011-07-14 Thread Martin Grigorov
It should be the same. Just some minor naming changes.

On Thu, Jul 14, 2011 at 3:06 PM, Mike Mander wicket-m...@gmx.de wrote:
 Thanks Martin,

 SharedResourceReference and your solution seems to be 1.5. I'm using 1.4.17.
 Is there something for 1.4.x?

 Mike


 That's why we have examples :

 http://www.wicket-library.com/wicket-examples/images/wicket/bookmarkable/org.apache.wicket.examples.source.SourcesPage?SourcesPage_class=org.apache.wicket.examples.images.Homesource=ImagesApplication.java

 If this doesn't help then do something like:

 WebComponent img = new WebComponent(img);
 CharSequence url = urlFor(new PackageResourceReference(Some.class,
 some.png));
 img.add(AttributeModifier.append(src, url));


 On Thu, Jul 14, 2011 at 2:44 PM, Mike Manderwicket-m...@gmx.de  wrote:

 Hello again,

 call me stupid, but i don't get it (ImageButton loading shared image
 resource). What i did so far is:
 Application.init()
 code
 String key = new CompressedResourceReference(WicketApplication.class,
 res/img/search_go.png).getSharedResourceKey();
 mountSharedResource(img/search_go.png, key);
 /code

 MyComponent.init
 form.add(new ImageButton(doSearch, new
 ResourceReference(img/search_go.png)));

 MyComponent.html
 input wicket:id=doSearch type=image name=submit class=submit /

 But the statelessChecker still complains on my ImageButton:

 Root cause:

 java.lang.IllegalArgumentException: '[Page class = HomePage, id = 0,
 version
 = 0]' claims to be stateless but isn't. Offending component:
 [MarkupContainer [Component id = doSearch, page = HomePage, path =
 0:ambiance:search:searchSlot:doSearch.ImageButton, isVisible = true,
 isVersioned = true]]
 at

 org.apache.wicket.devutils.stateless.StatelessChecker.onBeforeRender(StatelessChecker.java:98)
 at

 org.apache.wicket.Application.notifyPostComponentOnBeforeRenderListeners(Application.java:1202)
 at org.apache.wicket.Component.internalBeforeRender(Component.java:1067)

 I couldn't find any doc for adding an image to shared resources and use
 it
 by component.

 Can someone please help me out here?
 Thanks
 Mike

 by making them shared ?!

 On Tue, Jul 12, 2011 at 3:55 PM, Mike Manderwicket-m...@gmx.de
  wrote:

 Thanks Martin for the dev-utils hint. You're right for my problem.
 It seems that all my images have the statelessHint = false.

 But: How can i make my image resource references stateless?

 Thanks
 Mike

 I think ImageButton is the component that makes it stateful.

 To be sure use wicket-devutils, annotate the page with
 @StatelessComponent and add StatelessChecker as
 IComponentOnBeforeRenderListener in your application.

 On Tue, Jul 12, 2011 at 2:14 PM, Mike Manderwicket-m...@gmx.de
  wrote:

 Hi,

 i use a page with a border. I add a panel with a stateless form to
 the
 border and the page gets stateful. Why?
 The symtoms are - NotSerializableExceptions and RuntimeException if i
 click
 the submit.
 Form action:



 ../../../../Overview.html/gdw_exact/Party/of/47/wicket:interface/:0:ambiance:search:searchSlot::IFormSubmitListener::

 I'm definitly doing something stupid, but i can't see what. Maybe
 someone
 can point me to a doc or something.

 Thanks
 Mike

 ShopBorder.java
 code
 public class ShopBorder extends Border {

    public ShopBorder(String id) {
        super(id);
        add(searchSlot());
    }

    private Component searchSlot() {
        return new SearchSlot(search) {
            @Override
            protected void setSearchterm(String searchterm) {
                getPage().getPageParameters().put(sTerm,
 searchterm);
                setResponsePage(getPage().getClass(),
 getPage().getPageParameters());
            };
        };
    }
 }
 /code

 SearchSlot.java
 code
 public abstract class SearchSlot extends Panel {

    public SearchSlot(String id) {
        super(id);
        IModelString      term = new ModelString();
        StatelessFormString      form = new
 StatelessFormString(searchSlot,
 term) {
            @Override
            protected void onSubmit() {
                setSearchterm(getModelObject());
                super.onSubmit();
            }
        };
        form.add(new TextFieldString(searchTerm, term));
        form.add(new ImageButton(doSearch, new
 CompressedResourceReference(WicketApplication.class,
 res/img/go.png)));
        add(form);
    }

    protected abstract void setSearchterm(String searchterm);
 }
 /code

 -
 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




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


Re: IHeaderContributor of invisible Components

2011-07-14 Thread Rodrigo Heffner
When you say my javascript is not loaded, do you mean it's not added to
the page or it's added but doesn't work?
On 14 Jul 2011 12:21, Benedikt Rothe benedikt.ro...@qleo.de wrote:
 I have a problem with IHeaderContributor and invisible Components:

 A Panel MyPanel implements IHeaderContributor.
 The renderHead-Methods adds some JavaScript-References.

 When the page is rendered this panel is invisible.
 So these JavaScript-References are not loaded when the page is loaded.

 Later visibility is switched within an Ajax-Call and the MyPanel will be
 rendered.
 But than my JavaScript is not loaded.

 Strange: During the Ajax-Call the renderHead-Method of MyPanel is even
 called, but
 the call doesn't provoke anything concerning the output to the browser.

 Any suggestions?
 Benedikt





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



Re: Adding a javascript function to wicket

2011-07-14 Thread Pepijn de Geus
If you use WiQuery (which we do too, it's great), you can just let your 
component (Panel, WebMarkupContainer, Page) implement IWiQueryPlugin and 
implement statement().


On 13 jul 2011, at 20:01, Martin Grigorov wrote:

 Browse the sources at
 https://github.com/wicketstuff/core/tree/master/jdk-1.5-parent/jquery-parent
 
 On Wed, Jul 13, 2011 at 7:51 PM, hariharansrc hariharan...@gmail.com wrote:
 I want $(document).ready() a JQuery function to execute with wicket.I know i
 want to use wiquery but anybody tell how to call JQuery function using
 wiquery
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Adding-a-javascript-function-to-wicket-tp3665506p3665506.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
 
 
 
 
 
 -- 
 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
 


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



RE: url for images from database

2011-07-14 Thread Miroslav F.
Still be lost :-( 

This code I have in AppStart class:
mountSharedResource(/images/image1.jpg, new
ResourceReference(Images.class, image1.jpg).getSharedResourceKey());

Now after reading recomended example still not idea how to replace new
ResourceReference(... in above code snippet
in a way in which I get from byte[] shared resource key.

Please be kindfull, I'm in low level in java and greenhorn in wicket :-D

Miro



 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] 
 Sent: Tuesday, 12. July 2011 17:09
 To: users@wicket.apache.org
 Subject: Re: url for images from database
 
 https://cwiki.apache.org/WICKET/uploaddownload.html
 
 -igor
 
 On Tue, Jul 12, 2011 at 2:54 AM, Miroslav F. mir...@seznam.cz wrote:
  Is there example? How to get shared resource key from byte[] (image 
  from DB)? In my App class i do for several shared resources:
  mountSharedResource(/styles/style.css, new 
  ResourceReference(Styles.class, 
 style.css).getSharedResourceKey());
 
  Is is possible in this code getsharedResource() for byte[] 
 (image from 
  DB) in some way?
 
 
  -Original Message-
  From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
  Sent: Sunday, 10. July 2011 18:16
  To: users@wicket.apache.org
  Subject: Re: url for images from database
 
  use a shared resource to output the images instead of an Image 
  component
 
  -igor
 
  On Sun, Jul 10, 2011 at 6:44 AM, Miroslav F. 
 mir...@seznam.cz wrote:
   Hi folks,
  
   please direct me to right docu with following problem: I
  have image as
   byte[] from database which I display on pages.
  
   Works fine, on image atribute src is somethink like this:
   img
   
 src=?wicket:interface=:0:repeater:1:obrazok::IResourceListener::/
   
  
   For lightbox I need make this ugly src atribute transform to 
   something like src=/images/xxx.jpg and mount it
  on-the-fly but don't
   know how to do it.
  
   Is somewhere related example please?
  
   Thanks in advance,
  
   Miro
  
  
  
  
 -
   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
 
 
 
 
  
 -
  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
 
 


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



Problem with SCRIPT Tag in Ajax-Response in Wicket 1.5 RC5.1

2011-07-14 Thread Sergiy Barlabanov
Hi,
if a JavaScript script tag is added to AjaxRequestTarget (via
JavaScriptUtils.writeJavaScript), it is not evaluated on Chrome browser.
While debugging through wicket-ajax.js, it turns out, that
replaceOuterHtmlSafari function is not called for Chrome, but the Gecko
version gets executed instead (fall to } else /* GECKO */ { in
Wicket.replaceOuterHtml). And the Gecko version does not do any special
handling of SCRIPT tag, since Firefox does execute SCRIPT nodes added to the
DOM.
This behavior occurs since we upgraded from 1.5-RC4.2 to 1.5-RC5.1.
Seems like a bug, isn't it?

Chrome Version, which I used for testing is 12.0.742.112

Best regards,
Sergiy

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-with-SCRIPT-Tag-in-Ajax-Response-in-Wicket-1-5-RC5-1-tp3667783p3667783.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: Problem with SCRIPT Tag in Ajax-Response in Wicket 1.5 RC5.1

2011-07-14 Thread Martin Grigorov
Yes, this has been changed recently.
Chrome behaves like Firefox (Gecko) in many other respects but
apparently it fails here ...
Please file a ticket with a quickstart.

On Thu, Jul 14, 2011 at 5:41 PM, Sergiy Barlabanov
cont...@sergiy-barlabanov.de wrote:
 Hi,
 if a JavaScript script tag is added to AjaxRequestTarget (via
 JavaScriptUtils.writeJavaScript), it is not evaluated on Chrome browser.
 While debugging through wicket-ajax.js, it turns out, that
 replaceOuterHtmlSafari function is not called for Chrome, but the Gecko
 version gets executed instead (fall to } else /* GECKO */ { in
 Wicket.replaceOuterHtml). And the Gecko version does not do any special
 handling of SCRIPT tag, since Firefox does execute SCRIPT nodes added to the
 DOM.
 This behavior occurs since we upgraded from 1.5-RC4.2 to 1.5-RC5.1.
 Seems like a bug, isn't it?

 Chrome Version, which I used for testing is 12.0.742.112

 Best regards,
 Sergiy

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Problem-with-SCRIPT-Tag-in-Ajax-Response-in-Wicket-1-5-RC5-1-tp3667783p3667783.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





-- 
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



target.addComponent and impact

2011-07-14 Thread Brown, Berlin [GCG-PFS]
If you have an ajax event and then you call target.addComponent on
another component or collection of other components.
 
Are there issues with calling target.addComponent on components that
aren't visible or maybe detached from the page?
 
Or calling target.addComponent more than once on a particular component?



Can i include an external html fragment?

2011-07-14 Thread Mike Mander

Hi,

i would like to provide a way for our designer to change the homepage 
layout outside of the web-app.

But i'm not sure how to do it.

Usecase:
Wicket homepage contains a div-placeholder for the main-content.
Designer uploads a html fragment with divbla/div to a file-server.
In the HomePage class i add a component loading the file content from
the server by a constant url.

Is this possible?

Thanks
Mike


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



Re: target.addComponent and impact

2011-07-14 Thread Andrea Del Bene

Hi,

If you have an ajax event and then you call target.addComponent on
another component or collection of other components.
What do you mean with another component? You should be able to add any 
component you want, except AbstractRepeater subclasses (ListView, 
RepeatingView, ecc...). These components must be inside a different 
container to be updated via Ajax (i.e. you must call addComponent on 
this container).


Are there issues with calling target.addComponent on components that
aren't visible or maybe detached from the page?


You can call addComponent on invisible component but you must call 
setOutputMarkupPlaceholderTag before adding them (see Component 
JavaDoc). I never tried calling addComponent on a detached component...




Or calling target.addComponent more than once on a particular component?


That should lead to a multiple rendering of the component.


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



Re: target.addComponent and impact

2011-07-14 Thread vineet semwal
in last case i think rendering will be once because the components are
kept in map with markupid of component as key in ajaxrequesttarget.

On Thu, Jul 14, 2011 at 9:11 PM, Andrea Del Bene adelb...@ciseonweb.it wrote:
 Hi,

 If you have an ajax event and then you call target.addComponent on
 another component or collection of other components.

 What do you mean with another component? You should be able to add any
 component you want, except AbstractRepeater subclasses (ListView,
 RepeatingView, ecc...). These components must be inside a different
 container to be updated via Ajax (i.e. you must call addComponent on this
 container).

 Are there issues with calling target.addComponent on components that
 aren't visible or maybe detached from the page?

 You can call addComponent on invisible component but you must call
 setOutputMarkupPlaceholderTag before adding them (see Component JavaDoc). I
 never tried calling addComponent on a detached component...


 Or calling target.addComponent more than once on a particular component?

 That should lead to a multiple rendering of the component.


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





-- 
thank you,

regards,
Vineet Semwal

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



Re: Can i include an external html fragment?

2011-07-14 Thread Andrea Del Bene

Hi Mike,

take a look at interfaces IMarkupResourceStreamProvider and 
IMarkupCacheKeyProvider. Using the first one you can implement method 
getMarkupResourceStream which returns an IResourceStream with your 
custom HTML. The second interface has a method called getCacheKey. You 
must override it returning a simple null value. You have to do this in 
order to avoid HTML caching for your component and to be sure that it 
always loads updated content from server.



Hi,

i would like to provide a way for our designer to change the homepage 
layout outside of the web-app.

But i'm not sure how to do it.

Usecase:
Wicket homepage contains a div-placeholder for the main-content.
Designer uploads a html fragment with divbla/div to a file-server.
In the HomePage class i add a component loading the file content from
the server by a constant url.

Is this possible?

Thanks
Mike


-
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: target.addComponent and impact

2011-07-14 Thread Andrea Del Bene

Right, I've looked at code and it uses an hashmap

in last case i think rendering will be once because the components are
kept in map with markupid of component as key in ajaxrequesttarget.

On Thu, Jul 14, 2011 at 9:11 PM, Andrea Del Beneadelb...@ciseonweb.it  wrote:




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



Re: introducing wicket:for attribute

2011-07-14 Thread Igor Vaynberg
sweet, i will give that a go in the future. thanks.

-igor

On Thu, Jul 14, 2011 at 3:05 AM, Erik van Oosten e.vanoos...@grons.nl wrote:
 Its not @literal that removes the linebreaks. If you combine it with pre
 it works. (No need to add code as well.)

 *pre{@literal
 * label wicket:for=name
 * span class=label-textName/span:
 * /label
 * input wicket:id=name type=text/
 * }/pre
 *

 Regards,
    Erik.


 Op 13-07-11 17:55, Igor Vaynberg schreef:

 sweet, too bad  @literal does not preserve linebreaks. what we really
 need is a CDATA like javadoc tag.

 -igor

 On Wed, Jul 13, 2011 at 4:12 AM, Erik van Oostene.vanoos...@grons.nl
  wrote:

 Amazing stuff!

 You can write straight html in javadoc with the {@literal} syntax. E.g.:

 *p
 * Given markup like this:
 *
 *code{@literal
 *label wicket:for=namespan
 class=label-textName/span:/labelinput wicket:id=name
 type=text/
 * }/code
 *
 * If the {@code name} component has its label set to 'First Name' the
 resulting output will be:
 *code{@literal
 *label for=name5span class=label-textFirst
 Name/span:/labelinput name=name type=text id=name5/
 * }/code

 Regards,
    Erik.


 Op 13-07-11 01:50, Igor Vaynberg wrote:

 based on some feedback i changed the class name of the inner span from
 text to label-text to reduce chance of css collisions

 -igor

 On Fri, Jul 8, 2011 at 9:22 PM, Igor Vaynbergigor.vaynb...@gmail.com
  wrote:

 just implemented the wicket:for attribute. check out the javadoc here:



 http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/AutoLabelResolver.java?view=markuppathrev=1144589

 1.4.x only for now, still needs to be forward-ported to trunk.

 feedback?

 -igor



 -
 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: Can i include an external html fragment?

2011-07-14 Thread Martin Grigorov
Also see org.apache.wicket.markup.html.include.Include

On Thu, Jul 14, 2011 at 6:51 PM, Andrea Del Bene adelb...@ciseonweb.it wrote:
 Hi Mike,

 take a look at interfaces IMarkupResourceStreamProvider and
 IMarkupCacheKeyProvider. Using the first one you can implement method
 getMarkupResourceStream which returns an IResourceStream with your custom
 HTML. The second interface has a method called getCacheKey. You must
 override it returning a simple null value. You have to do this in order to
 avoid HTML caching for your component and to be sure that it always loads
 updated content from server.

 Hi,

 i would like to provide a way for our designer to change the homepage
 layout outside of the web-app.
 But i'm not sure how to do it.

 Usecase:
 Wicket homepage contains a div-placeholder for the main-content.
 Designer uploads a html fragment with divbla/div to a file-server.
 In the HomePage class i add a component loading the file content from
 the server by a constant url.

 Is this possible?

 Thanks
 Mike


 -
 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





-- 
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



RE: target.addComponent and impact

2011-07-14 Thread Brown, Berlin [GCG-PFS]
Let's say that I have a component in the hashmap that needs to get
updated and let's that I call target.addComponent on some parent
component, in that case will the child get updated twice.

E.g.

Target.addComponent(someChildComponent);
Target.addComponent(someParentOfTheChild);

In this case, will child get updated twice or still just once ...
Because the parent will take care of having the child updated?
-Original Message-
From: Andrea Del Bene [mailto:adelb...@ciseonweb.it] 
Sent: Thursday, July 14, 2011 11:55 AM
To: users@wicket.apache.org
Subject: Re: target.addComponent and impact

Right, I've looked at code and it uses an hashmap
 in last case i think rendering will be once because the components are

 kept in map with markupid of component as key in ajaxrequesttarget.

 On Thu, Jul 14, 2011 at 9:11 PM, Andrea Del
Beneadelb...@ciseonweb.it  wrote:



-
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: url for images from database

2011-07-14 Thread Igor Vaynberg
look at the very bottom of that page

-igor

On Thu, Jul 14, 2011 at 6:50 AM, Miroslav F. mir...@seznam.cz wrote:
 Still be lost :-(

 This code I have in AppStart class:
 mountSharedResource(/images/image1.jpg, new
 ResourceReference(Images.class, image1.jpg).getSharedResourceKey());

 Now after reading recomended example still not idea how to replace new
 ResourceReference(... in above code snippet
 in a way in which I get from byte[] shared resource key.

 Please be kindfull, I'm in low level in java and greenhorn in wicket :-D

 Miro



 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Sent: Tuesday, 12. July 2011 17:09
 To: users@wicket.apache.org
 Subject: Re: url for images from database

 https://cwiki.apache.org/WICKET/uploaddownload.html

 -igor

 On Tue, Jul 12, 2011 at 2:54 AM, Miroslav F. mir...@seznam.cz wrote:
  Is there example? How to get shared resource key from byte[] (image
  from DB)? In my App class i do for several shared resources:
  mountSharedResource(/styles/style.css, new
  ResourceReference(Styles.class,
 style.css).getSharedResourceKey());
 
  Is is possible in this code getsharedResource() for byte[]
 (image from
  DB) in some way?
 
 
  -Original Message-
  From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
  Sent: Sunday, 10. July 2011 18:16
  To: users@wicket.apache.org
  Subject: Re: url for images from database
 
  use a shared resource to output the images instead of an Image
  component
 
  -igor
 
  On Sun, Jul 10, 2011 at 6:44 AM, Miroslav F.
 mir...@seznam.cz wrote:
   Hi folks,
  
   please direct me to right docu with following problem: I
  have image as
   byte[] from database which I display on pages.
  
   Works fine, on image atribute src is somethink like this:
   img
  
 src=?wicket:interface=:0:repeater:1:obrazok::IResourceListener::/
   
  
   For lightbox I need make this ugly src atribute transform to
   something like src=/images/xxx.jpg and mount it
  on-the-fly but don't
   know how to do it.
  
   Is somewhere related example please?
  
   Thanks in advance,
  
   Miro
  
  
  
 
 -
   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
 
 
 
 
 
 -
  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




 -
 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: target.addComponent and impact

2011-07-14 Thread Martin Grigorov
just once. the parent will be rendered

On Thu, Jul 14, 2011 at 7:06 PM, Brown, Berlin [GCG-PFS]
berlin.br...@primerica.com wrote:
 Let's say that I have a component in the hashmap that needs to get
 updated and let's that I call target.addComponent on some parent
 component, in that case will the child get updated twice.

 E.g.

 Target.addComponent(someChildComponent);
 Target.addComponent(someParentOfTheChild);

 In this case, will child get updated twice or still just once ...
 Because the parent will take care of having the child updated?
 -Original Message-
 From: Andrea Del Bene [mailto:adelb...@ciseonweb.it]
 Sent: Thursday, July 14, 2011 11:55 AM
 To: users@wicket.apache.org
 Subject: Re: target.addComponent and impact

 Right, I've looked at code and it uses an hashmap
 in last case i think rendering will be once because the components are

 kept in map with markupid of component as key in ajaxrequesttarget.

 On Thu, Jul 14, 2011 at 9:11 PM, Andrea Del
 Beneadelb...@ciseonweb.it  wrote:



 -
 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





-- 
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



RE: target.addComponent and impact

2011-07-14 Thread Brown, Berlin [GCG-PFS]
One more question.

Is it is a hint to update this particular component?  Or will wicket
fully rerender the component the user whether it needs to get updated or
not?
 

-Original Message-
From: Brown, Berlin [GCG-PFS] 
Sent: Thursday, July 14, 2011 12:06 PM
To: 'users@wicket.apache.org'
Subject: RE: target.addComponent and impact

Let's say that I have a component in the hashmap that needs to get
updated and let's that I call target.addComponent on some parent
component, in that case will the child get updated twice.

E.g.

Target.addComponent(someChildComponent);
Target.addComponent(someParentOfTheChild);

In this case, will child get updated twice or still just once ...
Because the parent will take care of having the child updated?
-Original Message-
From: Andrea Del Bene [mailto:adelb...@ciseonweb.it]
Sent: Thursday, July 14, 2011 11:55 AM
To: users@wicket.apache.org
Subject: Re: target.addComponent and impact

Right, I've looked at code and it uses an hashmap
 in last case i think rendering will be once because the components are

 kept in map with markupid of component as key in ajaxrequesttarget.

 On Thu, Jul 14, 2011 at 9:11 PM, Andrea Del
Beneadelb...@ciseonweb.it  wrote:



-
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: target.addComponent and impact

2011-07-14 Thread Martin Grigorov
You added the component so it has to be re-rendered.

On Thu, Jul 14, 2011 at 7:18 PM, Brown, Berlin [GCG-PFS]
berlin.br...@primerica.com wrote:
 One more question.

 Is it is a hint to update this particular component?  Or will wicket
 fully rerender the component the user whether it needs to get updated or
 not?


 -Original Message-
 From: Brown, Berlin [GCG-PFS]
 Sent: Thursday, July 14, 2011 12:06 PM
 To: 'users@wicket.apache.org'
 Subject: RE: target.addComponent and impact

 Let's say that I have a component in the hashmap that needs to get
 updated and let's that I call target.addComponent on some parent
 component, in that case will the child get updated twice.

 E.g.

 Target.addComponent(someChildComponent);
 Target.addComponent(someParentOfTheChild);

 In this case, will child get updated twice or still just once ...
 Because the parent will take care of having the child updated?
 -Original Message-
 From: Andrea Del Bene [mailto:adelb...@ciseonweb.it]
 Sent: Thursday, July 14, 2011 11:55 AM
 To: users@wicket.apache.org
 Subject: Re: target.addComponent and impact

 Right, I've looked at code and it uses an hashmap
 in last case i think rendering will be once because the components are

 kept in map with markupid of component as key in ajaxrequesttarget.

 On Thu, Jul 14, 2011 at 9:11 PM, Andrea Del
 Beneadelb...@ciseonweb.it  wrote:



 -
 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





-- 
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



Re: Resource auto-reload with the Quickstart project

2011-07-14 Thread Matt Brictson
Hmm. I would expect that your LoginPage would see changes reflected when you 
hit the browser refresh button. Sounds like a bug to me.

Is it related to this one?

https://issues.apache.org/jira/browse/WICKET-3891

On Jul 13, 2011, at 12:10 PM, Andrew Todd wrote:

 On Wed, Jul 13, 2011 at 2:40 PM, Matt Brictson m...@55minutes.com wrote:
 FWIW I tried 1.5-SNAPSHOT and the HTML resource reloading seems to work fine.
 I'm seeing reloading working as expected on the basic HomePage.
 
 However, on a LoginPage that I'm working on, a I do not see changes
 reflected until I go to the URL bar, go to the home page URL, then go
 back to the URL and manually enter the Login Page URL (which I've set
 up with mountPage).
 
 Is this related to the way that Wicket handles sessions -- I've seen
 the word version passed around -- or is this a bug?
 
 -
 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



getRelativePathPrefixToWicketHandler String index out of range

2011-07-14 Thread Jonathan Gray
please excuse me if this is a dupe - i posted to the general apache forum
and then MOVED it to the users forum  i wasn't sure if the post would go to
the mailing list if it was moved rather than originally posted
there...anyway:


i have seen this error reported several times and i have seen wicket devs
come back and say that it is fixed.  what i see is that all versions of
wicket from 1.4.11 - 1.4.17 have this exact problem.  i have a number of
RESTful calls to an app that are rewritten w mod_rewrite.  the rewritten
requests are processed by a MultiActionController and which then uses
RequestDispatcher.forward to pass the request on to my custom
WebRequestCycle.  Anything that is rewritten by mod_rewrite in 1.4.11 or
greater throws the StringIndexOutOfBounds exception in the *
getRelativePathPrefixToWicketHandler* method when it tries to do this:


relativeUrl = filterPath == null ? relativeUrl :
relativeUrl.substring(filterPath.length());


because the forwardUrl = '/rw' and the relativeUrl =
'account/updates/14883'.  can someone please offer a workaround for this?
 let me know if you need more information.  upgrading to 1.5 is fine and
all, but i would like to get this working in 1.4, too.  i have seen several
threads on this problem but nothing that definitively  tells me what the
solution is.

thanks.


Re: Resource auto-reload with the Quickstart project

2011-07-14 Thread Andrew Todd
On Thu, Jul 14, 2011 at 1:22 PM, Matt Brictson m...@55minutes.com wrote:
 Hmm. I would expect that your LoginPage would see changes reflected when you 
 hit the browser refresh button. Sounds like a bug to me.

 Is it related to this one?

 https://issues.apache.org/jira/browse/WICKET-3891

This bug says that With 1.5RC5.1 Wicket does not pick markup changes
unless I change requested version, which is the phenomenon that I'm
seeing. (The version indicator is the little ?1 at the end of the
URL, right?) So that is probably my bug. Not using JRebel.

Thanks,
Andrew

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



Re: Generate ajax link

2011-07-14 Thread Lurtz Nazgul
Thanks Martin; but it doesn't make sense to me, sorry.

Wicket generates below code for a simple counter increment example.

 var wcall = 
wicketAjaxGet('?wicket:interface=:2:panel1:okla::IBehaviorListener:0:', 
function() {
}.bind(this), function() {
}.bind(this), function() {
return Wicket.$('okla') != null;
}.bind(this));
return !wcall;

Any suggestions ? 

Thanks.




From: Martin Grigorov mgrigo...@apache.org
To: users@wicket.apache.org
Sent: Thu, July 14, 2011 2:46:04 PM
Subject: Re: Generate ajax link

See how AjaxLink generates its markup.

On Thu, Jul 14, 2011 at 2:31 PM, Lurtz Nazgul lu...@ymail.com wrote:
 I mean; generating ajax link  format

 Instead of

 lia href='?thePanel=com.test.PanelOne'/a/li

 I want to generate ajax link on the fly

 Example :
 a onclick=var
 wcall=wicketAjaxGet('wicket/page?2-1.IBehaviorListener.0-c1--link',function() 
{
 }.bind(this),function() { }.bind(this), function() {return Wicket.$('idc') !=
 null;}.bind(this));return !wcall; id=idc href=#increment/a

 Any suggestions ?

 Thanks.




 
 From: Andrea Del Bene adelb...@ciseonweb.it
 To: users@wicket.apache.org
 Sent: Thu, July 14, 2011 2:00:32 PM
 Subject: Re: Generate ajax link

 Hi,

 you can use Loop component to generate a dynamic number of links. For example:



 HTML code:

 ol title=Menù class=main_menu
 li style=list-style: none; wicket:id=itemList
 a wicket:id=menuItem/a
 /li
 /ol



 Java  code:


 ListAbstractLink linkList = ...
 Loop loop = new Loop(itemList, linkList.size()) {
@Override
protected void populateItem(LoopItem item) {
AbstractLink curLink = linkList.get(item.getIndex());
item.add(curLink);
}
};



 Hi all;

 I can generate normal links in to my dynamic menu

 lia href='?thePanel=com.test.PanelOne'/a/li
 ...

 I wonder if i can generate those links in ajax link format ?

 Thanks.


 -
 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

[Announce] Wicket Stuff Core 1.4.17.3 Released

2011-07-14 Thread Michael O'Cleirigh

Hello,

Following just over 1 month from the 1.4.17.2 point release today I am 
pleased to announce the new 1.4.17.3 wicketstuff-core release.This 
is the third point release against the current stable wicket release of 
1.4.17.


The artifacts have been promoted and have synced into the maven central 
repository.


They can be retrieved like this:

dependency
groupIdorg.wicketstuff/groupId
artifactIdtinymce/artifactId
version1.4.17.3/version
/dependency

The release tag is here: 
https://github.com/wicketstuff/core/tree/wicketstuff-core-1.4.17.3


Development on the next release takes place on the core-1.4.x branch 
here: https://github.com/wicketstuff/core/tree/core-1.4.x


Issues can be reported here: https://github.com/wicketstuff/core/issues

The Project Wiki is available here: 
https://github.com/wicketstuff/core/wiki


Changelog between wicketstuff-core-1.4.17.2 and this release:

Jacob Brookover (6):
  -New Plugins
  -Removed settings not applicable to TinyMCE 3.4.1
  -Some TODO Notes about Toolbars; pretty sure ToolBar4 doesn't work
  -Added some Generics
  -Added a feature that 'removes' and 'adds' a TinyMCE instance in 
case the TextArea is redrawn via Ajax and, therefore, the behavior is 
run again.

  -Added a hack to get TinyMCE to load lazily
  -TinyMCEBehavior uses this hack if being added via an Ajax Request
  -Doc change
  Merge branch 'core-1.4.x' of github.com:jbrookover/core into 
core-1.4.x

  -StringBuilder improvements
  -Exception thrown if incorrect AutoResize feature is used
  Merge pull request #34 from jbrookover/core-1.4.x

Michael O'Cleirigh (5):
  [datatable-autocomplete] make IAutoCompletingResponseValidator 
extend IClusterable

  Merge remote branch 'origin/core-1.4.x' into core-1.4.x
  [datatable-autocomplete] Enable custom CSS resources for the 
overlay and table

  commit 1.4.17.3 release pom's
  define release scm and wicket version

Alexander Morozov (3):
  fixed grid initialization script rendering
  Fix realItemCount calculation
  Merge pull request #33 from shuraa/core-1.4.x

Boris Goldowsky (2):
  Update to TinyMCE 3.4.1
  Merge branch 'core-1.4.x' of git://github.com/wicketstuff/core 
into core-1.4.x


seb (1):
  wicketstuff-push-core: removed obsolete parameter Event 
from IPushService.createChannel method signature



(This listing was generated using: git shortlog -n 
wicketstuff-core-1.4.17.3..wicketstuff-core-1.4.17.2).


I will plan to do the next release within one month of today but if you 
commit code and/or need a release cut sooner please either contact me 
directly or file a ticket.


Regards,

Mike

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