Re: Another Behaviour Question

2010-05-20 Thread Steve Mactaggart
Please feel free to do so, I will enjoy updating my code to use the wiquery
version once its made it into a release. :)

I also have another behaviour wrapping the autoResize javascript from
http://james.padolsey.com/javascript/jquery-plugin-autoresize/.

That plugin allows textareas to automatically expand as more content is
typed into them.
If you think this is also useful let me know and I'll send you the Behaviour
code.

Cheers,
Steve

On Fri, May 21, 2010 at 2:33 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Hi Steve,
>
> Do you mind if I
>
> 1-copy your class
> 2-put your name in it,
> 3-use it as a basis to create WatermarkBehaviour implementing all the
> options provided by the plugin
> 4-and put it in a place accessible to others (e.g.
> http://code.google.com/p/wiquery-plugins/)?
>
> Best regards,
>
> Ernesto
>
> On Fri, May 21, 2010 at 4:25 AM, Steve Mactaggart
>  wrote:
> > You are right..  I have been able to do that now I found a true
> > implementation of the textbox watermark, not just my hacky javascript.
> >
> > For completeness I'm using the jquery-watermark code found at
> > http://code.google.com/p/jquery-watermark/
> >
> > And we are using wiQuery to do our wicket/jquery integration so here is
> the
> > behaviour that is working.
> > Feel free to copy and re-use..
> >
> >
> > public class TextFieldWatermarkBehaviour extends WiQueryAbstractBehavior
> {
> >
> >private final String text;
> >
> >public TextFieldWatermarkBehaviour(String text) {
> >this.text = text;
> >}
> >
> >@Override
> >public void contribute(WiQueryResourceManager wiQueryResourceManager)
> {
> >super.contribute(wiQueryResourceManager);
> >wiQueryResourceManager.addJavaScriptResource(new
> > JavascriptResourceReference(TextFieldWatermarkBehaviour.class,
> > "jquery.watermark.min.js"));
> >}
> >
> >@Override
> >public JsStatement statement() {
> >JsQuery query = new JsQuery(getComponent());
> >query.$().append(".watermark('"+text+"')");
> >return query.getStatement();
> >}
> >
> > }
> >
> > Cheers,
> > Steve
> >
> > On Fri, May 21, 2010 at 11:38 AM, James Carman
> > wrote:
> >
> >> Why not just use all javascript to manipulate the value of the text
> >> box?  Don't worry about the model.
> >>
> >> On Thu, May 20, 2010 at 9:36 PM, Steve Mactaggart
> >>  wrote:
> >> > Hi All,
> >> >
> >> > I want to do something really simple, have a text box that has a
> default
> >> > text in it (for example search) that when the user puts focus in the
> box
> >> the
> >> > text gets removed, and if they exit without typing the "search" text
> is
> >> put
> >> > back.
> >> >
> >> > I've got all the client side javascript, but my issue is with the
> Wicket
> >> > models, I don't want to set the default model value for these boxes to
> >> > "search" to have it displayed, I want to keep the models clean.
> >> >
> >> > I was thinking of wrapping the object model of the text box to have
> this
> >> > default value "search", and then have this model wrapper process strip
> >> out
> >> > "search" on submit, and put it in when the wrapped model is null.
> >> >
> >> > The only way I can think of doing that is to extend the TextBox to add
> >> this
> >> > logic.
> >> >
> >> > Is there any way this can be attached to existing text boxes via a
> >> behavour
> >> > or something like that?
> >> > Or better yet, does this feature already exist and I've just missed
> it?
> >> >
> >> > Cheers
> >> > Steve
> >> >
> >>
> >> -
> >> 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: Jquery UI Layout

2010-05-20 Thread Josh Kamau
Still on WiQuery,

I would also be glad if you let me know how to wrap up any JQuery plugin as
a wiquery component.

Regards.

On Fri, May 21, 2010 at 9:07 AM, Josh Kamau  wrote:

> Hi WiQuery Team,
>
> Do you have any plans of including Jquery UI Layout in wiQuery? I urgently
> need it.
>
> regards.
>
> Josh.
>


Jquery UI Layout

2010-05-20 Thread Josh Kamau
Hi WiQuery Team,

Do you have any plans of including Jquery UI Layout in wiQuery? I urgently
need it.

regards.

Josh.


Re: Another Behaviour Question

2010-05-20 Thread Ernesto Reinaldo Barreiro
Hi Steve,

Do you mind if I

1-copy your class
2-put your name in it,
3-use it as a basis to create WatermarkBehaviour implementing all the
options provided by the plugin
4-and put it in a place accessible to others (e.g.
http://code.google.com/p/wiquery-plugins/)?

Best regards,

Ernesto

On Fri, May 21, 2010 at 4:25 AM, Steve Mactaggart
 wrote:
> You are right..  I have been able to do that now I found a true
> implementation of the textbox watermark, not just my hacky javascript.
>
> For completeness I'm using the jquery-watermark code found at
> http://code.google.com/p/jquery-watermark/
>
> And we are using wiQuery to do our wicket/jquery integration so here is the
> behaviour that is working.
> Feel free to copy and re-use..
>
>
> public class TextFieldWatermarkBehaviour extends WiQueryAbstractBehavior {
>
>    private final String text;
>
>    public TextFieldWatermarkBehaviour(String text) {
>        this.text = text;
>    }
>
>   �...@override
>    public void contribute(WiQueryResourceManager wiQueryResourceManager) {
>        super.contribute(wiQueryResourceManager);
>        wiQueryResourceManager.addJavaScriptResource(new
> JavascriptResourceReference(TextFieldWatermarkBehaviour.class,
> "jquery.watermark.min.js"));
>    }
>
>   �...@override
>    public JsStatement statement() {
>        JsQuery query = new JsQuery(getComponent());
>        query.$().append(".watermark('"+text+"')");
>        return query.getStatement();
>    }
>
> }
>
> Cheers,
> Steve
>
> On Fri, May 21, 2010 at 11:38 AM, James Carman
> wrote:
>
>> Why not just use all javascript to manipulate the value of the text
>> box?  Don't worry about the model.
>>
>> On Thu, May 20, 2010 at 9:36 PM, Steve Mactaggart
>>  wrote:
>> > Hi All,
>> >
>> > I want to do something really simple, have a text box that has a default
>> > text in it (for example search) that when the user puts focus in the box
>> the
>> > text gets removed, and if they exit without typing the "search" text is
>> put
>> > back.
>> >
>> > I've got all the client side javascript, but my issue is with the Wicket
>> > models, I don't want to set the default model value for these boxes to
>> > "search" to have it displayed, I want to keep the models clean.
>> >
>> > I was thinking of wrapping the object model of the text box to have this
>> > default value "search", and then have this model wrapper process strip
>> out
>> > "search" on submit, and put it in when the wrapped model is null.
>> >
>> > The only way I can think of doing that is to extend the TextBox to add
>> this
>> > logic.
>> >
>> > Is there any way this can be attached to existing text boxes via a
>> behavour
>> > or something like that?
>> > Or better yet, does this feature already exist and I've just missed it?
>> >
>> > Cheers
>> > Steve
>> >
>>
>> -
>> 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: Another Behaviour Question

2010-05-20 Thread Steve Mactaggart
You are right..  I have been able to do that now I found a true
implementation of the textbox watermark, not just my hacky javascript.

For completeness I'm using the jquery-watermark code found at
http://code.google.com/p/jquery-watermark/

And we are using wiQuery to do our wicket/jquery integration so here is the
behaviour that is working.
Feel free to copy and re-use..


public class TextFieldWatermarkBehaviour extends WiQueryAbstractBehavior {

private final String text;

public TextFieldWatermarkBehaviour(String text) {
this.text = text;
}

@Override
public void contribute(WiQueryResourceManager wiQueryResourceManager) {
super.contribute(wiQueryResourceManager);
wiQueryResourceManager.addJavaScriptResource(new
JavascriptResourceReference(TextFieldWatermarkBehaviour.class,
"jquery.watermark.min.js"));
}

@Override
public JsStatement statement() {
JsQuery query = new JsQuery(getComponent());
query.$().append(".watermark('"+text+"')");
return query.getStatement();
}

}

Cheers,
Steve

On Fri, May 21, 2010 at 11:38 AM, James Carman
wrote:

> Why not just use all javascript to manipulate the value of the text
> box?  Don't worry about the model.
>
> On Thu, May 20, 2010 at 9:36 PM, Steve Mactaggart
>  wrote:
> > Hi All,
> >
> > I want to do something really simple, have a text box that has a default
> > text in it (for example search) that when the user puts focus in the box
> the
> > text gets removed, and if they exit without typing the "search" text is
> put
> > back.
> >
> > I've got all the client side javascript, but my issue is with the Wicket
> > models, I don't want to set the default model value for these boxes to
> > "search" to have it displayed, I want to keep the models clean.
> >
> > I was thinking of wrapping the object model of the text box to have this
> > default value "search", and then have this model wrapper process strip
> out
> > "search" on submit, and put it in when the wrapped model is null.
> >
> > The only way I can think of doing that is to extend the TextBox to add
> this
> > logic.
> >
> > Is there any way this can be attached to existing text boxes via a
> behavour
> > or something like that?
> > Or better yet, does this feature already exist and I've just missed it?
> >
> > Cheers
> > Steve
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Help me speed up my Wicket

2010-05-20 Thread Jeremy Thomerson
On Thu, May 20, 2010 at 12:28 PM, Edward Zarecor
wrote:

>  Rewinding this thread.  Comments and suggestion in-line.
>
>
> > The problem is that it renders very slowly in browsers.
> >
> > The reason is not directly network speed but it is the VERY heavy
> > markup. Each table cell has 3 ajax components and the ajax call
> > functions are loong.
> >
> >
> So you're doing ~60 network round trips for the calender component alone,
> if
> I understand correctly, and you don't think the issue is network related.
>  I
> find that hard to believe.  If you disable JavaScript in your browser or
> use
> some other method for preventing the Ajax from executing, does it still
> render slowly -- assuming it will render at all with Ajax disabled.
>

In his original post he showed the HTML - what he means is the rendering of
very long *strings* that represent the ajax onchange events.  Not that
they're each triggered when the page loads.



--
Jeremy Thomerson
http://www.wickettraining.com


Re: Another Behaviour Question

2010-05-20 Thread James Carman
Why not just use all javascript to manipulate the value of the text
box?  Don't worry about the model.

On Thu, May 20, 2010 at 9:36 PM, Steve Mactaggart
 wrote:
> Hi All,
>
> I want to do something really simple, have a text box that has a default
> text in it (for example search) that when the user puts focus in the box the
> text gets removed, and if they exit without typing the "search" text is put
> back.
>
> I've got all the client side javascript, but my issue is with the Wicket
> models, I don't want to set the default model value for these boxes to
> "search" to have it displayed, I want to keep the models clean.
>
> I was thinking of wrapping the object model of the text box to have this
> default value "search", and then have this model wrapper process strip out
> "search" on submit, and put it in when the wrapped model is null.
>
> The only way I can think of doing that is to extend the TextBox to add this
> logic.
>
> Is there any way this can be attached to existing text boxes via a behavour
> or something like that?
> Or better yet, does this feature already exist and I've just missed it?
>
> Cheers
> Steve
>

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



Another Behaviour Question

2010-05-20 Thread Steve Mactaggart
Hi All,

I want to do something really simple, have a text box that has a default
text in it (for example search) that when the user puts focus in the box the
text gets removed, and if they exit without typing the "search" text is put
back.

I've got all the client side javascript, but my issue is with the Wicket
models, I don't want to set the default model value for these boxes to
"search" to have it displayed, I want to keep the models clean.

I was thinking of wrapping the object model of the text box to have this
default value "search", and then have this model wrapper process strip out
"search" on submit, and put it in when the wrapped model is null.

The only way I can think of doing that is to extend the TextBox to add this
logic.

Is there any way this can be attached to existing text boxes via a behavour
or something like that?
Or better yet, does this feature already exist and I've just missed it?

Cheers
Steve


Re: adding behaviours

2010-05-20 Thread Jeremy Thomerson
It depends on what your behavior does.  Obviously if your behavior holds a
reference to the component that is passed in to bind(Component), you can not
use a shared behavior.

Anyway, it's really based on that particular behavior.  Safest bet is to
create one for each so you don't have a hard-to-track bug later.  But, if
that causes a performance issues, *some* behaviors could be shared.

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, May 18, 2010 at 11:12 PM, Joe Fawzy  wrote:

> Hi
> i have a large number of components in a page that i have to add the same
> behaviour
> should i use the same instance for all or instansiate one for every
> component(that's what i am currently doing);
> thanks
> Joe
>


Re: ListView highlight selected row

2010-05-20 Thread Jeremy Thomerson
Ah - the beauty of creating a quickstart.  It almost always makes us go back
and see what other weird combination of things is actually creating the
issue :)

--
Jeremy Thomerson
http://www.wickettraining.com



On Thu, May 20, 2010 at 3:18 PM, JeroenWolff  wrote:

>
> Now i've got it working with the quickstart and a simple ListView. Now i
> have
> to find out the difference and why it is now working..,now working on
> jetty...tomorrow i test it on Websphere...
>
> Thanks!
>
>
> public class HomePage extends WebPage {
>private Contact selected = new Contact();
>
>@SuppressWarnings("serial")
>public HomePage(final PageParameters parameters) {
>
>final WebMarkupContainer table = new
> WebMarkupContainer("table");
>PageableListView listView = new
> PageableListView(
>"contactrow", getContacts(), 4) {
>
>@Override
>protected ListItem newItem(int index) {
>ListItem item = new
> ListItem(index,
>getListItemModel(getModel(),
> index)) {
>
>@Override
>protected void
> onComponentTag(ComponentTag tag) {
>super.onComponentTag(tag);
>if (getModelObject() ==
> selected) {
> tag.put("class",
> "selected");
>}
>}
>
>};
>return item;
>}
>
>@Override
>protected void populateItem(final ListItem
> item) {
>Contact contact = item.getModelObject();
>
>final AjaxFallbackLink
> contactDateLink = new
> AjaxFallbackLink(
>"link") {
>
>@Override
>public void
> onClick(AjaxRequestTarget target) {
>
> selected = (Contact)
> getParent().getDefaultModelObject();
>
>if (target != null) {
>
>  target.addComponent(table);
>}
>
>}
>
>};
>contactDateLink.add(new Label("linklabel",
> contact.getContactDate().toString()));
>item.add(contactDateLink);
>item.add(new Label("code",
> contact.getCode()));
>item.add(new Label("description",
> contact.getDescription()));
>}
>
>};
>table.setOutputMarkupId(true);
>table.add(listView);
>add(table);
> add(new AjaxPagingNavigator("navigator", listView));
>
>}
>
> public static List getContacts() {
>List resultList = new ArrayList();
>Contact contact = new Contact("A", new Date(),
> "description1");
>resultList.add(contact);
>contact = new Contact("B", new Date(), "description2");
>resultList.add(contact);
>contact = new Contact("C", new Date(), "description3");
>resultList.add(contact);
>contact = new Contact("D", new Date(), "description4");
>resultList.add(contact);
>return resultList;
>}
>
> }
>
> @SuppressWarnings("serial")
> class Contact implements Serializable {
>private String code;
>private Date contactDate;
>private String description;
>
>public Contact() {
>super();
>}
>
>public Contact(String code, Date contactDate, String description) {
>super();
>this.code = code;
>this.contactDate = contactDate;
>this.description = description;
>}
>
>public String getCode() {
>return code;
>}
>
>public void setCode(String code) {
>this.code = code;
>}
>
>public Date getContactDate() {
>return contactDate;
>}
>
>public void setContactDate(Date contactDate) {
>this.contactDate = contactDate;
>}
>
>public String getDescription() {
>return description;
>}
>
>public void setDescription(String description) {
>this.description = description;
>}
>
> }
>
>
>
> 
>
> 
>  

Re: Exempt pages from pagemap

2010-05-20 Thread Loren Cole
Unfortunately no, in most cases I'm using LoadableDetachable models.

Thanks,
Loren

On Wed, May 19, 2010 at 5:09 AM, Martijn Dashorst <
martijn.dasho...@gmail.com> wrote:

> Are your models static instead of LoadableDetachable and/or PropertyModels?
>
> Martijn
>
> On Tue, May 18, 2010 at 10:38 PM, Loren Cole  wrote:
> > I've got a couple of pages which display data that changes often and I
> want
> > to be sure that when a user hits refresh they get a fresh new copy of
> that
> > page.  Unfortunately, if I've used setResponsePage(new MyPage(params); to
> > get to these pages, then a refresh does not update the data, while
> hitting
> > the back button and resubmitting or clicking a link to the bookmarkable
> page
> > does.
> >
> > Is there a way I can simply exempt these pages from the cache using
> wicket
> > 1.3.7?
> >
> > Thanks,
> > Loren
> >
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
> Apache Wicket 1.4 increases type safety for web applications
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.7
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Submit form with ajax on enter

2010-05-20 Thread bluejack



cbchhaya wrote:
> 
> John,
> 
> Is the fix in 1.4.7?
> 
> 
> John Patterson wrote:
>> 
>> If I remember correctly, my patch was applied so you can now attach the
>> AjaxFormSubmitBehavior directly to the form and listen for onsubmit. 
>> This handles both enter and click.
>> 
> 
> 

It does not look like it is in as of 1.4.8; unless I'm doing something
wrong, the code is never exercised, and the enter key submits the form in
non-ajax fashion.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Submit-form-with-ajax-on-enter-tp1843787p2225330.html
Sent from the Wicket - User mailing list archive at Nabble.com.


Re: ListView highlight selected row

2010-05-20 Thread JeroenWolff

Now i've got it working with the quickstart and a simple ListView. Now i have
to find out the difference and why it is now working..,now working on
jetty...tomorrow i test it on Websphere...

Thanks!


public class HomePage extends WebPage {
private Contact selected = new Contact();

@SuppressWarnings("serial")
public HomePage(final PageParameters parameters) {

final WebMarkupContainer table = new 
WebMarkupContainer("table");   
PageableListView listView = new 
PageableListView(
"contactrow", getContacts(), 4) {

@Override
protected ListItem newItem(int index) {
ListItem item = new 
ListItem(index,
getListItemModel(getModel(), 
index)) {

@Override
protected void 
onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
if (getModelObject() == 
selected) {
tag.put("class", 
"selected");
} 
}

};
return item;
}

@Override
protected void populateItem(final ListItem 
item) {
Contact contact = item.getModelObject();

final AjaxFallbackLink contactDateLink 
= new
AjaxFallbackLink(
"link") {

@Override
public void onClick(AjaxRequestTarget 
target) {

selected = (Contact) 
getParent().getDefaultModelObject();

if (target != null) {

target.addComponent(table);
}

}

};
contactDateLink.add(new Label("linklabel",
contact.getContactDate().toString()));
item.add(contactDateLink);
item.add(new Label("code", contact.getCode()));
item.add(new Label("description", 
contact.getDescription()));
}

};
table.setOutputMarkupId(true);
table.add(listView);
add(table);
add(new AjaxPagingNavigator("navigator", listView));

}

public static List getContacts() {
List resultList = new ArrayList();
Contact contact = new Contact("A", new Date(), "description1");
resultList.add(contact);
contact = new Contact("B", new Date(), "description2");
resultList.add(contact);
contact = new Contact("C", new Date(), "description3");
resultList.add(contact);
contact = new Contact("D", new Date(), "description4");
resultList.add(contact);
return resultList;
}

}

@SuppressWarnings("serial")
class Contact implements Serializable {
private String code;
private Date contactDate;
private String description;

public Contact() {
super();
}

public Contact(String code, Date contactDate, String description) {
super();
this.code = code;
this.contactDate = contactDate;
this.description = description;
}

public String getCode() {
return code;
}

public void setCode(String code) {
this.code = code;
}

public Date getContactDate() {
return contactDate;
}

public void setContactDate(Date contactDate) {
this.contactDate = contactDate;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

}








ContactDate
Description


[code]
 

Re: HttpServletRequest in WicketApplication

2010-05-20 Thread James Carman
RequestCycle.get().getRequest()?  You just have to make sure you're
doing that within the context of a request, of course.

On Thu, May 20, 2010 at 3:38 PM, fachhoch  wrote:
>
> but in a subclass of   org.apache.wicket.protocol.http.WebApplication   I
> cannot call getRequest() can I ?
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/HttpServletRequest-in-WicketApplication-tp2225141p2225183.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



Re: HttpServletRequest in WicketApplication

2010-05-20 Thread fachhoch

but in a subclass of   org.apache.wicket.protocol.http.WebApplication   I
cannot call getRequest() can I ?

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/HttpServletRequest-in-WicketApplication-tp2225141p2225183.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: HttpServletRequest in WicketApplication

2010-05-20 Thread James Carman
https://cwiki.apache.org/WICKET/raw-httpservletrequest.html

On Thu, May 20, 2010 at 3:17 PM, fachhoch  wrote:
>
> I mean subclass of org.apache.wicket.protocol.http.WebApplication
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/HttpServletRequest-in-WicketApplication-tp2225141p2225151.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



Re: HttpServletRequest in WicketApplication

2010-05-20 Thread fachhoch

I mean subclass of org.apache.wicket.protocol.http.WebApplication
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/HttpServletRequest-in-WicketApplication-tp2225141p2225151.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: ListView highlight selected row

2010-05-20 Thread Igor Vaynberg
maybe your javascript is overriding it

-igor

On Thu, May 20, 2010 at 12:04 PM, JeroenWolff  wrote:
>
> thanks, it is not rendered in the html (view source in browser)
> when i disable Javascript it works fine! I will put it in the quickstart and
> report it in Jira
>
> thanks
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/ListView-highlight-selected-row-tp2197486p2225133.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



HttpServletRequest in WicketApplication

2010-05-20 Thread fachhoch

I want to retrieve my context path  using HttpServletRequest  in subclass of
WicketApplication is it possible ?

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/HttpServletRequest-in-WicketApplication-tp2225141p2225141.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: ListView highlight selected row

2010-05-20 Thread JeroenWolff

thanks, it is not rendered in the html (view source in browser)
when i disable Javascript it works fine! I will put it in the quickstart and
report it in Jira 

thanks
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ListView-highlight-selected-row-tp2197486p2225133.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: "The page isn't redirecting properly" error

2010-05-20 Thread Douglas Ferguson
I think part of the problem is that we have a RequestCycleProcessor that 
redirects pages to ssl if they are secure page.
The problem seems to be related to setResponsePage in an ajax callback, and 
then redirecting from that call...

D/


On May 20, 2010, at 12:25 PM, Douglas Ferguson wrote:

> This used to work in previous versions of wicket, now we get an error.
> 
> The page isn't redirecting properly
> 
> final AjaxButton button = new AjaxButton("button") {
> private static final long serialVersionUID = 1L;
> 
> @Override
> protected void onSubmit(AjaxRequestTarget target, Form form) {
>   setResponsePage(new MyPage(params)));
> }
> };


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



Re: pass request context to jquey in wicket pages

2010-05-20 Thread fachhoch

I am asking about passing the context name to script,

I have a Behaviour class which extends from
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior  
 
here code  for my behaviour class

public class AuditBehaviour extends JQueryBehavior {



@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);

response.renderJavascript((String)SpringApplicationContext.getBean("downloadHelpScript"),"filedownload");
}
}
I define this script inside a spring bean 




 




and access with mu util   
SpringApplicationContext.getBean("downloadHelpScript")

now my question is how can I pass request context to replace  
{requestContext} in the script.





-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/pass-request-context-to-jquey-in-wicket-pages-tp2224828p2224990.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: Help me speed up my Wicket

2010-05-20 Thread Martin Makundi
Hi!

> So you're doing ~60 network round trips for the calender component alone, if
> I understand correctly,

No, that's not it, you have misunderstood. No roundtrips. Just single
pageload. Ajax events occur only if user clicks on components, but
that is not the issue. The issue is the heavy markup that is loaded on
the single pageload.

>> I think you should pre-compute the initial state of your calender on page
> load, all the work done in ~1 round trip, and use Ajax to handle changes
> that must be reflected dynamically.  Maybe I don't understand your use case
> well enough, is there some reason you could not do what I suggest?

This is already done. That is not the issue. The issue is LOADING the
markup. Plain html with javascript content. The issue is not executing
the javascript. Only rendering it is an issue, beacuse it is so heavy.
Look at the first post there is an excerpt of the heavy markup.

**
Martin
>
>
>  Ed.
>

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



Re: Help me speed up my Wicket

2010-05-20 Thread Edward Zarecor
 Rewinding this thread.  Comments and suggestion in-line.


> The problem is that it renders very slowly in browsers.
>
> The reason is not directly network speed but it is the VERY heavy
> markup. Each table cell has 3 ajax components and the ajax call
> functions are loong.
>
>
So you're doing ~60 network round trips for the calender component alone, if
I understand correctly, and you don't think the issue is network related.  I
find that hard to believe.  If you disable JavaScript in your browser or use
some other method for preventing the Ajax from executing, does it still
render slowly -- assuming it will render at all with Ajax disabled.


> I have tested to strip away all ajax calls and it renders pretty OK.
> Now what I am thinking is that is there a way to shorten the wicket
> ajax call urls?
>
>
> Note that stripping away the Ajax calls strips away the round trips, not
just the mark up.  I believe the round trips are the real issue.

>
> Any practical suggestions?
>
>
> I think you should pre-compute the initial state of your calender on page
load, all the work done in ~1 round trip, and use Ajax to handle changes
that must be reflected dynamically.  Maybe I don't understand your use case
well enough, is there some reason you could not do what I suggest?


 Ed.


"The page isn't redirecting properly" error

2010-05-20 Thread Douglas Ferguson
This used to work in previous versions of wicket, now we get an error.

The page isn't redirecting properly

final AjaxButton button = new AjaxButton("button") {
private static final long serialVersionUID = 1L;

@Override
protected void onSubmit(AjaxRequestTarget target, Form form) {
   setResponsePage(new MyPage(params)));
}
};


Re: Wicket Cobertura problem

2010-05-20 Thread nino martinez wael
Damn, what about making a quickstart, and we can see if we can
replicate the problem?

2010/5/20 David Alves :
> Jetty dependencies are part of the core app, (not just for testing).
> I am actually using sonar :)
> The sonar:sonar goal was where the build first failed, while in the cobertura 
> plugin.
> Since then I tried with cobertura standalone and it also fails, therefore my 
> original question.
>
>
> On May 20, 2010, at 8:04 AM, nino martinez wael wrote:
>
>> you are running with the dependencies for jetty as test scoped or?
>> What if you use something like sonar does that make a diff..
>>
>> 2010/5/19 David Alves :
>>> Exactly.
>>> weird right?
>>>
>>> I'm not 100% sure that it is a wicket problem (it could be a jetty 
>>> problem), still I find suspicious that the only stuff missing from the logs 
>>> when it fails is the wicket stuff.
>>>
>>> On May 19, 2010, at 8:29 PM, nino martinez wael wrote:
>>>
 Strange, I haven't encounter problems like that.. So it works when
 running mvn test or mvn clean install?

 2010/5/19 David Alves :
> Hi Nino
>
>        I'm using maven, it only fails when I run the cobertura:cobertura 
> target.
>
> David
> On May 19, 2010, at 6:57 PM, nino martinez wael wrote:
>
>> what are you using to build with maven, ant or?
>>
>> 2010/5/19 David Alves :
>>> Hi
>>>
>>>        I'm quite new to wicket, and I'm having a strange problem. I'm 
>>> using wicket (1.4.8) with embedded jetty in a large cluster application.
>>>        Everything works out most of the time, except when I run 
>>> cobertura test coverage (under maven).
>>>        Starting my application in every other context yelds the 
>>> following in the logs:
>>>
>>> ...
>>> 2010-05-19 17:46:03,195 INFO [main] log.Slf4jLog (55): Logging to 
>>> org.slf4j.impl.Log4jLoggerAdapter(org.eclipse.jetty.util.log) via 
>>> org.eclipse.jetty.util.log.Slf4jLog 2010-05-19 17:46:03,267 INFO [main] 
>>> log.Slf4jLog (55): jetty-7.1.0.RC1 2010-05-19 17:46:03,475 INFO [main] 
>>> log.Slf4jLog (55): NO JSP Support for /, did not find 
>>> org.apache.jasper.servlet.JspServlet 2010-05-19 17:46:03,476 WARN 
>>> [main] log.Slf4jLog (40): java.lang.ClassNotFoundException: 
>>> org.eclipse.jetty.jsp.JettyLog 2010-05-19 17:46:03,797 INFO [main] 
>>> wicket.Application (842): [FloodWebApplication] init: Wicket extensions 
>>> initializer 2010-05-19 17:46:03,824 INFO [main] wicket.Application 
>>> (842): [FloodWebApplication] init: Wicket core library initializer 
>>> 2010-05-19 17:46:03,826 INFO [main] wicket.RequestListenerInterface 
>>> (276): registered listener interface [RequestListenerInterface 
>>> name=IBehaviorListener, method=public abstract void 
>>> org.apache.wicket.behavior.IBehaviorListener.onRequest()] 2010-05-19 
>>> 17:46:03,827 INFO [main] wicket.RequestListenerInterface (276): 
>>> registered listener interface [RequestListenerInterface 
>>> name=IBehaviorListener, method=public abstract void 
>>> org.apache.wicket.behavior.IBehaviorListener.onRequest()] 2010-05-19 
>>> 17:46:03,829 INFO [main] wicket.RequestListenerInterface (276): 
>>> registered listener interface [RequestListenerInterface 
>>> name=IFormSubmitListener, method=public abstract void 
>>> org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]
>>>  2010-05-19 17:46:03,852 INFO [main] wicket.RequestListenerInterface 
>>> (276): registered listener interface [RequestListenerInterface 
>>> name=IFormSubmitListener, method=public abstract void 
>>> org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]
>>>  2010-05-19 17:46:03,853 INFO [main] wicket.RequestListenerInterface 
>>> (276): registered listener interface [RequestListenerInterface 
>>> name=ILinkListener, method=public abstract void 
>>> org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()] 
>>> 2010-05-19 17:46:03,854 INFO [main] wicket.RequestListenerInterface 
>>> (276): registered listener interface [RequestListenerInterface 
>>> name=ILinkListener, method=public abstract void 
>>> org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()] 
>>> 2010-05-19 17:46:03,856 INFO [main] wicket.RequestListenerInterface 
>>> (276): registered listener interface [RequestListenerInterface 
>>> name=IOnChangeListener, method=public abstract void 
>>> org.apache.wicket.markup.html.form.IOnChangeListener.onSelectionChanged()]
>>>  2010-05-19 17:46:03,856 INFO [main] wicket.RequestListenerInterface 
>>> (276): registered listener interface [RequestListenerInterface 
>>> name=IOnChangeListener, method=public abstract void 
>>> org.apache.wicket.markup.html.form.IOnChangeListener.onSelectionChanged()]
>>>  2010-05-19 17:46:03,857 INFO [main] wicket.RequestListenerInterface 
>>> (27

Re: pass request context to jquey in wicket pages

2010-05-20 Thread Nikita Tovstoles
Take a look at: WebRequest.getURL() and RequestUtils.toAbsolutePath()

-nikita



On Thu, May 20, 2010 at 9:19 AM, fachhoch  wrote:

>
>
>
> here is my jqery
>
>
>  $(document).ready(function(){
>
> $("a.downloadHelp").live('click', function(e){
>
>  e.preventDefault();
>
>  window.location.href = '/artms/downloads/db-model.pdf';
>   });
>});
>
>
> artms is my request Context ,I add this   script to my pages  using
> response.renderJavascript, is there any way I can pass the request context
> instead of hardcoding it?
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/pass-request-context-to-jquey-in-wicket-pages-tp2224828p2224828.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
>
>


pass request context to jquey in wicket pages

2010-05-20 Thread fachhoch



here is my jqery


$(document).ready(function(){
   
$("a.downloadHelp").live('click', function(e){

e.preventDefault();  

window.location.href = '/artms/downloads/db-model.pdf';
   });
});


artms is my request Context ,I add this   script to my pages  using 
response.renderJavascript, is there any way I can pass the request context
instead of hardcoding it?

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/pass-request-context-to-jquey-in-wicket-pages-tp2224828p2224828.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: Null from urlFor() on

2010-05-20 Thread Igor Vaynberg
urlfor does not guarantee a url for every irequesttarget
implementation you throw at it. only a "standard" subset of targets is
supported, mainly the ones that provide the "standard" functionality
such as page, component, and resource urls.

if wicket does not provide a way to build the url you may do so
yourself by subclassing webrequestcodingstrategy and adding the
instanceof check for the particular target type.

as far as this particular cases, i would defintely say that this
particular target is outside the standard requirements and as such i
dont think we need to provide url building for it out of the box.
however, should you choose to implement it you are more then welcome
to submit a patch.

-igor


On 5/20/10, Wilhelmsen Tor Iver  wrote:
> We are trying to "tunnel" some images from a content system, and run into a
> problem trying to make URLs for them via UrLResourceStream: Stepping through
> the code we see some instanceof-testing but none which deals with this
> particular resource type. Is there some missing code somewhere or a better
> approach to use?
>
> WebMarkupContainer cont = new WebMarkupContainer("image");
> try {
> URL image = new
> URL("http://servername/servletname/path?parameter=velue";);
> UrlResourceStream stream = new
> UrlResourceStream(image);
> ResourceStreamRequestTarget target = new
> ResourceStreamRequestTarget(stream);
> CharSequence link = urlFor(target); // RETURNS NULL
> cont.add(new SimpleAttributeModifier("src", link));
> } catch (MalformedURLException e) {
> e.printStackTrace();
> }
> this.add(cont);
>
>
> Med vennlig hilsen
>
> TOR IVER WILHELMSEN
> Senior systemutvikler
> Arrive AS
> T (+47) 48 16 06 18
> E-post: toriv...@arrive.no
> http://www.arrive.no
> http://servicedesk.arrive.no
>
>
>
>

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



Re: ListView highlight selected row

2010-05-20 Thread Igor Vaynberg
so its not rendered in markup? or its rendered in markup but you dont
see the effect? if latter its most likely a css issue, if former
create a quickstart and attach it to a jira issue.

-igor

On 5/20/10, JeroenWolff  wrote:
>
> Igor, you are right. It is still not rendered when i do the
> super.onComponentTag after the tag.put.
>
> This is the markup for the listview. "zoekresultaat" is the id for the
> listview.
>
> When the page is rendered the first time it works fine, but not in Ajax
> updates. In the debugger is see that on the selected item the put is done,
> but i don't see it rendered.
>
> Thanks
>
>
>   
>   
>   
>   
>   Contactmoment
>   Omschrijving
>   
>onmouseover="this.bgColor='gold';" onmouseout="this.bgColor='#FF';">
>   [x]
>#  
>   [blabla]
>   
>   
>   
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/ListView-highlight-selected-row-tp2197486p2224291.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



Re: Bigger sites running on wicket?

2010-05-20 Thread Martin Sachs
Yes Springer.com is online since Feb 2010.  We didnt have post  an
announcement, because we are in stabilizing-phase the past month.

We use Wicket-1.4.5 and JQuery for effects and modal-windows.

regards
Martin

Martijn Dashorst schrieb:
> Yup,
>
> http://mobile.walmart.com is Wicket based, as are
> http://mexico.com,
> http://vegas.com,
> http://springer.com (didn't know about this one!),
> http://jalbum.net/create/
> http://eropuit.nl
> ...
>
> Search for "wicket:interface" with google and filter out the blog
> posts and forum questions. You'll see that more websites are using
> Wicket.
>
> Martijn
>
> On Thu, May 13, 2010 at 4:18 PM,   wrote:
>   
>> Some things I've seen on this forum...Wal-Mart's mobile site, lasvegas.com
>>
>>
>>
>> Notice: This communication, including any attachments, is intended solely
>> for the use of the individual or entity to which it is addressed. This
>> communication may contain information that is protected from disclosure
>> under State and/or Federal law. Please notify the sender immediately if
>> you have received this communication in error and delete this email from
>> your system. If you are not the intended recipient, you are requested not
>> to disclose, copy, distribute or take any action in reliance on the
>> contents of this information.
>> 
>
>
>
>   



Re: Help me speed up my Wicket

2010-05-20 Thread nino martinez wael
Well not true in this case, because it's the rendering itself that are
slow not the transfer. But true it will add a overhead to page load
transfer time and if latency are bad it would be even worse.

2010/5/20 Matthias Keller :
> And it would not speed up page loading at all since in the end, the same
> data would have to be transferred but splitted into multiple requests which
> adds the request overhead to the total loading time compared to the prepared
> complete page.
>
> On 2010-05-20 10:25, Martin Makundi wrote:
>>
>> Would this not flicker a lot?
>>
>> **
>> Martin
>>
>> 2010/5/20 nino martinez wael:
>>
>>>
>>> ok the idea are this:
>>>
>>> First render the page with out the grid.
>>> Then add the empty grid
>>> Then add row 1 to grid
>>> Adding row 1 triggers a new request adding row 2 and so on until all
>>> rows are loaded..
>>>
>>> All done with ajax.
>>>
>>> It's just an idea, but I think it should help. However it causes more
>>> load on the server I think.
>>>
>>> 2010/5/20 Martin Makundi:
>>>
>
>
>

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



Re: Help me speed up my Wicket

2010-05-20 Thread nino martinez wael
Depends on how you do it, but if you always know the height then no,
the rows would just appear.. You could use a ajax indicator to tell
the user that the page are loading.

2010/5/20 Martin Makundi :
> Would this not flicker a lot?
>
> **
> Martin
>
> 2010/5/20 nino martinez wael :
>> ok the idea are this:
>>
>> First render the page with out the grid.
>> Then add the empty grid
>> Then add row 1 to grid
>> Adding row 1 triggers a new request adding row 2 and so on until all
>> rows are loaded..
>>
>> All done with ajax.
>>
>> It's just an idea, but I think it should help. However it causes more
>> load on the server I think.
>>
>> 2010/5/20 Martin Makundi :
>>> Yes.. what you mean cascade load?
>>>
>>> **
>>> Martin
>>>
>>> 2010/5/20 nino martinez wael :
 No havent had the problem myself. But I guess you should start by
 loading the page without the listview enabled, and then add the
 listview afterwards and see if that helps. Next step would be to
 cascade load the rows...

 2010/5/19 Martin Makundi :
> Hmm.. can you show me an example of something like that, how is it done?
>
> **
> Martin
>
> 2010/5/19 nino martinez wael :
>> about the lazyloading, I was thinking to cascade load the rows after
>> page render, it should perform better in theory:)...
>>
>> 2010/5/19 Martin Makundi :
>>> Hi!
>>>
 hmm could'nt just use a custom ajax decorator? Or override the js part
 of the onchangeajaxbehaviour?
>>>
>>> Hmm.. sounds like a good starting point...  thanks.
>>>
>>> BTW: I totally lost you on that lazy loading thing... the user would
>>> like the page to load in a snap and using it to be like a snap. How
>>> would your proposed lazy loading be implemented?
>>>
>>> **
>>> Martin

 2010/5/19 Jeremy Thomerson :
> Well, if the rendering of all that extra JS is what's causing the 
> problem,
> I'd try to limit it to one rendering of the (slightly-modified) 
> behavior.
>
> You can basically render something like this:
>
> function somethingInMyTableChanged(rowInd) {
>  return wicketAjaxGet('{standardBehaviorUrl}&rowIndex=' + rowInd);
> }
>
> Then, you add a simple behavior to your row items like:
>
> new SimpleAttributeModifier("onchange", true, new 
> Model("return
> somethingInMyTableChanged(" + item.getRowIndex() + ");");
>
> In your behavior, now you have to do a little extra work (don't use an
> onchangeajaxbehavior, just use a custom defaultajaxbehavior or 
> something
> like that).  You'll need to call
> RequestCycle.get().getRequest().getServletRequest().getQueryParameters().get("rowIndex")
> and use that to see which row changed.
>
> Anyway, it should work, but it's a little less "clean" than you 
> normally
> would do in Wicket.  BUT - if you have proven that it's the rendering 
> of all
> that extra AJAX string stuff that's slowing you down, then it's worth 
> doing.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Wed, May 19, 2010 at 11:09 AM, Martin Makundi <
> martin.maku...@koodaripalvelut.com> wrote:
>
>> Hi!
>>
>> Yes.. my question now is: how to easily extract the JS? It is from
>> onchangeajaxbehavior etc.
>>
>> I would like to continue using wicket standard onchangeajaxbehavior
>> but somehow override the way it injects the js into the component 
>> tag.
>> Suggestions to accomplish this?
>>
>> **
>> Martin
>>
>> 2010/5/19 Jeremy Thomerson :
>> > If you've already proven that removing the AJAX removes the 
>> > contention,
>> I'd
>> > go with Nino's "otherwise" route.  That was my first guess.  
>> > Depending on
>> > what you're doing with those AJAX calls, you could probably make 
>> > it so
>> that
>> > you have one to three of them for the entire table, wrapped in a 
>> > custom
>> > function.  (You don't have to extract them to a separate JS).  
>> > Then each
>> row
>> > would shorten it's JavaScript output to 
>> > myCustomFunction(rowIndex).  If
>> you
>> > need some help, let us know.  I posted a message on this list a 
>> > week or
>> so
>> > ago showing how to wrap existing AJAX in a custom function.  That 
>> > might
>> > help, too.
>> >
>> > --
>> > Jeremy Thomerson
>> > http://www.wickettraining.com
>> >
>> >
>> >
>> > On Wed, May 19, 2010 at 10:51 AM, nino mart

Null from urlFor() on

2010-05-20 Thread Wilhelmsen Tor Iver
We are trying to "tunnel" some images from a content system, and run into a 
problem trying to make URLs for them via UrLResourceStream: Stepping through 
the code we see some instanceof-testing but none which deals with this 
particular resource type. Is there some missing code somewhere or a better 
approach to use?

WebMarkupContainer cont = new WebMarkupContainer("image");
try {
URL image = new 
URL("http://servername/servletname/path?parameter=velue";);
UrlResourceStream stream = new UrlResourceStream(image);
ResourceStreamRequestTarget target = new 
ResourceStreamRequestTarget(stream);
CharSequence link = urlFor(target); // RETURNS NULL
cont.add(new SimpleAttributeModifier("src", link));
} catch (MalformedURLException e) {
e.printStackTrace();
}
this.add(cont);


Med vennlig hilsen

TOR IVER WILHELMSEN
Senior systemutvikler
Arrive AS
T (+47) 48 16 06 18
E-post: toriv...@arrive.no
http://www.arrive.no
http://servicedesk.arrive.no





Re: Image Upload Using TinyMCE Within Wicket Framework

2010-05-20 Thread Michał Letyński

Hi.
W dniu 2010-05-20 13:29, Muro Copenhagen pisze:

Hi Michal

The idea is that users can upload a question, with images related to that
question.

So after upload, the image will be seen as "regular" text.

We are expecting many pictures to be uploaded...So i probably want to use
shared resources.

But still then i have to parse and rerender the src of the image?
   
 src attribute in img points to component which is responsible for 
showing this image only in tiny. Showing this image in text later it's a 
different topic :)
If you want to show image via Label component so yes it must be changed. 
But if you want to show an image via Image component from Resource(my 
apparoach) or from ResourceReference (shared resource approach)
src attribute does not matter for you since it will be generated 
automaticaly by Image component.


But if you will create Image component like in that link which you gave me:
   new Image("image", new ResourceReference("images"),
new ValueMap("id=" + imageId))
You are not interested with src attribute at all.


I will try to work on a solution with shared resources :)

Thanks for the help

Best Regards
Muro

2010/5/20 Michał Letyński

   

Hi Muro.

W dniu 2010-05-19 15:12, Muro Copenhagen pisze:

  Hi Michal,
 

Thanks for the reply

Yes that was my idea.

It would be better with a static reference to a localdrive folder, so the
folder works as a image repository.

I am working on a wepapp where users has to login...the problem i am
experiencing is that the the
image reference is temporary, based on user login etc.

So if user logs in, uploads the image, the next time the user logs in the
reference to the image would be wrong.


   

What are you doing with those uploaded images and text which come from tiny
? Do you display them after submit as normal text in the page ?
I have also a login application. Text/images which came from tiny are shown
as "news" to any logged user. But this whole text must be parsed and src of
image must be rerendered.
I get this text and build panel with dynamic labels and images (dynamic
markup).
Some like this:
public abstract class AbstractImagePanel extends Panel implements
IMarkupResourceStreamProvider, IMarkupCacheKeyProvider {
public IResourceStream getMarkupResourceStream(MarkupContainer
pContainer,
Class  pContainerClass) {
String markup = String.format("%s",
createMarkup());
StringBufferResourceStream stringBuf = new
StringBufferResourceStream();
stringBuf.append(markup);
return stringBuf;
}

private String createMarkup() {
StringBuffer sb = new StringBuffer();
Matcher matcher = getMatcher();
int index = 0;
while(matcher.find()) {
matcher.appendReplacement(sb, String.format(IMG_TAG,
(index++)+matcher.group(1)+getMarkupId()));
}
matcher.appendTail(sb);
return sb.toString();
}

@Override
protected void onBeforeRender() {
super.onBeforeRender();
// Images must be added on each request, before phase render
removeAll();
addImages();
}
}

in addImmages() i het the same matcher parsing with adding Image components
return new Image(pIndex+pFileName+getMarkupId(), new
Resource() {
@Override
public IResourceStream getResourceStream() {
return   ResourceStream which points to our
image
}
});

Of course you can also put it to sharedResources. But it depends on how
many images you are going to upload :)
In sharedResources we should have images which are provided with our
application.


  Also a different user would not be able to see the same image...
 

Therefore i was thinking on a solution like this one integrated with youre
code...:

http://dotev.blogspot.com/2009/11/serving-images-and-other-resources-with.html

And images could be referenced as in the link...:
resources/global/images?id=image105

Would it be possible ?

Best Regards
Muro

2010/5/19 Michał Letyński



   

Hi.
Whay do you want to change exactly Muro ? Temporary path is set to
"javax.servlet.context.tempdir". Image must be temporary uploaded
somewhere
to show it in editor later.
This src in   tag points into ImageUploadPanel which implements
IResourceListener. So the ImageUploadPanel is called when a resource is
requested. (resource is created from image which is uploaded to temp
directory).
Do you want to have a static path like ../../resources/images/locked.gif
  ?

W dniu 2010-05-18 17:52, Muro Copenhagen pisze:

  Hi...


 

I am facing a new problem with the TinyMCE upload image, i hope someone
can
assist me on.

I can see that the ImageUpload tinymce example uses a temporary path to
store the images...

If i want to store them on a static folder, like the folder: c:\images

How would i achive that ?

If can to overwrite you g

Re: drag and drop

2010-05-20 Thread DerBernd

Hi,
first of all I have to thank you for your many answers .. and your following
discussion:-)
I will start with the jwicket-examples and see how it works.

Thanks a lot
Bernd

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/drag-and-drop-tp1881857p2224344.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: Image Upload Using TinyMCE Within Wicket Framework

2010-05-20 Thread Muro Copenhagen
Hi Michal

The idea is that users can upload a question, with images related to that
question.

So after upload, the image will be seen as "regular" text.

We are expecting many pictures to be uploaded...So i probably want to use
shared resources.

But still then i have to parse and rerender the src of the image?

I will try to work on a solution with shared resources :)

Thanks for the help

Best Regards
Muro

2010/5/20 Michał Letyński 

> Hi Muro.
>
> W dniu 2010-05-19 15:12, Muro Copenhagen pisze:
>
>  Hi Michal,
>>
>> Thanks for the reply
>>
>> Yes that was my idea.
>>
>> It would be better with a static reference to a localdrive folder, so the
>> folder works as a image repository.
>>
>> I am working on a wepapp where users has to login...the problem i am
>> experiencing is that the the
>> image reference is temporary, based on user login etc.
>>
>> So if user logs in, uploads the image, the next time the user logs in the
>> reference to the image would be wrong.
>>
>>
> What are you doing with those uploaded images and text which come from tiny
> ? Do you display them after submit as normal text in the page ?
> I have also a login application. Text/images which came from tiny are shown
> as "news" to any logged user. But this whole text must be parsed and src of
> image must be rerendered.
> I get this text and build panel with dynamic labels and images (dynamic
> markup).
> Some like this:
> public abstract class AbstractImagePanel extends Panel implements
> IMarkupResourceStreamProvider, IMarkupCacheKeyProvider {
>public IResourceStream getMarkupResourceStream(MarkupContainer
> pContainer,
>Class pContainerClass) {
>String markup = String.format("%s",
> createMarkup());
>StringBufferResourceStream stringBuf = new
> StringBufferResourceStream();
>stringBuf.append(markup);
>return stringBuf;
>}
>
>private String createMarkup() {
>StringBuffer sb = new StringBuffer();
>Matcher matcher = getMatcher();
>int index = 0;
>while(matcher.find()) {
>matcher.appendReplacement(sb, String.format(IMG_TAG,
> (index++)+matcher.group(1)+getMarkupId()));
>}
>matcher.appendTail(sb);
>return sb.toString();
>}
>
>@Override
>protected void onBeforeRender() {
>super.onBeforeRender();
>// Images must be added on each request, before phase render
>removeAll();
>addImages();
>}
> }
>
> in addImmages() i het the same matcher parsing with adding Image components
>return new Image(pIndex+pFileName+getMarkupId(), new
> Resource() {
>@Override
>public IResourceStream getResourceStream() {
>return   ResourceStream which points to our
> image
>}
>});
>
> Of course you can also put it to sharedResources. But it depends on how
> many images you are going to upload :)
> In sharedResources we should have images which are provided with our
> application.
>
>
>  Also a different user would not be able to see the same image...
>>
>> Therefore i was thinking on a solution like this one integrated with youre
>> code...:
>>
>> http://dotev.blogspot.com/2009/11/serving-images-and-other-resources-with.html
>>
>> And images could be referenced as in the link...:
>> resources/global/images?id=image105
>>
>> Would it be possible ?
>>
>> Best Regards
>> Muro
>>
>> 2010/5/19 Michał Letyński
>>
>>
>>
>>> Hi.
>>> Whay do you want to change exactly Muro ? Temporary path is set to
>>> "javax.servlet.context.tempdir". Image must be temporary uploaded
>>> somewhere
>>> to show it in editor later.
>>> This src in  tag points into ImageUploadPanel which implements
>>> IResourceListener. So the ImageUploadPanel is called when a resource is
>>> requested. (resource is created from image which is uploaded to temp
>>> directory).
>>> Do you want to have a static path like ../../resources/images/locked.gif
>>>  ?
>>>
>>> W dniu 2010-05-18 17:52, Muro Copenhagen pisze:
>>>
>>>  Hi...
>>>
>>>
 I am facing a new problem with the TinyMCE upload image, i hope someone
 can
 assist me on.

 I can see that the ImageUpload tinymce example uses a temporary path to
 store the images...

 If i want to store them on a static folder, like the folder: c:\images

 How would i achive that ?

 If can to overwrite you getTemporaryDirPath() folder and set it to
 c:\images, the upload works fine.

 But the reference to the image, is store with the wicket session
 reference.
 Here is the an example on how it is stored:

 >>>

 src="?wicket:interface=:25:editCaseForm:uploadPanel::IResourceListener::&filename=testerman.JPG&contenttype=image/jpeg"
 alt="" />

 How would i manage to store it a manner so it is not session
 dependent...?

 Any help will be apprecia

Re: Image Upload Using TinyMCE Within Wicket Framework

2010-05-20 Thread Michał Letyński

Hi Muro.

W dniu 2010-05-19 15:12, Muro Copenhagen pisze:

Hi Michal,

Thanks for the reply

Yes that was my idea.

It would be better with a static reference to a localdrive folder, so the
folder works as a image repository.

I am working on a wepapp where users has to login...the problem i am
experiencing is that the the
image reference is temporary, based on user login etc.

So if user logs in, uploads the image, the next time the user logs in the
reference to the image would be wrong.
   
What are you doing with those uploaded images and text which come from 
tiny ? Do you display them after submit as normal text in the page ?
I have also a login application. Text/images which came from tiny are 
shown as "news" to any logged user. But this whole text must be parsed 
and src of image must be rerendered.
I get this text and build panel with dynamic labels and images (dynamic 
markup).

Some like this:
public abstract class AbstractImagePanel extends Panel implements 
IMarkupResourceStreamProvider, IMarkupCacheKeyProvider {
public IResourceStream getMarkupResourceStream(MarkupContainer 
pContainer,

Class pContainerClass) {
String markup = 
String.format("%s", createMarkup());
StringBufferResourceStream stringBuf = new 
StringBufferResourceStream();

stringBuf.append(markup);
return stringBuf;
}

private String createMarkup() {
StringBuffer sb = new StringBuffer();
Matcher matcher = getMatcher();
int index = 0;
while(matcher.find()) {
matcher.appendReplacement(sb, String.format(IMG_TAG, 
(index++)+matcher.group(1)+getMarkupId()));

}
matcher.appendTail(sb);
return sb.toString();
}

@Override
protected void onBeforeRender() {
super.onBeforeRender();
// Images must be added on each request, before phase render
removeAll();
addImages();
}
}

in addImmages() i het the same matcher parsing with adding Image components
return new Image(pIndex+pFileName+getMarkupId(), 
new Resource() {

@Override
public IResourceStream getResourceStream() {
return   ResourceStream which points to our 
image

}
});

Of course you can also put it to sharedResources. But it depends on how 
many images you are going to upload :)
In sharedResources we should have images which are provided with our 
application.



Also a different user would not be able to see the same image...

Therefore i was thinking on a solution like this one integrated with youre
code...:
http://dotev.blogspot.com/2009/11/serving-images-and-other-resources-with.html

And images could be referenced as in the link...:
resources/global/images?id=image105

Would it be possible ?

Best Regards
Muro

2010/5/19 Michał Letyński

   

Hi.
Whay do you want to change exactly Muro ? Temporary path is set to
"javax.servlet.context.tempdir". Image must be temporary uploaded somewhere
to show it in editor later.
This src in  tag points into ImageUploadPanel which implements
IResourceListener. So the ImageUploadPanel is called when a resource is
requested. (resource is created from image which is uploaded to temp
directory).
Do you want to have a static path like ../../resources/images/locked.gif  ?

W dniu 2010-05-18 17:52, Muro Copenhagen pisze:

  Hi...
 

I am facing a new problem with the TinyMCE upload image, i hope someone
can
assist me on.

I can see that the ImageUpload tinymce example uses a temporary path to
store the images...

If i want to store them on a static folder, like the folder: c:\images

How would i achive that ?

If can to overwrite you getTemporaryDirPath() folder and set it to
c:\images, the upload works fine.

But the reference to the image, is store with the wicket session
reference.
Here is the an example on how it is stored:



How would i manage to store it a manner so it is not session dependent...?

Any help will be appreciated...

Best Regards
Muso

On Fri, May 14, 2010 at 3:03 PM, Muro Copenhagen   

wrote:
 



   

Hi Michal

Great thanks for the help..

Best Regards
Muro

2010/5/14 Michał Letyński

Hi.


 

Yes you are right the last released version is 1.4.1. So you must build
it
localy.

W dniu 2010-05-14 11:19, Muro Copenhagen pisze:

  Hi Michal


   

I appreciate you're effort spelling things out.

I am still not sure on how to get it to work.

When i add this dependency to my project it won't work:
 
 org.wicketstuff
 tinymce
 1.4.7-SNAPSHOT
 
And that makes sense since i can't find that version in the repo:
http://wicketstuff.org/maven/repository

So how would i get my project to use the tinymce version 1.4.7-SNAPSHOT
?

Maybe it's a silly question... but i am not sure how to make it work...

Best Regards
Muro

2010/5/13 Michał L

Re: ListView highlight selected row

2010-05-20 Thread JeroenWolff

Igor, you are right. It is still not rendered when i do the
super.onComponentTag after the tag.put.

This is the markup for the listview. "zoekresultaat" is the id for the
listview.

When the page is rendered the first time it works fine, but not in Ajax
updates. In the debugger is see that on the selected item the put is done,
but i don't see it rendered.

Thanks






Contactmoment
Omschrijving


[x]
 #  
[blabla]




-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ListView-highlight-selected-row-tp2197486p2224291.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: Help me speed up my Wicket

2010-05-20 Thread Michał Letyński

Hi.

W dniu 2010-05-20 10:28, Matthias Keller pisze:
And it would not speed up page loading at all since in the end, the 
same data would have to be transferred but splitted into multiple 
requests which adds the request overhead to the total loading time 
compared to the prepared complete page.



It depends.
If the most important thing is too show some particalur component to 
customer (for e.g news) and rest of page can be load lazy it will speed 
it up. Since the most important component will be shown fast rest of 
page will be rendered as empty panels.

On 2010-05-20 10:25, Martin Makundi wrote:

Would this not flicker a lot?


It flicker, but not a lot :) AjaxLazyLoadPanel 


**
Martin

2010/5/20 nino martinez wael:

ok the idea are this:

First render the page with out the grid.
Then add the empty grid
Then add row 1 to grid
Adding row 1 triggers a new request adding row 2 and so on until all
rows are loaded..

All done with ajax.

It's just an idea, but I think it should help. However it causes more
load on the server I think.

2010/5/20 Martin Makundi:


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



SV: adding behaviours

2010-05-20 Thread Wilhelmsen Tor Iver
> hey, what is the prefered approach?

Try using an IVisitor you pass to visitChildren() in the outermost component.

- Tor Iver

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



Re: Another Wicket Site

2010-05-20 Thread Joe Fawzy
lovely , needs some tweeks for google chrome
joe

On Wed, May 19, 2010 at 8:36 PM, chinedubond  wrote:

> nice love seeing Nigerians doing great things
> keep it up .
>
> On Tue, May 18, 2010 at 10:55 PM, Ajayi Yinka
>  wrote:
> > No doubt of a nicer alpha version. Keep it up.
> >
> > On Tue, May 18, 2010 at 4:54 PM, Ayodeji Aladejebi  >wrote:
> >
> >> Hi all,
> >> just to announce another wicket project I am working on. we
> >> just launched the beta version
> >>
> >> http://www.nelexnigeria.com
> >>
> >>
> >>
> >> --
> >> Aladejebi Ayodeji A.,
> >> DabarObjects Solutions
> >> Phone: +234 9 875 1763
> >> Mobile: +234 803 589 1780
> >> Email: d...@dabarobjects.com
> >> Web: www.dabarobjects.com
> >>
> >
> >
> >
> > --
> > Ajayi S . Yinka
> > +2348022684477
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: adding behaviours

2010-05-20 Thread Joe Fawzy
hey, what is the prefered approach?
thanks
joe

On Wed, May 19, 2010 at 7:12 AM, Joe Fawzy  wrote:

> Hi
> i have a large number of components in a page that i have to add the same
> behaviour
> should i use the same instance for all or instansiate one for every
> component(that's what i am currently doing);
> thanks
> Joe
>


Re: Wicket Cobertura problem

2010-05-20 Thread David Alves
Jetty dependencies are part of the core app, (not just for testing).
I am actually using sonar :)
The sonar:sonar goal was where the build first failed, while in the cobertura 
plugin. 
Since then I tried with cobertura standalone and it also fails, therefore my 
original question.


On May 20, 2010, at 8:04 AM, nino martinez wael wrote:

> you are running with the dependencies for jetty as test scoped or?
> What if you use something like sonar does that make a diff..
> 
> 2010/5/19 David Alves :
>> Exactly.
>> weird right?
>> 
>> I'm not 100% sure that it is a wicket problem (it could be a jetty problem), 
>> still I find suspicious that the only stuff missing from the logs when it 
>> fails is the wicket stuff.
>> 
>> On May 19, 2010, at 8:29 PM, nino martinez wael wrote:
>> 
>>> Strange, I haven't encounter problems like that.. So it works when
>>> running mvn test or mvn clean install?
>>> 
>>> 2010/5/19 David Alves :
 Hi Nino
 
I'm using maven, it only fails when I run the cobertura:cobertura 
 target.
 
 David
 On May 19, 2010, at 6:57 PM, nino martinez wael wrote:
 
> what are you using to build with maven, ant or?
> 
> 2010/5/19 David Alves :
>> Hi
>> 
>>I'm quite new to wicket, and I'm having a strange problem. I'm 
>> using wicket (1.4.8) with embedded jetty in a large cluster application.
>>Everything works out most of the time, except when I run 
>> cobertura test coverage (under maven).
>>Starting my application in every other context yelds the 
>> following in the logs:
>> 
>> ...
>> 2010-05-19 17:46:03,195 INFO [main] log.Slf4jLog (55): Logging to 
>> org.slf4j.impl.Log4jLoggerAdapter(org.eclipse.jetty.util.log) via 
>> org.eclipse.jetty.util.log.Slf4jLog 2010-05-19 17:46:03,267 INFO [main] 
>> log.Slf4jLog (55): jetty-7.1.0.RC1 2010-05-19 17:46:03,475 INFO [main] 
>> log.Slf4jLog (55): NO JSP Support for /, did not find 
>> org.apache.jasper.servlet.JspServlet 2010-05-19 17:46:03,476 WARN [main] 
>> log.Slf4jLog (40): java.lang.ClassNotFoundException: 
>> org.eclipse.jetty.jsp.JettyLog 2010-05-19 17:46:03,797 INFO [main] 
>> wicket.Application (842): [FloodWebApplication] init: Wicket extensions 
>> initializer 2010-05-19 17:46:03,824 INFO [main] wicket.Application 
>> (842): [FloodWebApplication] init: Wicket core library initializer 
>> 2010-05-19 17:46:03,826 INFO [main] wicket.RequestListenerInterface 
>> (276): registered listener interface [RequestListenerInterface 
>> name=IBehaviorListener, method=public abstract void 
>> org.apache.wicket.behavior.IBehaviorListener.onRequest()] 2010-05-19 
>> 17:46:03,827 INFO [main] wicket.RequestListenerInterface (276): 
>> registered listener interface [RequestListenerInterface 
>> name=IBehaviorListener, method=public abstract void 
>> org.apache.wicket.behavior.IBehaviorListener.onRequest()] 2010-05-19 
>> 17:46:03,829 INFO [main] wicket.RequestListenerInterface (276): 
>> registered listener interface [RequestListenerInterface 
>> name=IFormSubmitListener, method=public abstract void 
>> org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]
>>  2010-05-19 17:46:03,852 INFO [main] wicket.RequestListenerInterface 
>> (276): registered listener interface [RequestListenerInterface 
>> name=IFormSubmitListener, method=public abstract void 
>> org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]
>>  2010-05-19 17:46:03,853 INFO [main] wicket.RequestListenerInterface 
>> (276): registered listener interface [RequestListenerInterface 
>> name=ILinkListener, method=public abstract void 
>> org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()] 
>> 2010-05-19 17:46:03,854 INFO [main] wicket.RequestListenerInterface 
>> (276): registered listener interface [RequestListenerInterface 
>> name=ILinkListener, method=public abstract void 
>> org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()] 
>> 2010-05-19 17:46:03,856 INFO [main] wicket.RequestListenerInterface 
>> (276): registered listener interface [RequestListenerInterface 
>> name=IOnChangeListener, method=public abstract void 
>> org.apache.wicket.markup.html.form.IOnChangeListener.onSelectionChanged()]
>>  2010-05-19 17:46:03,856 INFO [main] wicket.RequestListenerInterface 
>> (276): registered listener interface [RequestListenerInterface 
>> name=IOnChangeListener, method=public abstract void 
>> org.apache.wicket.markup.html.form.IOnChangeListener.onSelectionChanged()]
>>  2010-05-19 17:46:03,857 INFO [main] wicket.RequestListenerInterface 
>> (276): registered listener interface [RequestListenerInterface 
>> name=IRedirectListener, method=public abstract void 
>> org.apache.wicket.IRedirectListener.onRedirect()] 2010-05-19 
>> 17

Re: Help me speed up my Wicket

2010-05-20 Thread Matthias Keller
And it would not speed up page loading at all since in the end, the same 
data would have to be transferred but splitted into multiple requests 
which adds the request overhead to the total loading time compared to 
the prepared complete page.


On 2010-05-20 10:25, Martin Makundi wrote:

Would this not flicker a lot?

**
Martin

2010/5/20 nino martinez wael:
   

ok the idea are this:

First render the page with out the grid.
Then add the empty grid
Then add row 1 to grid
Adding row 1 triggers a new request adding row 2 and so on until all
rows are loaded..

All done with ajax.

It's just an idea, but I think it should help. However it causes more
load on the server I think.

2010/5/20 Martin Makundi:
 





smime.p7s
Description: S/MIME Cryptographic Signature


Re: Help me speed up my Wicket

2010-05-20 Thread Martin Makundi
Would this not flicker a lot?

**
Martin

2010/5/20 nino martinez wael :
> ok the idea are this:
>
> First render the page with out the grid.
> Then add the empty grid
> Then add row 1 to grid
> Adding row 1 triggers a new request adding row 2 and so on until all
> rows are loaded..
>
> All done with ajax.
>
> It's just an idea, but I think it should help. However it causes more
> load on the server I think.
>
> 2010/5/20 Martin Makundi :
>> Yes.. what you mean cascade load?
>>
>> **
>> Martin
>>
>> 2010/5/20 nino martinez wael :
>>> No havent had the problem myself. But I guess you should start by
>>> loading the page without the listview enabled, and then add the
>>> listview afterwards and see if that helps. Next step would be to
>>> cascade load the rows...
>>>
>>> 2010/5/19 Martin Makundi :
 Hmm.. can you show me an example of something like that, how is it done?

 **
 Martin

 2010/5/19 nino martinez wael :
> about the lazyloading, I was thinking to cascade load the rows after
> page render, it should perform better in theory:)...
>
> 2010/5/19 Martin Makundi :
>> Hi!
>>
>>> hmm could'nt just use a custom ajax decorator? Or override the js part
>>> of the onchangeajaxbehaviour?
>>
>> Hmm.. sounds like a good starting point...  thanks.
>>
>> BTW: I totally lost you on that lazy loading thing... the user would
>> like the page to load in a snap and using it to be like a snap. How
>> would your proposed lazy loading be implemented?
>>
>> **
>> Martin
>>>
>>> 2010/5/19 Jeremy Thomerson :
 Well, if the rendering of all that extra JS is what's causing the 
 problem,
 I'd try to limit it to one rendering of the (slightly-modified) 
 behavior.

 You can basically render something like this:

 function somethingInMyTableChanged(rowInd) {
  return wicketAjaxGet('{standardBehaviorUrl}&rowIndex=' + rowInd);
 }

 Then, you add a simple behavior to your row items like:

 new SimpleAttributeModifier("onchange", true, new Model("return
 somethingInMyTableChanged(" + item.getRowIndex() + ");");

 In your behavior, now you have to do a little extra work (don't use an
 onchangeajaxbehavior, just use a custom defaultajaxbehavior or 
 something
 like that).  You'll need to call
 RequestCycle.get().getRequest().getServletRequest().getQueryParameters().get("rowIndex")
 and use that to see which row changed.

 Anyway, it should work, but it's a little less "clean" than you 
 normally
 would do in Wicket.  BUT - if you have proven that it's the rendering 
 of all
 that extra AJAX string stuff that's slowing you down, then it's worth 
 doing.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Wed, May 19, 2010 at 11:09 AM, Martin Makundi <
 martin.maku...@koodaripalvelut.com> wrote:

> Hi!
>
> Yes.. my question now is: how to easily extract the JS? It is from
> onchangeajaxbehavior etc.
>
> I would like to continue using wicket standard onchangeajaxbehavior
> but somehow override the way it injects the js into the component tag.
> Suggestions to accomplish this?
>
> **
> Martin
>
> 2010/5/19 Jeremy Thomerson :
> > If you've already proven that removing the AJAX removes the 
> > contention,
> I'd
> > go with Nino's "otherwise" route.  That was my first guess.  
> > Depending on
> > what you're doing with those AJAX calls, you could probably make it 
> > so
> that
> > you have one to three of them for the entire table, wrapped in a 
> > custom
> > function.  (You don't have to extract them to a separate JS).  Then 
> > each
> row
> > would shorten it's JavaScript output to myCustomFunction(rowIndex). 
> >  If
> you
> > need some help, let us know.  I posted a message on this list a 
> > week or
> so
> > ago showing how to wrap existing AJAX in a custom function.  That 
> > might
> > help, too.
> >
> > --
> > Jeremy Thomerson
> > http://www.wickettraining.com
> >
> >
> >
> > On Wed, May 19, 2010 at 10:51 AM, nino martinez wael <
> > nino.martinez.w...@gmail.com> wrote:
> >
> >> The easiest thing would probably to lazy load the rows somehow, how
> >> are load time pr row?.. Otherwise you could extract the long inline
> >> code into a seperate js and wrap them into induvidual methods,
> >> although I do not know if it makes page loa

Re: Help me speed up my Wicket

2010-05-20 Thread nino martinez wael
ok the idea are this:

First render the page with out the grid.
Then add the empty grid
Then add row 1 to grid
Adding row 1 triggers a new request adding row 2 and so on until all
rows are loaded..

All done with ajax.

It's just an idea, but I think it should help. However it causes more
load on the server I think.

2010/5/20 Martin Makundi :
> Yes.. what you mean cascade load?
>
> **
> Martin
>
> 2010/5/20 nino martinez wael :
>> No havent had the problem myself. But I guess you should start by
>> loading the page without the listview enabled, and then add the
>> listview afterwards and see if that helps. Next step would be to
>> cascade load the rows...
>>
>> 2010/5/19 Martin Makundi :
>>> Hmm.. can you show me an example of something like that, how is it done?
>>>
>>> **
>>> Martin
>>>
>>> 2010/5/19 nino martinez wael :
 about the lazyloading, I was thinking to cascade load the rows after
 page render, it should perform better in theory:)...

 2010/5/19 Martin Makundi :
> Hi!
>
>> hmm could'nt just use a custom ajax decorator? Or override the js part
>> of the onchangeajaxbehaviour?
>
> Hmm.. sounds like a good starting point...  thanks.
>
> BTW: I totally lost you on that lazy loading thing... the user would
> like the page to load in a snap and using it to be like a snap. How
> would your proposed lazy loading be implemented?
>
> **
> Martin
>>
>> 2010/5/19 Jeremy Thomerson :
>>> Well, if the rendering of all that extra JS is what's causing the 
>>> problem,
>>> I'd try to limit it to one rendering of the (slightly-modified) 
>>> behavior.
>>>
>>> You can basically render something like this:
>>>
>>> function somethingInMyTableChanged(rowInd) {
>>>  return wicketAjaxGet('{standardBehaviorUrl}&rowIndex=' + rowInd);
>>> }
>>>
>>> Then, you add a simple behavior to your row items like:
>>>
>>> new SimpleAttributeModifier("onchange", true, new Model("return
>>> somethingInMyTableChanged(" + item.getRowIndex() + ");");
>>>
>>> In your behavior, now you have to do a little extra work (don't use an
>>> onchangeajaxbehavior, just use a custom defaultajaxbehavior or something
>>> like that).  You'll need to call
>>> RequestCycle.get().getRequest().getServletRequest().getQueryParameters().get("rowIndex")
>>> and use that to see which row changed.
>>>
>>> Anyway, it should work, but it's a little less "clean" than you normally
>>> would do in Wicket.  BUT - if you have proven that it's the rendering 
>>> of all
>>> that extra AJAX string stuff that's slowing you down, then it's worth 
>>> doing.
>>>
>>> --
>>> Jeremy Thomerson
>>> http://www.wickettraining.com
>>>
>>>
>>>
>>> On Wed, May 19, 2010 at 11:09 AM, Martin Makundi <
>>> martin.maku...@koodaripalvelut.com> wrote:
>>>
 Hi!

 Yes.. my question now is: how to easily extract the JS? It is from
 onchangeajaxbehavior etc.

 I would like to continue using wicket standard onchangeajaxbehavior
 but somehow override the way it injects the js into the component tag.
 Suggestions to accomplish this?

 **
 Martin

 2010/5/19 Jeremy Thomerson :
 > If you've already proven that removing the AJAX removes the 
 > contention,
 I'd
 > go with Nino's "otherwise" route.  That was my first guess.  
 > Depending on
 > what you're doing with those AJAX calls, you could probably make it 
 > so
 that
 > you have one to three of them for the entire table, wrapped in a 
 > custom
 > function.  (You don't have to extract them to a separate JS).  Then 
 > each
 row
 > would shorten it's JavaScript output to myCustomFunction(rowIndex).  
 > If
 you
 > need some help, let us know.  I posted a message on this list a week 
 > or
 so
 > ago showing how to wrap existing AJAX in a custom function.  That 
 > might
 > help, too.
 >
 > --
 > Jeremy Thomerson
 > http://www.wickettraining.com
 >
 >
 >
 > On Wed, May 19, 2010 at 10:51 AM, nino martinez wael <
 > nino.martinez.w...@gmail.com> wrote:
 >
 >> The easiest thing would probably to lazy load the rows somehow, how
 >> are load time pr row?.. Otherwise you could extract the long inline
 >> code into a seperate js and wrap them into induvidual methods,
 >> although I do not know if it makes page load faster or there could 
 >> be
 >> other issues.
 >>
 >> 2010/5/19 Martin Makundi :
 >> > Hi!
 >> >
 >> > HELP!
 >> >
 >> > I have a problem. I have a table with 20 co

Re: Help me speed up my Wicket

2010-05-20 Thread Martin Makundi
Yes.. what you mean cascade load?

**
Martin

2010/5/20 nino martinez wael :
> No havent had the problem myself. But I guess you should start by
> loading the page without the listview enabled, and then add the
> listview afterwards and see if that helps. Next step would be to
> cascade load the rows...
>
> 2010/5/19 Martin Makundi :
>> Hmm.. can you show me an example of something like that, how is it done?
>>
>> **
>> Martin
>>
>> 2010/5/19 nino martinez wael :
>>> about the lazyloading, I was thinking to cascade load the rows after
>>> page render, it should perform better in theory:)...
>>>
>>> 2010/5/19 Martin Makundi :
 Hi!

> hmm could'nt just use a custom ajax decorator? Or override the js part
> of the onchangeajaxbehaviour?

 Hmm.. sounds like a good starting point...  thanks.

 BTW: I totally lost you on that lazy loading thing... the user would
 like the page to load in a snap and using it to be like a snap. How
 would your proposed lazy loading be implemented?

 **
 Martin
>
> 2010/5/19 Jeremy Thomerson :
>> Well, if the rendering of all that extra JS is what's causing the 
>> problem,
>> I'd try to limit it to one rendering of the (slightly-modified) behavior.
>>
>> You can basically render something like this:
>>
>> function somethingInMyTableChanged(rowInd) {
>>  return wicketAjaxGet('{standardBehaviorUrl}&rowIndex=' + rowInd);
>> }
>>
>> Then, you add a simple behavior to your row items like:
>>
>> new SimpleAttributeModifier("onchange", true, new Model("return
>> somethingInMyTableChanged(" + item.getRowIndex() + ");");
>>
>> In your behavior, now you have to do a little extra work (don't use an
>> onchangeajaxbehavior, just use a custom defaultajaxbehavior or something
>> like that).  You'll need to call
>> RequestCycle.get().getRequest().getServletRequest().getQueryParameters().get("rowIndex")
>> and use that to see which row changed.
>>
>> Anyway, it should work, but it's a little less "clean" than you normally
>> would do in Wicket.  BUT - if you have proven that it's the rendering of 
>> all
>> that extra AJAX string stuff that's slowing you down, then it's worth 
>> doing.
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>> On Wed, May 19, 2010 at 11:09 AM, Martin Makundi <
>> martin.maku...@koodaripalvelut.com> wrote:
>>
>>> Hi!
>>>
>>> Yes.. my question now is: how to easily extract the JS? It is from
>>> onchangeajaxbehavior etc.
>>>
>>> I would like to continue using wicket standard onchangeajaxbehavior
>>> but somehow override the way it injects the js into the component tag.
>>> Suggestions to accomplish this?
>>>
>>> **
>>> Martin
>>>
>>> 2010/5/19 Jeremy Thomerson :
>>> > If you've already proven that removing the AJAX removes the 
>>> > contention,
>>> I'd
>>> > go with Nino's "otherwise" route.  That was my first guess.  
>>> > Depending on
>>> > what you're doing with those AJAX calls, you could probably make it so
>>> that
>>> > you have one to three of them for the entire table, wrapped in a 
>>> > custom
>>> > function.  (You don't have to extract them to a separate JS).  Then 
>>> > each
>>> row
>>> > would shorten it's JavaScript output to myCustomFunction(rowIndex).  
>>> > If
>>> you
>>> > need some help, let us know.  I posted a message on this list a week 
>>> > or
>>> so
>>> > ago showing how to wrap existing AJAX in a custom function.  That 
>>> > might
>>> > help, too.
>>> >
>>> > --
>>> > Jeremy Thomerson
>>> > http://www.wickettraining.com
>>> >
>>> >
>>> >
>>> > On Wed, May 19, 2010 at 10:51 AM, nino martinez wael <
>>> > nino.martinez.w...@gmail.com> wrote:
>>> >
>>> >> The easiest thing would probably to lazy load the rows somehow, how
>>> >> are load time pr row?.. Otherwise you could extract the long inline
>>> >> code into a seperate js and wrap them into induvidual methods,
>>> >> although I do not know if it makes page load faster or there could be
>>> >> other issues.
>>> >>
>>> >> 2010/5/19 Martin Makundi :
>>> >> > Hi!
>>> >> >
>>> >> > HELP!
>>> >> >
>>> >> > I have a problem. I have a table with 20 columns and 30 rows
>>> >> ("calendar").
>>> >> >
>>> >> > The problem is that it renders very slowly in browsers.
>>> >> >
>>> >> > The reason is not directly network speed but it is the VERY heavy
>>> >> > markup. Each table cell has 3 ajax components and the ajax call
>>> >> > functions are loong.
>>> >> >
>>> >> > I have tested to strip away all ajax calls and it renders pretty 
>>> >> > OK.
>>> >> > Now what I am thinking is that is there a way to shorte

Re: Wicket Cobertura problem

2010-05-20 Thread nino martinez wael
you are running with the dependencies for jetty as test scoped or?
What if you use something like sonar does that make a diff..

2010/5/19 David Alves :
> Exactly.
> weird right?
>
> I'm not 100% sure that it is a wicket problem (it could be a jetty problem), 
> still I find suspicious that the only stuff missing from the logs when it 
> fails is the wicket stuff.
>
> On May 19, 2010, at 8:29 PM, nino martinez wael wrote:
>
>> Strange, I haven't encounter problems like that.. So it works when
>> running mvn test or mvn clean install?
>>
>> 2010/5/19 David Alves :
>>> Hi Nino
>>>
>>>        I'm using maven, it only fails when I run the cobertura:cobertura 
>>> target.
>>>
>>> David
>>> On May 19, 2010, at 6:57 PM, nino martinez wael wrote:
>>>
 what are you using to build with maven, ant or?

 2010/5/19 David Alves :
> Hi
>
>        I'm quite new to wicket, and I'm having a strange problem. I'm 
> using wicket (1.4.8) with embedded jetty in a large cluster application.
>        Everything works out most of the time, except when I run cobertura 
> test coverage (under maven).
>        Starting my application in every other context yelds the following 
> in the logs:
>
> ...
> 2010-05-19 17:46:03,195 INFO [main] log.Slf4jLog (55): Logging to 
> org.slf4j.impl.Log4jLoggerAdapter(org.eclipse.jetty.util.log) via 
> org.eclipse.jetty.util.log.Slf4jLog 2010-05-19 17:46:03,267 INFO [main] 
> log.Slf4jLog (55): jetty-7.1.0.RC1 2010-05-19 17:46:03,475 INFO [main] 
> log.Slf4jLog (55): NO JSP Support for /, did not find 
> org.apache.jasper.servlet.JspServlet 2010-05-19 17:46:03,476 WARN [main] 
> log.Slf4jLog (40): java.lang.ClassNotFoundException: 
> org.eclipse.jetty.jsp.JettyLog 2010-05-19 17:46:03,797 INFO [main] 
> wicket.Application (842): [FloodWebApplication] init: Wicket extensions 
> initializer 2010-05-19 17:46:03,824 INFO [main] wicket.Application (842): 
> [FloodWebApplication] init: Wicket core library initializer 2010-05-19 
> 17:46:03,826 INFO [main] wicket.RequestListenerInterface (276): 
> registered listener interface [RequestListenerInterface 
> name=IBehaviorListener, method=public abstract void 
> org.apache.wicket.behavior.IBehaviorListener.onRequest()] 2010-05-19 
> 17:46:03,827 INFO [main] wicket.RequestListenerInterface (276): 
> registered listener interface [RequestListenerInterface 
> name=IBehaviorListener, method=public abstract void 
> org.apache.wicket.behavior.IBehaviorListener.onRequest()] 2010-05-19 
> 17:46:03,829 INFO [main] wicket.RequestListenerInterface (276): 
> registered listener interface [RequestListenerInterface 
> name=IFormSubmitListener, method=public abstract void 
> org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()] 
> 2010-05-19 17:46:03,852 INFO [main] wicket.RequestListenerInterface 
> (276): registered listener interface [RequestListenerInterface 
> name=IFormSubmitListener, method=public abstract void 
> org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()] 
> 2010-05-19 17:46:03,853 INFO [main] wicket.RequestListenerInterface 
> (276): registered listener interface [RequestListenerInterface 
> name=ILinkListener, method=public abstract void 
> org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()] 
> 2010-05-19 17:46:03,854 INFO [main] wicket.RequestListenerInterface 
> (276): registered listener interface [RequestListenerInterface 
> name=ILinkListener, method=public abstract void 
> org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()] 
> 2010-05-19 17:46:03,856 INFO [main] wicket.RequestListenerInterface 
> (276): registered listener interface [RequestListenerInterface 
> name=IOnChangeListener, method=public abstract void 
> org.apache.wicket.markup.html.form.IOnChangeListener.onSelectionChanged()]
>  2010-05-19 17:46:03,856 INFO [main] wicket.RequestListenerInterface 
> (276): registered listener interface [RequestListenerInterface 
> name=IOnChangeListener, method=public abstract void 
> org.apache.wicket.markup.html.form.IOnChangeListener.onSelectionChanged()]
>  2010-05-19 17:46:03,857 INFO [main] wicket.RequestListenerInterface 
> (276): registered listener interface [RequestListenerInterface 
> name=IRedirectListener, method=public abstract void 
> org.apache.wicket.IRedirectListener.onRedirect()] 2010-05-19 17:46:03,857 
> INFO [main] wicket.RequestListenerInterface (276): registered listener 
> interface [RequestListenerInterface name=IRedirectListener, method=public 
> abstract void org.apache.wicket.IRedirectListener.onRedirect()] 
> 2010-05-19 17:46:03,858 INFO [main] wicket.RequestListenerInterface 
> (276): registered listener interface [RequestListenerInterface 
> name=IResourceListener, method=public abstract void 
>>

Re: Help me speed up my Wicket

2010-05-20 Thread nino martinez wael
No havent had the problem myself. But I guess you should start by
loading the page without the listview enabled, and then add the
listview afterwards and see if that helps. Next step would be to
cascade load the rows...

2010/5/19 Martin Makundi :
> Hmm.. can you show me an example of something like that, how is it done?
>
> **
> Martin
>
> 2010/5/19 nino martinez wael :
>> about the lazyloading, I was thinking to cascade load the rows after
>> page render, it should perform better in theory:)...
>>
>> 2010/5/19 Martin Makundi :
>>> Hi!
>>>
 hmm could'nt just use a custom ajax decorator? Or override the js part
 of the onchangeajaxbehaviour?
>>>
>>> Hmm.. sounds like a good starting point...  thanks.
>>>
>>> BTW: I totally lost you on that lazy loading thing... the user would
>>> like the page to load in a snap and using it to be like a snap. How
>>> would your proposed lazy loading be implemented?
>>>
>>> **
>>> Martin

 2010/5/19 Jeremy Thomerson :
> Well, if the rendering of all that extra JS is what's causing the problem,
> I'd try to limit it to one rendering of the (slightly-modified) behavior.
>
> You can basically render something like this:
>
> function somethingInMyTableChanged(rowInd) {
>  return wicketAjaxGet('{standardBehaviorUrl}&rowIndex=' + rowInd);
> }
>
> Then, you add a simple behavior to your row items like:
>
> new SimpleAttributeModifier("onchange", true, new Model("return
> somethingInMyTableChanged(" + item.getRowIndex() + ");");
>
> In your behavior, now you have to do a little extra work (don't use an
> onchangeajaxbehavior, just use a custom defaultajaxbehavior or something
> like that).  You'll need to call
> RequestCycle.get().getRequest().getServletRequest().getQueryParameters().get("rowIndex")
> and use that to see which row changed.
>
> Anyway, it should work, but it's a little less "clean" than you normally
> would do in Wicket.  BUT - if you have proven that it's the rendering of 
> all
> that extra AJAX string stuff that's slowing you down, then it's worth 
> doing.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Wed, May 19, 2010 at 11:09 AM, Martin Makundi <
> martin.maku...@koodaripalvelut.com> wrote:
>
>> Hi!
>>
>> Yes.. my question now is: how to easily extract the JS? It is from
>> onchangeajaxbehavior etc.
>>
>> I would like to continue using wicket standard onchangeajaxbehavior
>> but somehow override the way it injects the js into the component tag.
>> Suggestions to accomplish this?
>>
>> **
>> Martin
>>
>> 2010/5/19 Jeremy Thomerson :
>> > If you've already proven that removing the AJAX removes the contention,
>> I'd
>> > go with Nino's "otherwise" route.  That was my first guess.  Depending 
>> > on
>> > what you're doing with those AJAX calls, you could probably make it so
>> that
>> > you have one to three of them for the entire table, wrapped in a custom
>> > function.  (You don't have to extract them to a separate JS).  Then 
>> > each
>> row
>> > would shorten it's JavaScript output to myCustomFunction(rowIndex).  If
>> you
>> > need some help, let us know.  I posted a message on this list a week or
>> so
>> > ago showing how to wrap existing AJAX in a custom function.  That might
>> > help, too.
>> >
>> > --
>> > Jeremy Thomerson
>> > http://www.wickettraining.com
>> >
>> >
>> >
>> > On Wed, May 19, 2010 at 10:51 AM, nino martinez wael <
>> > nino.martinez.w...@gmail.com> wrote:
>> >
>> >> The easiest thing would probably to lazy load the rows somehow, how
>> >> are load time pr row?.. Otherwise you could extract the long inline
>> >> code into a seperate js and wrap them into induvidual methods,
>> >> although I do not know if it makes page load faster or there could be
>> >> other issues.
>> >>
>> >> 2010/5/19 Martin Makundi :
>> >> > Hi!
>> >> >
>> >> > HELP!
>> >> >
>> >> > I have a problem. I have a table with 20 columns and 30 rows
>> >> ("calendar").
>> >> >
>> >> > The problem is that it renders very slowly in browsers.
>> >> >
>> >> > The reason is not directly network speed but it is the VERY heavy
>> >> > markup. Each table cell has 3 ajax components and the ajax call
>> >> > functions are loong.
>> >> >
>> >> > I have tested to strip away all ajax calls and it renders pretty OK.
>> >> > Now what I am thinking is that is there a way to shorten the wicket
>> >> > ajax call urls?
>> >> >
>> >> > Any practical suggestions? I tried also shortening the wicket-id 
>> >> > names
>> >> > but there still remains quite some blob of excess markup that could
>> >> > brobably be in some reusable function??
>