Re: could not serialize the page java.lang.OutOfMemoryError: PermGen space

2010-10-13 Thread Thomas Kappler

On 10/13/10 16:25, fachhoch wrote:


could not serialize the pagejava.lang.OutOfMemoryError: PermGen space ,


This is not *the* heap (for objects) as others have said, it's the 
permanent generation heap, which is a different memory section used by 
the JVM, for instance for interning Strings and for loaded classes. 
Google for more info.


If you get "Could not reserve enough space for object heap" when 
starting up, you don't have enough memory on the machine.



--
---
  Thomas Kapplerthomas.kapp...@isb-sib.ch
  Swiss Institute of Bioinformatics Tel: +41 22 379 51 89
  CMU, rue Michel Servet 1
  1211 Geneve 4
  Switzerland  http://www.uniprot.org
---

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



Re: Getting the html output of a wicket page

2010-10-13 Thread Martin Makundi
Hi!

Try this:

http://apache-wicket.1842946.n4.nabble.com/WebPage-geting-string-tp2993717p2993717.html

**
Martin

2010/10/14 elesi :
>
> Hello guys,
>
> I'm trying to send a email with a body that is HTML-formatted...and I would
> to use wicket to write it out...
>
> Is there a way that I could store the markup (with all the tags and stuff)
> of a wicket-rendered web page into a string variable?
>
> I thought the getMarkupResourceStream() would work, but i don't know where
> it will be called...
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Getting-the-html-output-of-a-wicket-page-tp2994739p2994739.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
>
>

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



Getting the html output of a wicket page

2010-10-13 Thread elesi

Hello guys,

I'm trying to send a email with a body that is HTML-formatted...and I would
to use wicket to write it out...

Is there a way that I could store the markup (with all the tags and stuff)
of a wicket-rendered web page into a string variable?

I thought the getMarkupResourceStream() would work, but i don't know where
it will be called...



-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Getting-the-html-output-of-a-wicket-page-tp2994739p2994739.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: How to update a Panel when user selects a drop down chioce in Wicket?

2010-10-13 Thread Jeremy Thomerson
Also, if you haven't seen it, look at the Wicket Examples:
http://wicketstuff.org/wicket14/

And specifically, this page:
http://wicketstuff.org/wicket14/repeater/?wicket:bookmarkablePage=:org.apache.wicket.examples.repeater.PagingPage

On Wed, Oct 13, 2010 at 7:45 PM, Jeremy Thomerson  wrote:

> Sure, http://www.lmgtfy.com/?q=example+idataprovider&l=1
>
>
> On Wed, Oct 13, 2010 at 7:16 PM, gouthamrv  wrote:
>
>>
>> I am still have issues, is it possible for you to provide an example of
>> data
>> provider implementaion for the requirement I have?
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/How-to-update-a-Panel-when-user-selects-a-drop-down-chioce-in-Wicket-tp2994412p2994648.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
>>
>>
>
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>


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


Re: How to update a Panel when user selects a drop down chioce in Wicket?

2010-10-13 Thread Jeremy Thomerson
Sure, http://www.lmgtfy.com/?q=example+idataprovider&l=1

On Wed, Oct 13, 2010 at 7:16 PM, gouthamrv  wrote:

>
> I am still have issues, is it possible for you to provide an example of
> data
> provider implementaion for the requirement I have?
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-update-a-Panel-when-user-selects-a-drop-down-chioce-in-Wicket-tp2994412p2994648.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
>
>


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


Re: How to update a Panel when user selects a drop down chioce in Wicket?

2010-10-13 Thread gouthamrv

I am still have issues, is it possible for you to provide an example of data
provider implementaion for the requirement I have?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-update-a-Panel-when-user-selects-a-drop-down-chioce-in-Wicket-tp2994412p2994648.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: How to update a Panel when user selects a drop down chioce in Wicket?

2010-10-13 Thread Jeremy Thomerson
You're not implementing your data provider correctly.  The model(Foo) method
is called AFTER the iterator method.  The intent is so that it can wrap the
Foo in a LoadableDetachableModel (or some other appropriate alternative)
that loads only a single row.  Your iterator and size methods are the ones
that should go to your database / service layer.

NOTE: You really don't want to go get all records just to return a sublist.
 That's a bad idea in almost all cases, unless you're dealing with small
datasets, in which case, just use a ListView and IModel> rather
than the whole data provider.

On Wed, Oct 13, 2010 at 5:50 PM, gouthamrv  wrote:

>
> I think you are right. I have changed my code as you suggested, now it is
> saying no records found. Here is the rest of the code. I think I am missing
> something, can you please suggest?
>
> DealHistoryDataProvider dataProvider = new DealHistoryDataProvider();
> AjaxFallbackDefaultDataTable ajaxFallbackDefaultDataTable =
> new
> AjaxFallbackDefaultDataTable("deal_history_table",
> historyColumns, dataProvider, ROWS_PER_PAGE);
>
> public class DealHistoryDataProvider extends
> SortableDataProvider {
>private List dealHistoryList = new
> ArrayList();
>
>/**
> * @see org.apache.wicket.markup.repeater.data.IDataProvider#size()
> */
>public int size() {
>return this.dealHistoryList.size();
>}
>
>@Override
>public Iterator iterator(int first, int
> count) {
> return this.dealHistoryList.subList(first, first +
> count).iterator();
>}
>
>@Override
>public IModel model(DealHistory object) {
>IModel> model = new
> LoadableDetachableModel>() {
>@Override
>public List load() {
>dealHistoryList =
> ServicesCaller.getAllDealHistoryRecords();
>return dealHistoryList;
>}
>};
>return model;
>}
> }
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-update-a-Panel-when-user-selects-a-drop-down-chioce-in-Wicket-tp2994412p2994557.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
>
>


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


Re: How to update a Panel when user selects a drop down chioce in Wicket?

2010-10-13 Thread gouthamrv

I think you are right. I have changed my code as you suggested, now it is
saying no records found. Here is the rest of the code. I think I am missing
something, can you please suggest?

DealHistoryDataProvider dataProvider = new DealHistoryDataProvider();
AjaxFallbackDefaultDataTable ajaxFallbackDefaultDataTable = new
AjaxFallbackDefaultDataTable("deal_history_table",
historyColumns, dataProvider, ROWS_PER_PAGE);

public class DealHistoryDataProvider extends
SortableDataProvider {
private List dealHistoryList = new 
ArrayList();

/**
 * @see org.apache.wicket.markup.repeater.data.IDataProvider#size()
 */
public int size() {
return this.dealHistoryList.size();
}

@Override
public Iterator iterator(int first, int count) {
 return this.dealHistoryList.subList(first, first + 
count).iterator();
}

@Override
public IModel model(DealHistory object) {
IModel> model = new
LoadableDetachableModel>() {
@Override
public List load() {
dealHistoryList = 
ServicesCaller.getAllDealHistoryRecords();
return dealHistoryList;
}
};
return model;
}
}
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-update-a-Panel-when-user-selects-a-drop-down-chioce-in-Wicket-tp2994412p2994557.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: How to update a Panel when user selects a drop down chioce in Wicket?

2010-10-13 Thread Jeremy Thomerson
On Wed, Oct 13, 2010 at 3:33 PM, gouthamrv  wrote:

>
> I would like to know how to update a panel when we select a drop down
> chioce
> values, that is in onUpdate() method.
>
> My custom panel has AjaxFallbackDefaultDataTable.
>
> Below is Panel and drop down components code. When user selects date, I
> want
> to replace my entire Panel. Currently I have commened that
> target.addComponent code, but I want to have implementation here. Any
> suggestions?
>
>
>List dealHistoryList = ServicesCaller
>.getAllDealHistoryRecords();
>DealHistoryTablePanel dealHistoryTablePanel = new
> DealHistoryTablePanel(
>"deal_history_table_panel",
> dealHistoryList);
>dealHistoryTablePanel.setOutputMarkupId(true);
>
>add(dealHistoryTablePanel);
>
>IModel> dateChoices = new
> AbstractReadOnlyModel>() {
>@Override
>public List getObject() {
>List list = new ArrayList();
>list.add("Last 3 months");
>list.add("Last 6 months");
>return list;
>}
>};
>
>final DropDownChoice datesDropDown = new
> DropDownChoice(
>"dates", new PropertyModel(this,
> "selectedDate"),
>dateChoices);
>datesDropDown.add(new
> AjaxFormComponentUpdatingBehavior("onchange") {
>@Override
>protected void onUpdate(AjaxRequestTarget target) {
>
>  //target.addComponent(dealHistoryTablePanel);
>}
>});
>add(datesDropDown);
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-update-a-Panel-when-user-selects-a-drop-down-chioce-in-Wicket-tp2994412p2994412.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
>
>

The idea you have should work - you just repaint the table / panel in the
onUpdate.  However, since you are pre-loading the table with data in your
constructor, the table will not retrieve updated values based on the changed
dropdownchoice value.  Instead of calling your database or service layer in
the constructor (nearly always a bad idea), you should do that in a model,
like:

IModel> listModel = new LoadableDetachableModel>() {
  public List load() {
MyService.getLotsOfFooBasedOn(thePropertyThatIsChangedByYourDropDown);
  }
}

Doing that will make your table automatically update when it's repainted
after the drop down changes values.

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


How to update a Panel when user selects a drop down chioce in Wicket?

2010-10-13 Thread gouthamrv

I would like to know how to update a panel when we select a drop down chioce
values, that is in onUpdate() method.

My custom panel has AjaxFallbackDefaultDataTable.

Below is Panel and drop down components code. When user selects date, I want
to replace my entire Panel. Currently I have commened that
target.addComponent code, but I want to have implementation here. Any
suggestions?


List dealHistoryList = ServicesCaller
.getAllDealHistoryRecords();
DealHistoryTablePanel dealHistoryTablePanel = new 
DealHistoryTablePanel(
"deal_history_table_panel", dealHistoryList);
dealHistoryTablePanel.setOutputMarkupId(true);

add(dealHistoryTablePanel);

IModel> dateChoices = new
AbstractReadOnlyModel>() {
@Override
public List getObject() {
List list = new ArrayList();
list.add("Last 3 months");
list.add("Last 6 months");
return list;
}
};

final DropDownChoice datesDropDown = new 
DropDownChoice(
"dates", new PropertyModel(this, 
"selectedDate"),
dateChoices);
datesDropDown.add(new 
AjaxFormComponentUpdatingBehavior("onchange") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
//target.addComponent(dealHistoryTablePanel);
}
});
add(datesDropDown);

 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-update-a-Panel-when-user-selects-a-drop-down-chioce-in-Wicket-tp2994412p2994412.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: could not serialize the page java.lang.OutOfMemoryError: PermGen space

2010-10-13 Thread Altuğ Bilgin Altıntaş
http://javahowto.blogspot.com/2006/06/6-common-errors-in-setting-java-heap.html

2010/10/13 fachhoch 

>
> I added   this to   eclipse -XX:PermSize=256m -XX:MaxPermSize=512m
>
> but the problem is   I cannot start my jetty container I get this error
>
>
>
> Error occurred during initialization of VM
> Could not reserve enough space for object heap
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/could-not-serialize-the-page-java-lang-OutOfMemoryError-PermGen-space-tp2993745p2994036.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: using cometd

2010-10-13 Thread Rodolfo Hansen
Yes, this message is safe to ignore. 

It is the bayeux implementation stating JSONCommented is deprecated. 

Later versions of push do not try to use it.

On Tue, 2010-10-12 at 19:32 -0700, fachhoch wrote:

> JSONCommented


Re: mountBookmarkablePage and BookmarkablePageLink with PageParameters

2010-10-13 Thread Jeremy Thomerson
Create a quickstart and attach it to a JIRA.

On Tue, Oct 5, 2010 at 4:05 AM, virtualizer  wrote:

>
>
> Altuğ Bilgin Altıntaş wrote:
> >
> > Also could you please try without   just
> >
> > add(new BookmarkablePageLink("testlink1", Test1.class, pp));
> >
> > Which wicket version ?
> >
>
> Without generic type it is the same problem.
>
> I´m using 1.4.9.
>
> I have the same problem if I don´t use PageParameters and
> mount("/some/path", PackageName.forClass(Test1.class))
>
> Thanks!
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/mountBookmarkablePage-and-BookmarkablePageLink-with-PageParameters-tp2954926p2955651.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
>
>


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


Re: Form model changes when onSubmit method is called for the first time.

2010-10-13 Thread Jeremy Thomerson
Show some code.

On Tue, Oct 5, 2010 at 9:27 AM, armandoxxx  wrote:

>
> Hey ppl
>
> Got a little problem with a form onSubmit().
> A form (for translations, IModel ) has a DropDownChoice (to
> select a language and holds list of Language objects) and a ListView with
> panels that are wrapper for other fields (TextField, TextAreaField. etc).
> example:
> Form
>   DropdownChoice (Language selection)
>   Panel1
>   Label
>   TextField  (fot title)
>   Panel2
>   Label
>   TextAreaField (for description)
>  Submit
>
> Another component on same page is a DataGridView to list Translation
> records
> from data source.
>
> The problem is when I press submit button and onSubmit() method is
> executed.
> - If form is empty, meaning form was never populated before, the
> getDefaultModelObject() method returns Language object , which is obviously
> the wrong object, cause I specificaly set it to the same that grid uses
> (Translation).
>
> - If I select a record from grid and form gets populated with record data,
> onSubmit()  I get the Translation object which is the one I wanted.
>
> Does anyone have any idea what's wrong ? Any tip would be fine.
>
> Some info:
> - onInitialize() method returns Translation object when
> getDefaultModelObject() is called.
>
> kind regards
>
> Armando
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Form-model-changes-when-onSubmit-method-is-called-for-the-first-time-tp2956133p2956133.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
>
>


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


Re: Problem using wicket-extensions

2010-10-13 Thread Jeremy Thomerson
Without knowing what's on your classpath, it's impossible for us to help
you.  Either slf4j is not on the classpath (most likely), or there is some
other strange problem - duplicate jars, different classloaders, etc...

On Thu, Oct 7, 2010 at 12:48 AM, chitrabhanu.das
wrote:

>
> Thanks for the repley. Yes I am using maven This is my pom.xml
>
>
>
>
> http://maven.apache.org/POM/4.0.0";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd";>
>4.0.0
>nic.fts
>FTS2
>war
>1.0-SNAPSHOT
>
>quickstart
>
>
>
>
>The Apache Software License, Version
> 2.0
>http://www.apache.org/licenses/LICENSE-2.0.txt
> 
>repo
>
>
>
>
>
>org.apache.wicket
>wicket
>${wicket.version}
>
>
>org.springframework
>spring
>2.5.6
>
>
>org.apache.wicket
>wicket-spring
>${wicket.version}
>
>
>org.hibernate
>hibernate-core
>3.3.2.GA
>
>
>javax.persistence
>persistence-api
>1.0
>
>
>org.hibernate
>hibernate-annotations
>3.4.0.GA
>
>
>commons-dbcp
>commons-dbcp
>1.2.2
>
>
> org.apache.wicket
>wicket-extensions
>${wicket.version}
>
>
>
>
>
>org.slf4j
>slf4j-log4j12
>1.4.2
>
>
>log4j
>log4j
>1.2.14
>
>
>
>
>junit
>junit
>3.8.2
>test
>
>
>
>
>org.mortbay.jetty
>jetty
>${jetty.version}
>provided
>
>
>org.mortbay.jetty
>jetty-util
>${jetty.version}
>provided
>
>
>org.mortbay.jetty
>jetty-management
>${jetty.version}
>provided
>
>
>
>
>
>false
>src/main/resources
>
>
>false
>src/main/java
>
>**
>
>
>**/*.java
>
>
>
>
>
>false
>src/test/java
>
>**
>
>
>**/*.java
>
>
>
>
>
>true
>org.apache.maven.plugins
>
>  maven-compiler-plugin
>
>1.5
>1.5
>true
>true
>
>
>
>org.mortbay.jetty
>maven-jetty-plugin
>
>
>org.apache.maven.plugins
>
>  maven-eclipse-plugin
>
>
>  true
>
>   

RE: could not serialize the page java.lang.OutOfMemoryError: PermGen space

2010-10-13 Thread fachhoch

I added   this to   eclipse -XX:PermSize=256m -XX:MaxPermSize=512m

but the problem is   I cannot start my jetty container I get this error  



Error occurred during initialization of VM
Could not reserve enough space for object heap

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/could-not-serialize-the-page-java-lang-OutOfMemoryError-PermGen-space-tp2993745p2994036.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: condition in AbstractAjaxTimerBehavior

2010-10-13 Thread Igor Vaynberg
if (!canrefresh()) { settimeout(  }


-igor

On Wed, Oct 13, 2010 at 4:37 AM, Maris Orbidans  wrote:
> Hi
>
> I need to periodically update a page unless some condition is met.
> I wrote javascript function canRefresh() and added like this:
>
> add(new AbstractAjaxTimerBehavior(Duration.seconds(5)) {
> �...@override
>  protected void onTimer(final AjaxRequestTarget target) {
>    updateSessionConfigPanel(target);
>   }
>
>   @Override
>    protected CharSequence getCallbackScript() {
>      return "if (!canRefresh()) {"+ super.getCallbackScript()+"};";
>      }
>  });
>
> This is generated javascript.
>
> ]]>*/
>
> The problem is that once canRefresh() returns false timer stops. Is it
> possible to restart it?  Or a better way to implement conditional
> update?
>
>
> Maris
>
> -
> 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: AjaxPagingNavigator give out strange error

2010-10-13 Thread btbluesky

The problem is I was using Eclipse's maven plug (m2eclipse?!) to manage the
POM (I think it comes with WTP already). Its got the nice GUI, with the
checkbox options of "include javadocs" and "include Sources". I didn't add
it manually in the POM.

Well, very good to know that it doesn't work properly. Maybe I should submit
something in Eclipse bugtrack.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxPagingNavigator-give-out-strange-error-tp2327360p2993927.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Problem with IHeaderResponse.renderOnEventJavascript

2010-10-13 Thread Carlson Weber
Ok guys, it worked , I used the AttributeModifier. The thing is, why
there's is that renderOnEventJavascript? This should be a method
attached maybe to the domready event... Do you think that is worth
submiting a patch? Or this is the correct behavior? (IMHO this isn't
all right). Anyway, problem solved, thank you all!

2010/10/13 Michael O'Cleirigh :
>  Hello,
>
> You can use:
>
> textfield.add (new AttributeModifier ("onkeydown", true, "if
> (window.event.altKey){if (window.event.keyCode ==
> 80){document.getElementById('" + link.getMarkupId() +
> "').onclick();}}");
>
> If you do this within the Component.onInitialize() you will have the true
> markupid of the link available.
>
> If you wanted to get rid of the link altogether you could just attach an
> ajax event directly to the text field like:
>
> textfield.add (new AjaxEventBehavior ("onkeydown") {
>
>   �...@override
>    protected void onEvent(final AjaxRequestTarget target) {
>            // do your serverside logic
>    }
>
>   �...@override
>   protected CharSequence getPreconditionScript() {
>        // if this evaluates to true in the browser then the event will be
> executed.
>        return "return window.event.altKey && window.event.keyCode == 80;";
>    }
>
> }):
>
> This is untested but I think it should work,
>
> Regards,
>
> Mike
>
>> I searched all over the internet and it seems that no one uses this
>> method. The thing is that I am almost thinking that this is a bug,
>> because it's really not logic to me. What I am trying to do: I am
>> creating a panel that I will use in a lot of forms, and I want to
>> attach some javascript code to my onKeyDown HTML event of this
>> TextField, so my code looks like this:
>>
>>
>>
>> container.getHeaderResponse().renderOnEventJavascript("document.getElementById('"+txtCliente.getMarkupId()+"')",
>> "onKeyDown", "if (window.event.altKey){if (window.event.keyCode ==
>> 80){document.getElementById('" + link.getMarkupId() +
>> "').onclick();}}");
>>
>> It's basically this: When user press Ctrl+P while TextField focused,
>> it will click on a link, that is another component of my panel. When
>> it renders the Javascript there's a problem: It render on the HEAD
>> section of HTML, referencing the TextField with a variable (with a
>> random name), but BEFORE the TextField was rendered on the HTML. The
>> result of this is that Firefox and Chrome gives an error , saying that
>> the component doesn't exist, and, in fact it doesn't, because the DOM
>> still didn't load! So, probably I am doing this wrong, does anyone can
>> help me with that? And what's the reason of this function
>> renderOnEventJavascript if it renders on the head? It will always give
>> an error message saying the component is null, am I right? I am using
>> the latest release of 1.4 series. Thank you very much guys!
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: could not serialize the page java.lang.OutOfMemoryError: PermGen space

2010-10-13 Thread fachhoch

I got this error when running my app on   jetty and tomact  maven plugin.
and  I added 


-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m 

to JRE VM arguments in  Run configration   eclipse.

but I cannot start my Jetty  it complains

Error occurred during initialization of VM
Could not reserve enough space for object heap

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/could-not-serialize-the-page-java-lang-OutOfMemoryError-PermGen-space-tp2993745p2993810.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: could not serialize the page java.lang.OutOfMemoryError: PermGen space

2010-10-13 Thread Altuğ Bilgin Altıntaş
What is your application server or container ?

Is it a heavy object page ?

Every application can get java.lang.OutOfMemoryError: PermGen space
potentially

First countermeasure you can take is to increase your container's memory.

Altuğ


2010/10/13 fachhoch 

>
> could not serialize the pagejava.lang.OutOfMemoryError: PermGen space ,
>
> I got this error, it happens once in a while , its hard to reproduce,
> please tell me   can wicket cause memory errors  for any reason ?
> I am using 1.4.8
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/could-not-serialize-the-page-java-lang-OutOfMemoryError-PermGen-space-tp2993745p2993745.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: Feedback message does not show in new WebPage

2010-10-13 Thread Jeremy Thomerson
On Wed, Oct 13, 2010 at 4:35 AM, Ian Marshall wrote:

>
> Hello All,
>
> I have a link, which when clicked causes a new web page to be shown.
>
>
> HTML fragment
> --
> Pay
>
>
> Java fragment
> -
> Link lnkPay = new Link("lnkPay", new Model(""))
> {
>private static final long serialVersionUID = 1L;
>
>@Override
>public void onClick()
>{
>PageBuyOptions pgNext = new PageBuyOptions(...);
>setResponsePage(pgNext);
>}
> };
> lnkPay.setVisible(...);
> liItem.add(lnkPay);
>
>
> This new page has some validation code to ensure that the relevant status
> is
> such that the page can offer the next step to the user. Should the status
> have advanced (and so the link to get there is "stale" and should no longer
> be visible, but it is visible since it was rendered to the user before the
> status advanced) the new page (disables its "OK" button and) displays a
> feedback message to the user.
>
> HTML fragment
> --
> 
>
>
> Java fragment
> -
> FeedbackPanel fbpnlFeedbackPanel = new FeedbackPanel("fbpnlFeedbackPanel");
> add(fbpnlFeedbackPanel);
>
> public PageBuyOptions(String sItemEncodedKey)
> {
>super();
>
>if ([status has changed])
>{
>// MySession extends WebSession
>MySession ssnSession = (MySession)getSession();
>
>ssnSession.error("[Link is stale]");
>...
>}
>
>Form frmForm = new
> Form("frmForm")
>{
>...
>}
>
>...
> }
>
>
> This all works fine, and the feedback message shows as expected in the new
> page. But there are two use cases when the new page is shown without the
> expected feedback message: when the stale link is clicked using "Open Link
> in New Window" or "Open Link in New Tab".
>
> Is this non-appearance of a feedback message in these two cases expected
> Wicket behaviour? Am I missing something or doing something wrong? I would
> appreciate any tips.
>
> Ian Marshall
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Feedback-message-does-not-show-in-new-WebPage-tp2993413p2993413.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
>
>
Can you try putting this in your Application#init and see if it
works: getPageSettings().setAutomaticMultiWindowSupport(false);

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


Re: DownloadLink with AjaxIndicator

2010-10-13 Thread Altuğ Bilgin Altıntaş
my below example codes works on http://jquery.malsup.com/block/

//**
public class BlockerBehaviour {


@SuppressWarnings("unused")
private String componentId;

public BlockerBehaviour(String componentId) {
   this.componentId = componentId;
}

public String getJSBlock() {
String JS = " $(document).ready(function() {\n" +
"  $.blockUI({ message: '  "+ new
ResourceModel("please.wait").getObject()+"' });\n" +
"}) ;";

return JS;
}

 public String getJSUnBlock() {
String JS = " $(document).ready(function() {\n" +
"  $.unblockUI(); " +
"}) ;";

return JS;
}

}


//***

public abstract class MyAjaxIndicatorButton extends AjaxButton {
private static final long serialVersionUID = 1L;


public MyAjaxIndicatorButton (String id) {
super(id);
}


@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
private static final long serialVersionUID = 1L;

@Override
public CharSequence decorateOnFailureScript(CharSequence script)
{
return script + " " + new
BlockerBehaviour(getId()).getJSUnBlock();
}

@Override
public CharSequence decorateScript(CharSequence script) {

return script + " " + new
BlockerBehaviour(getId()).getJSBlock();
}

@Override
public CharSequence decorateOnSuccessScript(CharSequence script)
{
return script + " " + new
BlockerBehaviour(getId()).getJSUnBlock();
}
};
}  ;
}

2010/10/13 Ann Baert 

> I would like to add an ajaxindicator on a DownloadLink.
> How can I do this?
>
> But because DownloadLink isn't ajax, I tried the following:
>
> AjaxLink downloadLink = new AjaxLink("id") {
>
>@Override
>public void onClick(AjaxRequestTarget target) {
>
>}
> };
> downloadLink.add(new AjaxEventBehavior("onclick") {
>
>@Override
>public void onEvent(final AjaxRequestTarget target) {
>RequestCycle.get().setRequestTarget(new IRequestTarget() {
>
>public void detach(RequestCycle requestCycle) {
>}
>
>public Object getLock(RequestCycle requestCycle) {
>return null;
>}
>
>public void respond(RequestCycle requestCycle) {
>WebResponse r = (WebResponse) requestCycle.getResponse();
>r.setAttachmentHeader("header.ext");
>r.setContentType("application/contentype");
>
>...
>Streams.copy(bais, r.getOutputStream());
>
>target.appendJavascript("...");
>}
>});
>
>}
>
>@Override
>protected CharSequence getEventHandler() {
>AppendingStringBuffer handler = new AppendingStringBuffer();
>handler.append("...");
>handler.append(super.getEventHandler());
>return handler;
>}
> });
> add(downloadLink);
>
>
>
> Thanks
> Ann
>  DISCLAIMER 
>
> http://www.tvh.com/newen2/emaildisclaimer/default.html
>
> "This message is delivered to all addressees subject to the conditions
> set forth in the attached disclaimer, which is an integral part of this
> message."
>


RE: could not serialize the page java.lang.OutOfMemoryError: PermGen space

2010-10-13 Thread CREMONINI Daniele
It happens when the maximum amount of heap memory is reached.

The solution is to increase a dedicated virtual machine parameter to a higher 
value.
For example if you wish to increase to 256 megabytes use this:

-XX:MaxPermSize=256m

in your eclipse.ini file or in the right file of your application server.
If the problem should arise anyway you should consider to examine memory leaks 
in your application.

Let us know
Bye
Daniele Cremonini


-Original Message-
From: fachhoch [mailto:fachh...@gmail.com] 
Sent: 13 October 2010 16:25
To: users@wicket.apache.org
Subject: could not serialize the page java.lang.OutOfMemoryError: PermGen space


could not serialize the pagejava.lang.OutOfMemoryError: PermGen space , 

I got this error, it happens once in a while , its hard to reproduce, 
please tell me   can wicket cause memory errors  for any reason ?
I am using 1.4.8 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/could-not-serialize-the-page-java-lang-OutOfMemoryError-PermGen-space-tp2993745p2993745.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


__
This message has been scanned for viruses.

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



Re: DownloadLink with AjaxIndicator

2010-10-13 Thread MZemeck
AjaxIndicatorAppender?
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/extensions/ajax/markup/html/AjaxIndicatorAppender.html



From:   Ann Baert 
To: users@wicket.apache.org
Date:   10/13/2010 10:09 AM
Subject:DownloadLink with AjaxIndicator



I would like to add an ajaxindicator on a DownloadLink.
How can I do this?

But because DownloadLink isn't ajax, I tried the following:

AjaxLink downloadLink = new AjaxLink("id") {

@Override
public void onClick(AjaxRequestTarget target) {
 
}
};
downloadLink.add(new AjaxEventBehavior("onclick") {
 
@Override
public void onEvent(final AjaxRequestTarget target) {
RequestCycle.get().setRequestTarget(new IRequestTarget() {

public void detach(RequestCycle requestCycle) {
}

public Object getLock(RequestCycle requestCycle) {
return null;
}

public void respond(RequestCycle requestCycle) {
WebResponse r = (WebResponse) requestCycle.getResponse();
r.setAttachmentHeader("header.ext");
r.setContentType("application/contentype");

...
Streams.copy(bais, r.getOutputStream());
 
target.appendJavascript("...");
}
});
 
}

@Override
protected CharSequence getEventHandler() {
AppendingStringBuffer handler = new AppendingStringBuffer();
handler.append("...");
handler.append(super.getEventHandler());
return handler;
}
});
add(downloadLink);



Thanks
Ann
 DISCLAIMER 

http://www.tvh.com/newen2/emaildisclaimer/default.html 

"This message is delivered to all addressees subject to the conditions
set forth in the attached disclaimer, which is an integral part of this
message."





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.

could not serialize the page java.lang.OutOfMemoryError: PermGen space

2010-10-13 Thread fachhoch

could not serialize the pagejava.lang.OutOfMemoryError: PermGen space , 

I got this error, it happens once in a while , its hard to reproduce, 
please tell me   can wicket cause memory errors  for any reason ?
I am using 1.4.8 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/could-not-serialize-the-page-java-lang-OutOfMemoryError-PermGen-space-tp2993745p2993745.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: AjaxRequestTarget not refreshing Component

2010-10-13 Thread Jeremy Thomerson
What does the Wicket AJAX debug window say in that response?

Jeremy Thomerson
http://wickettraining.com
-- sent from my "smart" phone, so please excuse spelling, formatting, or
compiler errors

On Oct 13, 2010 12:20 AM, "LutherBaker"  wrote:


I have created an outer list of areaGroups such that each group item
contains
a list of areas.

I am displaying a ModalWindow and editing an area. After changing the area's
name, I submit it via an AjaxSubmitButton which initially added the ListView
associated with a particular group. Obviously that failed (can't add a
repeater to an AjaxTargetRequest) at which point I added a
WebMarkupContainer to the markup.

   
[group name]


   Edit
[item name]
[item summary]


   

I feed this inner ListView with a LodableDetachableModel where I
fetchAreasByAreaGroup:

   @Override
   protected List load() {
   return dataService.fetchAreasByAreaGroup(areaGroup);
   }

I also created a WebMarkupContainer in code and set its outputMarkupId:

   final WebMarkupContainer itemListContainer = new
WebMarkupContainer("item.list.container");
   itemListContainer.setOutputMarkupId(true);

I store the markup container in a hashmap keyed by AreaGroup which allows me
to, from the ModalWindow, retrieve the markup container associated with the
edited area's AreaGroup. Which I then add to the AjaxRequestTarget in the
ModalWindow's form's AjaxButton.onSubmit handler:

   final WebMarkupContainer container =
areaPage.getWebMarkupContainer(area.getAreaGroup());
   target.addComponent(container);

So all is well. It all compiles and the page loads without error. So, again,
I pop the ModalWindow up, change the name and put a breakpoint in the code.
I can see the AjaxRequestTarget add the container. I can see that the
container is not null. I can see the dataService retrieve the new area. I
can see the code execute which populates the inner ListView I mentioned
earlier - with the updated area properties.

But, after the ModalWindow goes away, the underlying screen representation
doesn't change. The old name is still displayed.

Here is a snippet of the generated markup where you can see
"item_list_container53" which identifies the wicket:container that I wish to
repaint.

   
Work


   Edit
Hammerhead
Day job learning large
scale infrastructure skills


   
Business Ventures


   Edit
Fuzzy Bearings
Software Development
Effort


   


Any thoughts on what I am missing?

Thanks in advance,
-Luther

PS: Please note that nabble will not accept posts with 'onclick' text in the
code snippet 'a' tags ... so I specifically edited "onClick" to simply be
"click" in the code snippets.
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/AjaxRequestTarget-not-refreshing-Component-tp2993093p2993093.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: WebPage: geting string

2010-10-13 Thread Martin Makundi
Here:


/**
   * Renders given page
   * @param pageClass to render
   * @param pageParameters to render with
   * @param clean
   * @return String of HTML produced
   */
  public static String renderPageToString(
  final Class pageClass,
  final PageParameters pageParameters, boolean clean) {
String webPageAsString;
{
  WebApplication webApplication = WebApplication.get();
  ServletContext servletContext = webApplication.getServletContext();
  MockHttpSession servletSession = new MockHttpSession(servletContext);
  servletSession.setTemporary(true);

  MockHttpServletRequest servletRequest = new MockHttpServletRequest(
  webApplication, servletSession, servletContext);
  MockHttpServletResponse servletResponse = new MockHttpServletResponse(
  servletRequest);
  servletRequest.initialize();
  servletResponse.initialize();

  WebRequest webRequest = new ServletWebRequest(servletRequest);

  BufferedWebResponse webResponse = new
BufferedWebResponse(servletResponse);
  webResponse.setAjax(true);

  WebRequestCycle htmlRequestCycle =
new WebRequestCycle(webApplication, webRequest, webResponse);

  BookmarkablePageRequestTarget htmlTarget =
new BookmarkablePageRequestTarget(pageClass, pageParameters);

  htmlRequestCycle.setRequestTarget(htmlTarget);

  try {
htmlRequestCycle.getProcessor().respond(htmlRequestCycle);

if (htmlRequestCycle.wasHandled() == false) {
  htmlRequestCycle.setRequestTarget(new WebErrorCodeResponseTarget(
  HttpServletResponse.SC_NOT_FOUND));
}
htmlRequestCycle.detach();
  } finally {
htmlRequestCycle.getResponse().close();
  }

  webPageAsString = webResponse.toString();
}

//try {
//  FileOutputStream fileOutputStream = new
FileOutputStream("c:/temp/test.html", false);
//  OutputStreamWriter o = new OutputStreamWriter(fileOutputStream, "UTF8");
//  o.write(webResponse.toString());
//  o.flush();
//  o.close();
//} catch (Exception e) {
//  throw new IllegalStateException("Bug", e);
//}

webPageAsString = Utils.replaceAll(webPageAsString,
WebPageConstants.SRC_URL_PATTERN, "src=\"file:///" +
WebApplication.get().getServletContext().getRealPath("/") + "/");

if (clean) {
  return escapeHighEnd(webPageAsString.replaceAll("", "")
  .replaceAll("", "").replaceAll("\\swicketpath=\".*?\"",
  ""));
}

return escapeHighEnd(webPageAsString);
  }


**
Martin

2010/10/13 msantos :
>
> Hi there.
>
> Is possible instanciate a WebPage component and the getting the string that
> represents that webpage? My intention is to create a method that returns a
> string representing a html page to use on a email.
>
> Thanks a lot
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/WebPage-geting-string-tp2993717p2993717.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
>
>

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



DownloadLink with AjaxIndicator

2010-10-13 Thread Ann Baert
I would like to add an ajaxindicator on a DownloadLink.
How can I do this?

But because DownloadLink isn't ajax, I tried the following:

AjaxLink downloadLink = new AjaxLink("id") {

@Override
public void onClick(AjaxRequestTarget target) {
 
}
};
downloadLink.add(new AjaxEventBehavior("onclick") {
 
@Override
public void onEvent(final AjaxRequestTarget target) {
RequestCycle.get().setRequestTarget(new IRequestTarget() {

public void detach(RequestCycle requestCycle) {
}

public Object getLock(RequestCycle requestCycle) {
return null;
}

public void respond(RequestCycle requestCycle) {
WebResponse r = (WebResponse) requestCycle.getResponse();
r.setAttachmentHeader("header.ext");
r.setContentType("application/contentype");

...
Streams.copy(bais, r.getOutputStream());
 
target.appendJavascript("...");
}
});
 
}

@Override
protected CharSequence getEventHandler() {
AppendingStringBuffer handler = new AppendingStringBuffer();
handler.append("...");
handler.append(super.getEventHandler());
return handler;
}
});
add(downloadLink);



Thanks
Ann
 DISCLAIMER 

http://www.tvh.com/newen2/emaildisclaimer/default.html 

"This message is delivered to all addressees subject to the conditions
set forth in the attached disclaimer, which is an integral part of this
message."


WebPage: geting string

2010-10-13 Thread msantos

Hi there.

Is possible instanciate a WebPage component and the getting the string that
represents that webpage? My intention is to create a method that returns a
string representing a html page to use on a email.

Thanks a lot
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WebPage-geting-string-tp2993717p2993717.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Problem with IHeaderResponse.renderOnEventJavascript

2010-10-13 Thread Michael O'Cleirigh

 Hello,

You can use:

textfield.add (new AttributeModifier ("onkeydown", true, "if 
(window.event.altKey){if (window.event.keyCode ==

80){document.getElementById('" + link.getMarkupId() +
"').onclick();}}");

If you do this within the Component.onInitialize() you will have the 
true markupid of the link available.


If you wanted to get rid of the link altogether you could just attach an 
ajax event directly to the text field like:


textfield.add (new AjaxEventBehavior ("onkeydown") {

@Override
protected void onEvent(final AjaxRequestTarget target) {
// do your serverside logic
}

@Override
   protected CharSequence getPreconditionScript() {
// if this evaluates to true in the browser then the event will 
be executed.

return "return window.event.altKey && window.event.keyCode == 80;";
}

}):

This is untested but I think it should work,

Regards,

Mike


I searched all over the internet and it seems that no one uses this
method. The thing is that I am almost thinking that this is a bug,
because it's really not logic to me. What I am trying to do: I am
creating a panel that I will use in a lot of forms, and I want to
attach some javascript code to my onKeyDown HTML event of this
TextField, so my code looks like this:


container.getHeaderResponse().renderOnEventJavascript("document.getElementById('"+txtCliente.getMarkupId()+"')",
"onKeyDown", "if (window.event.altKey){if (window.event.keyCode ==
80){document.getElementById('" + link.getMarkupId() +
"').onclick();}}");

It's basically this: When user press Ctrl+P while TextField focused,
it will click on a link, that is another component of my panel. When
it renders the Javascript there's a problem: It render on the HEAD
section of HTML, referencing the TextField with a variable (with a
random name), but BEFORE the TextField was rendered on the HTML. The
result of this is that Firefox and Chrome gives an error , saying that
the component doesn't exist, and, in fact it doesn't, because the DOM
still didn't load! So, probably I am doing this wrong, does anyone can
help me with that? And what's the reason of this function
renderOnEventJavascript if it renders on the head? It will always give
an error message saying the component is null, am I right? I am using
the latest release of 1.4 series. Thank you very much guys!

-
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: Problem with IHeaderResponse.renderOnEventJavascript

2010-10-13 Thread Martin Grigorov
Hi,

Indeed it looks this method works only when the target element is already
available.
It is used by
org.apache.wicket.markup.html.internal.HeaderResponse.renderOnDomReadyJavascript(String)
and
org.apache.wicket.markup.html.internal.HeaderResponse.renderOnLoadJavascript(String)
but both of them use 'window' as target and it is always available.

To solve your problem you can use renderOnDomReadyJavascript(String) with
parameter: "Wicket.Event.add(Wicket.$("+theId+", 'keydown', function(event)
{...}))

On Wed, Oct 13, 2010 at 3:13 PM, Carlson Weber wrote:

> I searched all over the internet and it seems that no one uses this
> method. The thing is that I am almost thinking that this is a bug,
> because it's really not logic to me. What I am trying to do: I am
> creating a panel that I will use in a lot of forms, and I want to
> attach some javascript code to my onKeyDown HTML event of this
> TextField, so my code looks like this:
>
>
>
> container.getHeaderResponse().renderOnEventJavascript("document.getElementById('"+txtCliente.getMarkupId()+"')",
> "onKeyDown", "if (window.event.altKey){if (window.event.keyCode ==
> 80){document.getElementById('" + link.getMarkupId() +
> "').onclick();}}");
>
> It's basically this: When user press Ctrl+P while TextField focused,
> it will click on a link, that is another component of my panel. When
> it renders the Javascript there's a problem: It render on the HEAD
> section of HTML, referencing the TextField with a variable (with a
> random name), but BEFORE the TextField was rendered on the HTML. The
> result of this is that Firefox and Chrome gives an error , saying that
> the component doesn't exist, and, in fact it doesn't, because the DOM
> still didn't load! So, probably I am doing this wrong, does anyone can
> help me with that? And what's the reason of this function
> renderOnEventJavascript if it renders on the head? It will always give
> an error message saying the component is null, am I right? I am using
> the latest release of 1.4 series. Thank you very much guys!
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Problem with IHeaderResponse.renderOnEventJavascript

2010-10-13 Thread Carlson Weber
I searched all over the internet and it seems that no one uses this
method. The thing is that I am almost thinking that this is a bug,
because it's really not logic to me. What I am trying to do: I am
creating a panel that I will use in a lot of forms, and I want to
attach some javascript code to my onKeyDown HTML event of this
TextField, so my code looks like this:


container.getHeaderResponse().renderOnEventJavascript("document.getElementById('"+txtCliente.getMarkupId()+"')",
"onKeyDown", "if (window.event.altKey){if (window.event.keyCode ==
80){document.getElementById('" + link.getMarkupId() +
"').onclick();}}");

It's basically this: When user press Ctrl+P while TextField focused,
it will click on a link, that is another component of my panel. When
it renders the Javascript there's a problem: It render on the HEAD
section of HTML, referencing the TextField with a variable (with a
random name), but BEFORE the TextField was rendered on the HTML. The
result of this is that Firefox and Chrome gives an error , saying that
the component doesn't exist, and, in fact it doesn't, because the DOM
still didn't load! So, probably I am doing this wrong, does anyone can
help me with that? And what's the reason of this function
renderOnEventJavascript if it renders on the head? It will always give
an error message saying the component is null, am I right? I am using
the latest release of 1.4 series. Thank you very much guys!

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



condition in AbstractAjaxTimerBehavior

2010-10-13 Thread Maris Orbidans
Hi

I need to periodically update a page unless some condition is met.
I wrote javascript function canRefresh() and added like this:

add(new AbstractAjaxTimerBehavior(Duration.seconds(5)) {
  @Override
  protected void onTimer(final AjaxRequestTarget target) {
updateSessionConfigPanel(target);
   }

   @Override
protected CharSequence getCallbackScript() {
  return "if (!canRefresh()) {"+ super.getCallbackScript()+"};";
  }
 });

This is generated javascript.

]]>*/

The problem is that once canRefresh() returns false timer stops. Is it
possible to restart it?  Or a better way to implement conditional
update?


Maris

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



Feedback message does not show in new WebPage

2010-10-13 Thread Ian Marshall

Hello All,

I have a link, which when clicked causes a new web page to be shown.


HTML fragment
--
Pay


Java fragment
-
Link lnkPay = new Link("lnkPay", new Model(""))
{
private static final long serialVersionUID = 1L;

@Override
public void onClick()
{
PageBuyOptions pgNext = new PageBuyOptions(...);
setResponsePage(pgNext);
}
};
lnkPay.setVisible(...);
liItem.add(lnkPay);


This new page has some validation code to ensure that the relevant status is
such that the page can offer the next step to the user. Should the status
have advanced (and so the link to get there is "stale" and should no longer
be visible, but it is visible since it was rendered to the user before the
status advanced) the new page (disables its "OK" button and) displays a
feedback message to the user.

HTML fragment
--



Java fragment
-
FeedbackPanel fbpnlFeedbackPanel = new FeedbackPanel("fbpnlFeedbackPanel");
add(fbpnlFeedbackPanel);

public PageBuyOptions(String sItemEncodedKey)
{
super();

if ([status has changed])
{
// MySession extends WebSession
MySession ssnSession = (MySession)getSession();

ssnSession.error("[Link is stale]");
...
}

Form frmForm = new 
Form("frmForm")
{
...
}

...
}


This all works fine, and the feedback message shows as expected in the new
page. But there are two use cases when the new page is shown without the
expected feedback message: when the stale link is clicked using "Open Link
in New Window" or "Open Link in New Tab".

Is this non-appearance of a feedback message in these two cases expected
Wicket behaviour? Am I missing something or doing something wrong? I would
appreciate any tips.

Ian Marshall
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Feedback-message-does-not-show-in-new-WebPage-tp2993413p2993413.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: wicket 1.5, resource gives error in log?

2010-10-13 Thread Romeo Sheshi
hi
i have make a test and i have the error only when the src url is relative.

http://localhost:8080/test/wicket/bookmarkable/it.test.HomePage
if i have
 
i don't have the error i have the error if i put a relativ url

or

because wicket http://localhost:8080/test/wicket/bookmarkable/ + relative
url and don't find it
so you have the error
ERROR [org.apache.wicket.request.cycle.RequestCycle]  - Unable to execute
request. No suitable RequestHandler found.
URL=images/icons/arrow_down_end.png

Romeo Sheshi


2010/10/12 nino martinez wael 

> done -- https://issues.apache.org/jira/browse/WICKET-3103
>
> 2010/10/12 Igor Vaynberg 
>
> > no, that shouldnt be there. file a bug please.
> >
> > -igor
> >
> > On Tue, Oct 12, 2010 at 3:49 AM, nino martinez wael
> >  wrote:
> > > Hi
> > >
> > > I have something where I reference an image directly in html, wicket
> has
> > no
> > > idea what it should do with it so it passes the request to the servlet
> > > container.. And it works as I wanted, but should it give an error
> > message?
> > > Or am I doing something wrong?
> > >
> > > html:
> > >  
> > >
> > > Log:
> > > ERROR [org.apache.wicket.request.cycle.RequestCycle]  - Unable to
> execute
> > > request. No suitable RequestHandler found.
> > > URL=images/icons/arrow_down_end.png
> > >
> > > regards Nino
> > >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>


Re: Help with custom component that implements IOnChangeListener

2010-10-13 Thread Rut Bastoni
I've found the mistake: the TextField must override getStatelessHint() this 
way:


@Override
protected boolean getStatelessHint()
{
   return false;
}

now it works.
--
From: "Rut Bastoni" 
Sent: Thursday, October 07, 2010 4:08 PM
To: 
Subject: Help with custom component that implements IOnChangeListener


Hi everyone,
i'm trying to implement a  custom TextField that fires "onchange" event
without using Ajax (it is a requirement of my project - i have good 
reasons

not to use Ajax).

Looking at the source files of DropDownChoice, CheckBox etc. (they all
implement the "wantOnSelectionChangedNotifications()" mechanism) i created 
a

class:

class OnChangeTextField extends TextField implements 
IOnChangeListener

{

   // . my stuff

   @Override
   public void onSelectionChanged()
   {
   updateModel();
   onSelectionChanged(getModelObject());
   }

   protected void onSelectionChanged(final Object newSelection)
{
   System.out.println("Event fired");
}

   /**
* Processes the component tag - This is like DropDownChoice and other
default FormComponents di
*/
   @Override
   protected void onComponentTag(final ComponentTag tag)
   {
   // url that points to this components IOnChangeListener method
   CharSequence url = urlFor(IOnChangeListener.INTERFACE);

   Form form = findParent(Form.class);
   if (form != null)
   {
   tag.put("onchange", form.getJsForInterfaceUrl(url));
   }
   super.onComponentTag(tag);
   }

but that doesn't work. When i type into my textfield, i get an error page
saying:

WicketMessage: Attempt to access unknown request listener interface
IRedirectListener

Root cause:

org.apache.wicket.WicketRuntimeException: Attempt to access unknown 
request

listener interface IRedirectListener
at org.apache.wicket.markup.html.form.Form.dispatchEvent(Form.java:1320)
at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:870)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:182)
at
org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(ListenerInterfaceRequestTarget.java:73)

 etc. etc.

I looked into the sources, in particular Form.java, it seems like the url 
of

my listener (obtained by "urlFor(IOnChangeListener.INTERFACE)") is wrong,
because this is the value that get stored in the hidden fild of the form,
and when the form dispatches events, it does not cause the correct
IListenerInterfaceRequestTarget be created.

I wonder, why does this mechanism work on DropDownChoice and others, and 
not

on my component?
Is this a bug? Or am I doing some mistake?

Thanks a Lot

Rut Bastoni


-
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