Re: 1.4 - 6.0 question

2013-04-12 Thread Marco Springer
Hello Pierre,

You can also just override/extend the onComponentTag function from the 
Component.:

Component {
  @Override
  protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
tag.put(attribute, value)
  }
}

As far as I can see, SimpleAttributeModifier doesn't exist anymore, just use 
the AttributeModifier class or sub-class that if you really need to.

Or attach a custom Behavior to the component which can also override the 
onComponentTag function like so: 
public class FeedbackFieldDecorator extends Behavior {
  @Override
  public void onComponentTag(Component component, ComponentTag tag) {
if (!((FormComponent?)component).isValid()) {
  String cl = tag.getAttribute(class);
  if (cl == null) {
tag.put(class, error);
  } else {
tag.put(class, error  + cl);
  }
}
  }
}

Cheers,
Marco

On Thursday 11 April 2013 21:50:28 Pierre Goupil wrote:
 Good evening,
 
 I have a Wicket 1.4 code that I want to migrate to 6.0. It all works fine
 except for this code in a sub-class of SimpleAttributeModifier:
 
   @Override
   public void onComponentTag(final Component component, final ComponentTag
 tag) {
 System.out.println(ononComponentTag called. component=+component+,
 tag=+tag);
 if (isEnabled(component)) {
   System.out.println(changing attribute, value=+value);
   tag.getAttributes().put(attribute, value);
 }
   }
 
 I don't know what this code is supposed to do, so does anyone know with
 what to replace it? AttributeModifier#onComponentTag() is final in 6.0!
 
 Any help is much appreciated.
 
 Regards,
 
 Pierre

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



Re: How to Add JS Modifer to a Non-Form-Processing AjaxButton

2013-04-12 Thread Martin Grigorov
Hi,


On Thu, Apr 11, 2013 at 10:59 PM, eugenebalt eugeneb...@yahoo.com wrote:

 We have an AjaxButton with the following flag, to disable default form
 processing (we don't want it to submit the form):

 ajaxButton.setDefaultFormProcessing(false);

 The problem is that we need to attach a JS alert box (Are you sure?
 OK/Cancel) when this button is clicked. If OK is clicked, we go through
 with the onSubmit(), otherwise nothing happens.

 I'm seeing that when I do this

 ajaxButton.add( new SimpleAttributeModifier(onclick, return confirm('Are
 you sure you want to delete the selected record(s)?');));


Doing it this way it will override button's onclick attribute with your own
one.
You need to use IAjaxCallDecorator instead.
The produced JS should look like:

onclick=if(confirm('Blah blah') {wicketAjaxPost(...)})



 nothing happens regardless of OK/Cancel, the onSubmit is never invoked. Is
 that because defaultFormProcessing=False? Is there a workaround? Thanks



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/How-to-Add-JS-Modifer-to-a-Non-Form-Processing-AjaxButton-tp4657904.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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


Incorrect javadoc for IPageRequestHandler.isPageInstanceCreated()?

2013-04-12 Thread Jonas
Hello,

quick question about the javadoc of
org.apache.wicket.core.request.handler.IPageRequestHandler.isPageInstanceCreated()

it states '@return true iff page instance is not yet created', but looking
at
the implementations (e.g. in RenderPageRequestHandler), the opposite seems
to be correct, i.e. '@return false iff page instance is not yet created'.

Am I missing something, or is the javadoc actually incorrect?

cheers,
Jonas

ps: wicket version is 6.6.0


Re: Incorrect javadoc for IPageRequestHandler.isPageInstanceCreated()?

2013-04-12 Thread Martin Grigorov
Hi,

This has been fixed recently with 12d3bd33e5f6da403d66d43abf6cf9d6c09152ce
Now it says:

/**
 * Checks if the page instance is already created or if it will be created
when
 * {@link #getPage()} is called
 *
 * @return {@code true} iff page instance is already created
 */
boolean isPageInstanceCreated();



On Fri, Apr 12, 2013 at 10:59 AM, Jonas barney...@gmail.com wrote:

 Hello,

 quick question about the javadoc of

 org.apache.wicket.core.request.handler.IPageRequestHandler.isPageInstanceCreated()

 it states '@return true iff page instance is not yet created', but looking
 at
 the implementations (e.g. in RenderPageRequestHandler), the opposite seems
 to be correct, i.e. '@return false iff page instance is not yet created'.

 Am I missing something, or is the javadoc actually incorrect?

 cheers,
 Jonas

 ps: wicket version is 6.6.0




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


Re: Atmosphere problem with JBoss 7.1

2013-04-12 Thread Raul
I have asked in this forum because the problem I have when running Wicket
application, any of these examples made ​​with other frameworks, work
perfectly in Jboss,
https://github.com/Atmosphere/atmosphere/wiki/Getting-Started-with-the-samples
And on the second question, I mean, if you can give me a guide on how to use
the sample. Since we do not know how to use it.

PD.Sería useful to have a similar examples in Wicket because the wicketstuff
QuickStart is quite poor.

Thank you.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Atmosphere-problem-with-JBoss-7-1-tp4657907p4657919.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Atmosphere problem with JBoss 7.1

2013-04-12 Thread Martin Grigorov
Hi,

The example runs fine with Jetty 7.6.+. To run it on another container you
will have to provide the required libraries.
It is like with databases - if you use MySQL then you need
mysql-connector.jar, if you use H2Database then you need h2.jar instead.

You will need to consult with Atmosphere docu for JBoss implementation.
As I said the warnings are logged by Atmosphere so you will have to see
what is the difference in the available libraries (jars in WEB-INF/lib/**)
between the non-Wicket and Wicket demo apps.



On Fri, Apr 12, 2013 at 11:23 AM, Raul ralva...@netwie.com wrote:

 I have asked in this forum because the problem I have when running Wicket
 application, any of these examples made ​​with other frameworks, work
 perfectly in Jboss,

 https://github.com/Atmosphere/atmosphere/wiki/Getting-Started-with-the-samples
 And on the second question, I mean, if you can give me a guide on how to
 use
 the sample. Since we do not know how to use it.

 PD.Sería useful to have a similar examples in Wicket because the
 wicketstuff
 QuickStart is quite poor.

 Thank you.



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Atmosphere-problem-with-JBoss-7-1-tp4657907p4657919.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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


Generating wrong JavaScript on ajax updated

2013-04-12 Thread Alexey Mukas
Hi,

Suppose I have BlinkBehaviour 

public static class BlinkBehaviour extends Behavior {
@Override
public void renderHead(Component component, IHeaderResponse
response) {
AjaxRequestTarget target =
component.getRequestCycle().find(AjaxRequestTarget.class);
if (target != null) {
target.prependJavaScript(notify|jQuery('# +
component.getMarkupId() + ').fadeOut(400, notify););
   
target.appendJavaScript(jQuery('#+component.getMarkupId()+').fadeIn(400););
}
}
}

If I add it twice to a control and update the control via ajax
6.7.0-SNAPSHOT will yield error:

ERROR: Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript:
SyntaxError: Unexpected token ), text: f = function(notify)
{jQuery('#version2').fadeOut(400,
notify);})();(function(){notify|jQuery('#version2').fadeOut(400, notify);};



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Generating-wrong-JavaScript-on-ajax-updated-tp4657921.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Generating wrong JavaScript on ajax updated

2013-04-12 Thread Martin Grigorov
Ticket please! :-)
I'm not sure I'll be able to improve that for 6.7.0 though. It has to be
cut anytime now.


On Fri, Apr 12, 2013 at 11:41 AM, Alexey Mukas alexey.mu...@gmail.comwrote:

 Hi,

 Suppose I have BlinkBehaviour

 public static class BlinkBehaviour extends Behavior {
 @Override
 public void renderHead(Component component, IHeaderResponse
 response) {
 AjaxRequestTarget target =
 component.getRequestCycle().find(AjaxRequestTarget.class);
 if (target != null) {
 target.prependJavaScript(notify|jQuery('# +
 component.getMarkupId() + ').fadeOut(400, notify););


 target.appendJavaScript(jQuery('#+component.getMarkupId()+').fadeIn(400););
 }
 }
 }

 If I add it twice to a control and update the control via ajax
 6.7.0-SNAPSHOT will yield error:

 ERROR: Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript:
 SyntaxError: Unexpected token ), text: f = function(notify)
 {jQuery('#version2').fadeOut(400,
 notify);})();(function(){notify|jQuery('#version2').fadeOut(400, notify);};



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Generating-wrong-JavaScript-on-ajax-updated-tp4657921.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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


Re: Generating wrong JavaScript on ajax updated

2013-04-12 Thread Alexey Mukas
Here is a ticker with a quick start  WICKET-5142
https://issues.apache.org/jira/browse/WICKET-5142  



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Generating-wrong-JavaScript-on-ajax-updated-tp4657921p4657923.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: 1.4 - 6.0 question

2013-04-12 Thread Pierre Goupil
Thanks for that, Marco!

Regards,

Pierre



On Fri, Apr 12, 2013 at 8:35 AM, Marco Springer ma...@glitchbox.nl wrote:

 Hello Pierre,

 You can also just override/extend the onComponentTag function from the
 Component.:

 Component {
   @Override
   protected void onComponentTag(ComponentTag tag) {
 super.onComponentTag(tag);
 tag.put(attribute, value)
   }
 }

 As far as I can see, SimpleAttributeModifier doesn't exist anymore, just
 use
 the AttributeModifier class or sub-class that if you really need to.

 Or attach a custom Behavior to the component which can also override the
 onComponentTag function like so:
 public class FeedbackFieldDecorator extends Behavior {
   @Override
   public void onComponentTag(Component component, ComponentTag tag) {
 if (!((FormComponent?)component).isValid()) {
   String cl = tag.getAttribute(class);
   if (cl == null) {
 tag.put(class, error);
   } else {
 tag.put(class, error  + cl);
   }
 }
   }
 }

 Cheers,
 Marco

 On Thursday 11 April 2013 21:50:28 Pierre Goupil wrote:
  Good evening,
 
  I have a Wicket 1.4 code that I want to migrate to 6.0. It all works fine
  except for this code in a sub-class of SimpleAttributeModifier:
 
@Override
public void onComponentTag(final Component component, final
 ComponentTag
  tag) {
  System.out.println(ononComponentTag called. component=+component+,
  tag=+tag);
  if (isEnabled(component)) {
System.out.println(changing attribute, value=+value);
tag.getAttributes().put(attribute, value);
  }
}
 
  I don't know what this code is supposed to do, so does anyone know with
  what to replace it? AttributeModifier#onComponentTag() is final in 6.0!
 
  Any help is much appreciated.
 
  Regards,
 
  Pierre

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




-- 
Parce que c'est la nuit qu'il est beau de croire à la lumière.

Edmond Rostand


CheckBox Column random behaviour when using wicket Bootstrap 0.8

2013-04-12 Thread David Beer

Hi All

I am trying to add a checkbox column to my DataTable. This has a Model 
based on the SortableDataProvider to sort the table which works well. 
The problem is the functionality associated with the checkboxcolumn I 
have followed the example in Apache wicket Cookbook and updated it to 
use Wicket 6.6.0. But I get random behaviour with the javascript 
controlling the checkboxes, they either get selected and the first item 
in the table is added to the resulting set or the last item but never 
more than one and the middle item is never selected. From Debugging it 
seems to get added and then removed. Everything is in a form as 
suggested in the Cookbook.


Here is the code which adds the column to the list of columns:

private void addDataTable() {
ListIColumnDVCSWebRepository, String columns = new 
ArrayList();

columns.add(new CheckBoxColumnDVCSWebRepository, String() {
@Override
protected IModelBoolean newCheckBoxModel(final 
IModelDVCSWebRepository rowModel) {

return new AbstractCheckBoxModel() {
@Override
public boolean isSelected() {
return selected.contains(rowModel.getObject());
}

@Override
public void select() {
selected.add(rowModel.getObject());
}

@Override
public void unselect() {
selected.remove(rowModel.getObject());
}

@Override
public void detach() {
rowModel.detach();
}
};
}
});
columns.add(new PropertyColumnDVCSWebRepository, 
String(Model.of(Repository Name), repositoryName, repositoryName));
columns.add(new PropertyColumnDVCSWebRepository, 
String(Model.of(Description), description));
columns.add(new PropertyColumnDVCSWebRepository, 
String(Model.of(Location), location));
columns.add(new PropertyColumnDVCSWebRepository, 
String(Model.of(Repository Type), repositoryType));


Form? form = new FormVoid(form) {
@Override
protected void onSubmit() {
for (DVCSWebRepository repo : selected) {
info(Selected  + repo.getRepositoryName());
}
}
};
add(form);

DataTableDVCSWebRepository, String dtable = new 
DefaultDataTable(repos-table, columns,

new DVCSWebRepositoryDataProvider(), 10);
//dtable.addBottomToolbar(new 
ExportToolbar(dtable).addDataExporter(new CSVDataExporter()));

dtable.add(new TableBehavior().bordered().striped());

form.add(dtable);
add(new FeedbackPanel(feedback));
}

The CheckBoxColumn code is below:

public abstract class CheckBoxColumnT, S extends AbstractColumnT, S {

private final String uuid = 
UUID.randomUUID().toString().replace(-, );
private final String js = var val=$(this).prop('checked'); $('. + 
uuid + ').each(function() { $(this).prop('checked', val); });;


public CheckBoxColumn() {
super(null);
}

@Override
public void populateItem(ItemICellPopulatorT cellItem,
String componentId, IModelT rowModel) {
cellItem.add(new CheckPanel(componentId, 
newCheckBoxModel(rowModel)));

}

protected CheckBox newCheckBox(String id, IModelBoolean checkModel) {
return new CheckBox(check, checkModel) {
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
tag.append(class, uuid,  );
}
};
}

protected abstract IModelBoolean newCheckBoxModel(IModelT 
rowModel);


@Override
public Component getHeader(String componentId) {
CheckPanel panel = new CheckPanel(componentId, new 
ModelBoolean());

panel.get(check).add(new AbstractAjaxBehavior() {
@Override
protected void onComponentTag(ComponentTag tag) {
tag.put(onClick, js);
}

@Override
public void onRequest() {
}
});
return panel;
}

private class CheckPanel extends Panel {

public CheckPanel(String id, IModelBoolean checkModel) {
super(id);
add(newCheckBox(check, checkModel));
}
}
}

I am using Wicket 6.6.0 and Wicket-BootStrap 0.8.1 from agilecoders. So 
should be using jquery 1.9.0.


Any pointers would be greatly appreciated.

Thanks

David

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



Clearing panel when leaving page

2013-04-12 Thread Merlijn
Hi everybody,

I have a dropdown panel that opens when a user enters something inside a
textfield. The problem is that when the panel is open and the user goes to
another page, if the back button is then used to go back to the page, the
panel is still open. 

Now I fixed it by having a AjaxFormComponentUpdatingBehavior that invokes on
blur, which clears the panel. But the problem with is that it now does an
Ajax call whenever an onblur event happens. 

I also tried doing it in Javascript, setting the panel to display = 'none'
but that does not work. Does anyone know a good solution without using Ajax?

Thanks and kind regards,

Merlijn



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Clearing-panel-when-leaving-page-tp4657929.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Clearing panel when leaving page

2013-04-12 Thread Martin Grigorov
Hi,


On Fri, Apr 12, 2013 at 3:41 PM, Merlijn lucas...@gmail.com wrote:

 Hi everybody,

 I have a dropdown panel that opens when a user enters something inside a
 textfield. The problem is that when the panel is open and the user goes to
 another page, if the back button is then used to go back to the page, the
 panel is still open.

 Now I fixed it by having a AjaxFormComponentUpdatingBehavior that invokes
 on
 blur, which clears the panel. But the problem with is that it now does an
 Ajax call whenever an onblur event happens.

 I also tried doing it in Javascript, setting the panel to display = 'none'
 but that does not work. Does anyone know a good solution without using
 Ajax?


Wicket also uses JavaScript to remove it so it should work.

Alternatively you can use OnDomReady JavaScript to initialize it. This way
it the JS will be executed just once at page load time.



 Thanks and kind regards,

 Merlijn



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Clearing-panel-when-leaving-page-tp4657929.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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


Re: Atmosphere problem with JBoss 7.1

2013-04-12 Thread Raul
All libraries are included in the wicket application. The difference is
created in the web.xml. I have set the following parameter to false

init-param
param-name org.atmosphere.useNative / param-name
param-value true / param-value
/ Init-param
And to deploy the application log tells me that the Atmosphere is started,
but on entering the application, I still returns the 404, but now and does
not draw any trace. The content of my web.xml is being
servlet
description Atmospherefilter / description
servlet-name Atmospherefilter / servlet-name
servlet-class org.atmosphere.cpr.AtmosphereServlet / servlet-class
init-param
param-name org.atmosphere.filter / param-name
param-value org.apache.wicket.protocol.http.WicketFilter / param-value
/ Init-param
init-param
param-name applicationClassName / param-name
param-value com.myCompany.MyApplication / param-value
/ Init-param
init-param
param-name org.atmosphere.useWebSocket / param-name
param-value true / param-value
/ Init-param
init-param
param-name org.atmosphere.useNative / param-name
param-value false/ param-value
/ Init-param
init-param
param-name org.atmosphere.cpr.sessionSupport / param-name
param-value true / param-value
/ Init-param
init-param
param-name org.atmosphere.websocket.WebSocketProtocol / param-name
param-value org.atmosphere.websocket.protocol.EchoProtocol / param-value
/ Init-param
init-param
param-name org.atmosphere.cpr.broadcastFilterClasses / param-name
param-value org.apache.wicket.atmosphere.TrackMessageSizeFilter /
param-value
/ Init-param
init-param
param-name filterMappingUrlPattern / param-name
param-value / * / param-value
/ Init-param

load-on-startup 0 / load-on-startup
/ Servlet

servlet-mapping
servlet-name Atmospherefilter / servlet-name
url-pattern / * / url-pattern
/ Servlet-mapping

And the web.xml before using Atmosphere, (which worked fine). was this.

filter
filter-name wicket.netwie / filter-name
filter-class org.apache.wicket.protocol.http.WicketFilter / filter-class
init-param
param-name applicationClassName / param-name
param-value com.myCompany.MyApplication / param-value
/ Init-param
/ Filter
filter-mapping
filter-name wicket.netwie / filter-name
url-pattern / * / url-pattern
/ Filter-mapping
session-config
session-timeout 30 / session-timeout
/ Session-config

With the new web.xml, although always displays the context returns 404.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Atmosphere-problem-with-JBoss-7-1-tp4657907p4657931.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Busy Indicator to prevent user activity

2013-04-12 Thread saty
Thanks for all your help.

I have this another  case now, i have a download link.

The code that downloads file is below:

LinkVoid link = new LinkVoid(dataExportLink)
{
private static final long serialVersionUID = 1L;
public void onClick() 
{   
IRequestHandler handler = new DataExportHandler(a,b,c,d...);

RequestCycle.get().scheduleRequestHandlerAfterCurrent(handler); 

}
};   
When this link is clicked the Busy Indicator kicks in but it never goes away
even after file has been downloaded. How Can i make the busy indicator work
for this case.

Thanks



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Busy-Indicator-to-prevent-user-activity-tp4657877p4657932.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Busy Indicator to prevent user activity

2013-04-12 Thread Ernesto Reinaldo Barreiro
try

https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html




On Fri, Apr 12, 2013 at 6:18 PM, saty satya...@gmail.com wrote:

 Thanks for all your help.

 I have this another  case now, i have a download link.

 The code that downloads file is below:

 LinkVoid link = new LinkVoid(dataExportLink)
 {
 private static final long serialVersionUID = 1L;
 public void onClick()
 {
 IRequestHandler handler = new DataExportHandler(a,b,c,d...);
 RequestCycle.get().scheduleRequestHandlerAfterCurrent(handler);
 }
 };
 When this link is clicked the Busy Indicator kicks in but it never goes
 away
 even after file has been downloaded. How Can i make the busy indicator work
 for this case.

 Thanks



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Busy-Indicator-to-prevent-user-activity-tp4657877p4657932.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Regards - Ernesto Reinaldo Barreiro


getPrefixToContextPath and optional named parameters

2013-04-12 Thread divad91
Hi, I am migrating  from wicket 1.4.21 to wicket 6.6.0.

In a javascript template, I need to get the path of an image.

In wicket 1.4.21, I used to do :
values.put(datePickerImageUrl, String.format(%simages/icn-calendar.png,
RequestCycle.get().getRequest().getRelativePathPrefixToContextRoot()));

In wicket 6.6.6, I use:
values.put(datePickerImageUrl,String.format(%simages/icn-calendar.png,
RequestCycle.get().getRequest()

.getPrefixToContextPath()));

My page is mount like so:
mountPage(dwelling/#{lang}, DwellingPage.class);

My page and my image path works great  except when I access the page with
the optional parameter.
I that case, getPrefixToContextPath does not return the correct prefix.

I should get  ../images/icn-calendar.png.  because the url is /dwelling/en
but instead I get  images/icn-calendar.png

Is this a bug ? Is there an other method I could use ?

Thanks

David







--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/getPrefixToContextPath-and-optional-named-parameters-tp4657934.html
Sent from the Users forum mailing list archive at Nabble.com.

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



ExternalLink not render as link AjaxFallbackDefaultDataTable

2013-04-12 Thread dhongyt
I have created a AjaxFallbackDefaultDataTable and created an abstract column


For some reason on the website when the table is rendered it shows up as
plain text but its a div link and not a  . I would like it to be a   link
so the blue underline will show up. Why is it just showing up in plain text?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ExternalLink-not-render-as-link-AjaxFallbackDefaultDataTable-tp4657935.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: ExternalLink not render as link AjaxFallbackDefaultDataTable

2013-04-12 Thread Ernesto Reinaldo Barreiro
you need to create a panel and inside the panel put the link (a) and use
that panel as content of the column.


On Fri, Apr 12, 2013 at 8:53 PM, dhongyt davidhtr...@gmail.com wrote:

 I have created a AjaxFallbackDefaultDataTable and created an abstract
 column


 For some reason on the website when the table is rendered it shows up as
 plain text but its a div link and not a  . I would like it to be a   link
 so the blue underline will show up. Why is it just showing up in plain
 text?



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/ExternalLink-not-render-as-link-AjaxFallbackDefaultDataTable-tp4657935.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Regards - Ernesto Reinaldo Barreiro


Re: ExternalLink not render as link AjaxFallbackDefaultDataTable

2013-04-12 Thread dhongyt
Thanks for the quick reply.
I'm kind of new at this so if you could clarify a bit more. Do you mean
this?



Doesn't seem like Panel has a populateItem so adding a ExternalLink is
giving me issues.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ExternalLink-not-render-as-link-AjaxFallbackDefaultDataTable-tp4657935p4657937.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: ExternalLink not render as link AjaxFallbackDefaultDataTable

2013-04-12 Thread Ernesto Reinaldo Barreiro
panels need to have markup associated e.g. read

https://cwiki.apache.org/WICKET/create-dynamic-markup-hierarchies-using-panels.html




On Fri, Apr 12, 2013 at 9:17 PM, dhongyt davidhtr...@gmail.com wrote:

 Thanks for the quick reply.
 I'm kind of new at this so if you could clarify a bit more. Do you mean
 this?



 Doesn't seem like Panel has a populateItem so adding a ExternalLink is
 giving me issues.



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/ExternalLink-not-render-as-link-AjaxFallbackDefaultDataTable-tp4657935p4657937.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Regards - Ernesto Reinaldo Barreiro


Re: ExternalLink not render as link AjaxFallbackDefaultDataTable

2013-04-12 Thread dhongyt
Thanks again Ernesto.

I didn't know that I needed to create my own Panel in java and html.

I thought I could do it all in one java class.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ExternalLink-not-render-as-link-AjaxFallbackDefaultDataTable-tp4657935p4657939.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: ExternalLink not render as link AjaxFallbackDefaultDataTable

2013-04-12 Thread dhongyt
How do I know when I need to implement a markup? And when I do not need to?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ExternalLink-not-render-as-link-AjaxFallbackDefaultDataTable-tp4657935p4657940.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: ExternalLink not render as link AjaxFallbackDefaultDataTable

2013-04-12 Thread Ernesto Reinaldo Barreiro
Your welcome!

I would advise you to read a bit about wicket and what you can do with it
before you get into real development...

Andrea just released a free book a few days ago

https://code.google.com/p/wicket-guide/

There are also other excellent options in case you can and are willing to
pay for them

http://wicket.apache.org/learn/books/



On Fri, Apr 12, 2013 at 9:50 PM, dhongyt davidhtr...@gmail.com wrote:

 Thanks again Ernesto.

 I didn't know that I needed to create my own Panel in java and html.

 I thought I could do it all in one java class.



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/ExternalLink-not-render-as-link-AjaxFallbackDefaultDataTable-tp4657935p4657939.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Regards - Ernesto Reinaldo Barreiro


Re: ExternalLink not render as link AjaxFallbackDefaultDataTable

2013-04-12 Thread dhongyt
Thanks again, that's exactly what I need.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ExternalLink-not-render-as-link-AjaxFallbackDefaultDataTable-tp4657935p4657943.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: getPrefixToContextPath and optional named parameters

2013-04-12 Thread Alexey Mukas
Try this one 

UrlUtils.rewriteToContextRelative(images/icn-calendar.png,getRequestCycle())



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/getPrefixToContextPath-and-optional-named-parameters-tp4657934p4657944.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: getPrefixToContextPath and optional named parameters

2013-04-12 Thread divad91
Great it's working ! I did not know this util class.
A huge thank you ! 
I was writing my own getPrefixToContextPath method base on the request url
!

Thanks again !
David



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/getPrefixToContextPath-and-optional-named-parameters-tp4657934p4657945.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Update ListView with Ajax, performance.

2013-04-12 Thread Raul
Hello, I need to implement a component that can display a list of users from
a ListView, at the end of the list you should see a link to see more
users. What I need is to update the list of users displayed but without
rendering at all in ListView again. Because right now I use a AjaxLink that
updates the entire ListView container, but when many users are penalized
performance and gives a sense of slowness. Anyone know if you can implement
some of this functionality with wicket.





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Update-ListView-with-Ajax-performance-tp4657948.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Update ListView with Ajax, performance.

2013-04-12 Thread Nick Pratt
Id use one of various Javascript libs to implement this sort of
functionality - I think select2 and datatables would both work for such a
list (I think they both support infinite scrolling lists) that only
render/send a page of information at a time. There's a wicket-select2
library, but its fairly minimal in nature - you'll need to understand the
JS docs to get anywhere with it. I think there's a Wicket lib for
Datatables, but I dont know its maintenance status.  There are countless
other JS libraries to do this as well.

Nick


On Fri, Apr 12, 2013 at 4:05 PM, Raul ralva...@netwie.com wrote:

 Hello, I need to implement a component that can display a list of users
 from
 a ListView, at the end of the list you should see a link to see more
 users. What I need is to update the list of users displayed but without
 rendering at all in ListView again. Because right now I use a AjaxLink that
 updates the entire ListView container, but when many users are penalized
 performance and gives a sense of slowness. Anyone know if you can implement
 some of this functionality with wicket.





 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Update-ListView-with-Ajax-performance-tp4657948.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: Update ListView with Ajax, performance.

2013-04-12 Thread Alexey Mukas
If the list is relatively small (say 20-30 items) then it's better to pull it
entirely to the clientside. Show first N items use js in the bottom link to
show next items without a call to the server.
see this solution
http://stackoverflow.com/questions/10944304/hiding-list-items-with-a-show-more-button
  



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Update-ListView-with-Ajax-performance-tp4657948p4657950.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Update ListView with Ajax, performance.

2013-04-12 Thread Raul
Nick, I sensed that the solution was going to use Javascript, my question was
if there was any easier than the framework could provide. Select2 prove.

Alexy single client solution does not help me as I have a large volume of
data.

Regards and thanks for the guidance.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Update-ListView-with-Ajax-performance-tp4657948p4657951.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Update ListView with Ajax, performance.

2013-04-12 Thread Nick Pratt
I guess you could build something with just the core framework, but I think
it would be a lot clunkier than one of the libs - for instance, on the
client side JS libs, you get events that can trigger Ajax callbacks to load
the next set of data while the user is scrolling through the list - since
its async, its much smoother and a better experience.

Ive used (and am using in a current project) both select2 and datatables.
 While the initial learning curve is reasonable with both libs (you're not
likely to be able to avoid writing your own JS init/config for these
components), they are stable, and work very well.

N


On Fri, Apr 12, 2013 at 4:36 PM, Raul ralva...@netwie.com wrote:

 Nick, I sensed that the solution was going to use Javascript, my question
 was
 if there was any easier than the framework could provide. Select2 prove.

 Alexy single client solution does not help me as I have a large volume of
 data.

 Regards and thanks for the guidance.



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Update-ListView-with-Ajax-performance-tp4657948p4657951.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: Update ListView with Ajax, performance.

2013-04-12 Thread Martin Grigorov
Hi,

I have done something like this before.
I used a table in my case but you can use another HTML element.
The initial layout is:
-table
--tbody
---tr
---tr

---tr
--tbody (id + style=display:none)
--tfoot
---tr
a (Show more link)

i.e. the first tbody shows the items, the second tbody is a placeholder and
the tfoot has the 'show' link
When the link is clicked the server returns markup like:
--tbody
---tr
---tr

---tr
--tbody (id + style=display:none)

which replaces the placeholder tbody.
When there are no more entries the last Ajax response also hides the tfoot.


On Fri, Apr 12, 2013 at 11:36 PM, Raul ralva...@netwie.com wrote:

 Nick, I sensed that the solution was going to use Javascript, my question
 was
 if there was any easier than the framework could provide. Select2 prove.

 Alexy single client solution does not help me as I have a large volume of
 data.

 Regards and thanks for the guidance.



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Update-ListView-with-Ajax-performance-tp4657948p4657951.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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