Re: Text after input field

2011-02-22 Thread MattyDE

Thanks a lot! Works like a charm and ashames me
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Text-after-input-field-tp3317381p3318801.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 access component values within a dynamic table?

2011-02-22 Thread hrbaer

Sorry, but I just don't get this :(
I'm totally missing the forest through the trees...so I tried to reduce the
example to the very minimum. Maybe someone can provide me an idea how to
deal with my issue?!

This is the scenario: 
I have a form with two rows. Within each row there is one label and one
inputfield. The inputfield get's provided by a Panel. If I submit the form
there is only one entry within getModelObject(). The key is (of course) the
wicket:id of the input field and the value is the value of the second input
field.

How can I achieve that I get both value's??

My Java file (Test.java)
public class Test extends WebPage {

public Test() {
add( new TestForm( TestForm ) );
}

@SuppressWarnings(serial)
public final class TestForm extends FormValueMap {

public TestForm( final String id ) {

super( id, new CompoundPropertyModelValueMap( new ValueMap() )
);
setMarkupId( id );

ArrayListString list = new ArrayListString();
list.add( Frage 1 );
list.add( Frage 2 );
add( new ListViewString( ListFragen, list ) {

protected void populateItem( ListItemString item 
) {

item.add( new Label( Frage, 
item.getModelObject() ) );
item.add( new Input_Panel( Input ) );

}
});

}

public final void onSubmit() {
ValueMap valueMap = getModelObject();
// within valueMap the only key is PanelInput with the value 
of
the second input field!!
}

}
}

the corresponding markup (Test.html)
form wicket:id=TestForm

table class=inhalt width=100% border=0
tr wicket:id=ListFragen
td colspan=2 span wicket:id=FragePlatzhalter /span/td
td colspan=2 span wicket:id=InputPlatzhalter /span/td
/tr
tr
td colspan=2nbsp;/td
td colspan=2
input type=submit value=Speichern
input type=reset value=Abbrechen
/td
/tr
/table

/form

My Panel (Input_Panel.java)
public class Input_Panel extends Panel {
public Input_Panel( String id ) {
super(id);
add ( new TextFieldString( PanelInput ) );
}
}

the corresponding markup (Input_Panel.html)
wicket:panel
input wicket:id=PanelInput type=text size=30 maxlength=30
/wicket:panel
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-access-component-values-within-a-dynamic-table-tp3310939p3318845.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



Problem get selected value using dynamic select with optgroup

2011-02-22 Thread rawe

I'm using the select component due to realizing a dynamic optgroup and option
list.
It works rather fine but my problem is to get the selected value.
I tried to use an ajax behavior (AjaxComponentUpdatingBehavior,
OnChangeBehavior) but the onUpdate methode is never called -- doesn't work!

Maybe there is a solution for my problem!? What I'm doing wrong?

My code:


Select select = new Select(selectId);
select.add(new ListView(optGroups, myList) {

@Override
protected void populateItem(ListItem item) {
MyBean myBean = (MyBean) item.getModelObject();
item.add(new OptGroup(optGroup, myBean.getName(), myBean.getList()));
}
});

add(select);


class OptGroup extends SelectOption {

String label;

ListMyBean2 list;

public OptGroup(String id, String label, ListMyBean2 list) {
super(id);
this.label = label;
this.list = list;
init();
}

@SuppressWarnings(unchecked)
private void init() {
this.add(new ListView(grpOptions, list) {

@Override
protected void populateItem(ListItem item) {
MyBean2 myBean2 = (MyBean2) item.getModelObject();
item.add(new CustomSelectOption(grpOption, 
myBean2.getName()));
}

});
}

protected void onComponentTag(final ComponentTag tag) {
 checkComponentTag(tag, optgroup);
Select select = (Select) findParent(Select.class);
if (select == null) {
throw new WicketRuntimeException(
OptGroup component [
+ getPath()
+ ] cannot 
find its parent Select. All OptGroup components must be
a child of or below in the hierarchy of a Select component.);
}

tag.put(label, label);
}
}

public class CustomSelectOption extends SelectOption {
@SuppressWarnings(unchecked)
public CustomSelectOption(String id, String displayValue) {
super(id, new Model(displayValue));
}

protected void onComponentTagBody(final MarkupStream markupStream, final
ComponentTag openTag) {
replaceComponentTagBody(markupStream, openTag,
getDefaultModelObjectAsString());
}
}




I tried this, but it doesn't work:


select.add(new AjaxFormComponentUpdatingBehavior(onchange) {
protected void onUpdate(AjaxRequestTarget target) {
System.out.println(Update ajax);
// @todo updating model
}
});

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-get-selected-value-using-dynamic-select-with-optgroup-tp3318883p3318883.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 get selected value using dynamic select with optgroup

2011-02-22 Thread Mike Mander

A shot in the dark.

Is the behavior required at the select? Or is the option getting the 
onchange event?


Cheers
Mike

I'm using the select component due to realizing a dynamic optgroup and option
list.
It works rather fine but my problem is to get the selected value.
I tried to use an ajax behavior (AjaxComponentUpdatingBehavior,
OnChangeBehavior) but the onUpdate methode is never called --  doesn't work!

Maybe there is a solution for my problem!? What I'm doing wrong?

My code:


Select select = new Select(selectId);
select.add(new ListView(optGroups, myList) {

@Override
protected void populateItem(ListItem item) {
MyBean myBean = (MyBean) item.getModelObject();
item.add(new OptGroup(optGroup, myBean.getName(), myBean.getList()));
}
});

add(select);


class OptGroup extends SelectOption {

String label;

ListMyBean2  list;

public OptGroup(String id, String label, ListMyBean2  list) {
super(id);
this.label = label;
this.list = list;
init();
}

@SuppressWarnings(unchecked)
private void init() {
this.add(new ListView(grpOptions, list) {

@Override
protected void populateItem(ListItem item) {
MyBean2 myBean2 = (MyBean2) item.getModelObject();
item.add(new CustomSelectOption(grpOption, 
myBean2.getName()));
}

});
}

protected void onComponentTag(final ComponentTag tag) {
 checkComponentTag(tag, optgroup);
Select select = (Select) findParent(Select.class);
if (select == null) {
throw new WicketRuntimeException(
OptGroup component [
+ getPath()
+ ] cannot 
find its parent Select. All OptGroup components must be
a child of or below in the hierarchy of a Select component.);
}

tag.put(label, label);
}
}

public class CustomSelectOption extends SelectOption {
@SuppressWarnings(unchecked)
public CustomSelectOption(String id, String displayValue) {
super(id, new Model(displayValue));
}

protected void onComponentTagBody(final MarkupStream markupStream, final
ComponentTag openTag) {
replaceComponentTagBody(markupStream, openTag,
getDefaultModelObjectAsString());
}
}




I tried this, but it doesn't work:


select.add(new AjaxFormComponentUpdatingBehavior(onchange) {
protected void onUpdate(AjaxRequestTarget target) {
System.out.println(Update ajax);
 // @todo updating model
}
});




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



Re: requestCycle.getRequestTarget() not giving the target

2011-02-22 Thread Tejash Tarun
Hi,

haven't got any reply, added some more details.

6) Now click on 2nd tab, then only a refresh of page happens and the clicked
tab is not shown.


On Mon, Feb 21, 2011 at 2:42 PM, Tejash Tarun ttej...@educator.eu wrote:

 Hi,

 I have this scenario:
 1) AjaxTabbePanel has three tabs.
 2) Go to 2nd tab
 3) Come back to 1st tab
 4) one link in 1st tab will take us to some page
 5) Click back button of the browser = we will come back to the page with
 the AjaxTabbedPanel#1st tab
 6) Now click on 2nd tab, then only a refresh of page happens and the
 clicked tab is not shown.

 AbstractRequestCycleProcessor#processEvents(requestCycle) doesn't get a
 call,
 instead RedirectPageRequestTarget#processEvents(requestCycle) gets the
 call.
 This happens all the time barring a few time when it greets me with
 following stack trace:

 java.lang.IllegalStateException: No Page found for component
 [MarkupContainer [Component id = link]]

  at org.apache.wicket.Component.getPage(Component.java:1819)

  at
 org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:284)

  at
 org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:119)

  at
 org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)

  at
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)

  at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
 ...


 Can anybody tell what and where is going wrong ??


 Thanks in advance,
 Tejash





Re: how to access component values within a dynamic table?

2011-02-22 Thread Hans Lesmeister 2

Not tested, but this is the way it should work (more or less...)


public class MyBean {
  String question;
  String answer;
  // plus Getters and Setters...
}

public class Test extends WebPage {

  public Test() {
add( new TestForm( TestForm ) );
  }

  @SuppressWarnings(serial)
  public final class TestForm extends FormMyBean {

public TestForm( final String id ) {
  super(id);

  final ArrayListMyBean list = new ArrayListMyBean();
  list.add(new MyBean(Frage 1);
  list.add(new MyBean(Frage 2);

  add( new ListViewMyBean( ListFragen, list ) {
 protected void populateItem(ListItemMyBean item) {
   item.add(new Label(Frage, new PropertyModel(item.getModel(),
question));
   item.add(new Input_Panel(Input, new PropertyModel(item.getModel(),
answer)));
 }
  });

  public final void onSubmit() {
for (MyBean bean : list) {
  log.debug(bean);  // See what the user entered
}
  }
}
  }
}




-
-- 

Regards,

Hans


http://www.cantaa.de http://cantaa.de 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-access-component-values-within-a-dynamic-table-tp3310939p3318961.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: requestCycle.getRequestTarget() not giving the target

2011-02-22 Thread leoerlandsson

Hi,

We've seen this problem aswell (unfortunately, I have no solution for
you...).

The problem is probably that Wicket does not yet have Ajax Back Button
Support. When an Ajax call is made, the URL is not changed, so the Browser
cannot know that something (i.e State on server) has changed.

When you click back you come back to the URL used for the _first_ page
version... That's why you get:

java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = link]] 

I don't know how to fix this, but maybe someone elso knows? Perhaps we need
Ajax Back Button Support (I know there's a JIRA Issue for it..)


I have this scenario:
1) AjaxTabbePanel has three tabs.
2) Go to 2nd tab
3) Come back to 1st tab
4) one link in 1st tab will take us to some page
5) Click back button of the browser = we wil come back to the page with
the
AjaxTabbedPanel#1st tab
6) Now click on 2nd tab, then 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/requestCycle-getRequestTarget-not-giving-the-target-tp3317022p3318972.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 access component values within a dynamic table?

2011-02-22 Thread hrbaer

Hi Hans, this is working!!
Thanks you very much.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-access-component-values-within-a-dynamic-table-tp3310939p3319092.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



ResourceReference.getResource() returns NULL ?

2011-02-22 Thread smallufo
I want to build a DynamicImageResource which can scale internal (packaged)
images (with name : {index}.gif ) .
In getImageData() , I try to load a truly existing image , but cannot
getResource() , it returns null !

Here is my code :

public class ScaledImageResource extends DynamicImageResource
{
  private ThreadLocalInteger index = new ThreadLocalInteger();
  private ThreadLocalInteger width = new ThreadLocalInteger();
  private ThreadLocalInteger height = new ThreadLocalInteger();

  @Override
  public IResourceStream getResourceStream()
  {
ValueMap map = getParameters();
index .set(map.getAsInteger(index ,  1));
width .set(map.getAsInteger(width , 50));
height.set(map.getAsInteger(height, 50));
return super.getResourceStream();
  }

  @Override
  protected byte[] getImageData()
  {
ResourceReference imageResource = new ResourceReference(MyPage.class ,
icons/byIndex/+index.get()+.gif);
http://foobar.com/app/resources/foo.bar.MyPage/icons/byIndex/1.gif does
exist !

try
{
  System.out.println(imageResource.getResource() =  +
imageResource.getResource()); // returns NULL
  InputStream is =
imageResource.getResource().getResourceStream().getInputStream();
  BufferedImage bufferedImage = ImageIO.read(is);
  BufferedImage scaledImage = BufferedImageTools.getImage(bufferedImage,
width.get() , height.get());

  byte[] bytes = null;
  //scale image , build bytes  , skipped here.
  return bytes;
}
catch (Exception e)
{
}
return null;
  }
}

And in Application's init():
getSharedResources().add(IMG_KEY, new ScaledImageResource());
mountSharedResource(/scaledImage, new
ResourceReference(IMG_KEY).getSharedResourceKey());

Note , the image file does exist there ,
and http://foobar.com/app/resources/foo.bar.MyPage/icons/byIndex/1.gif does
browsable !

But why cannot I getResource() of the imageResource ?


Re: Erase Previous Error Messages in Feedback Panel after Download

2011-02-22 Thread eugenebalt

Gabriel, I got that part to work. But I also need to update the red border
around the problem fields. 

This was working automatically before with the validators firing on
onSubmit(), and it's broken now. Now, I need to manually highlight the error
fields. Any ideas how to do that?

I can do target.addComponent(..) manually for every component, but not all
of my components are Ajax-able (not all support setOutputMarkupId(true)
which is required for Ajax). That's because some of them have their own
JavaScript defined.


-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Erase-Previous-Error-Messages-in-Feedback-Panel-after-Download-tp3311648p3319342.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



[OT] Wicketeers from Czech rep.

2011-02-22 Thread danisevsky
Hi fans of Wicket!

Is there somebody from Czech rep? I'm thinking about organizing an event.

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



TextField with error css and errorMessage

2011-02-22 Thread Giovanni Cuccu

Hi,
I've written a TextField component that starts (by subclassing) 
from TextField and when the component is not valid it adds a custom css 
and it appends the error description near the field.
The goal was to create a replacement for TextField leaving the html as 
it was before the subclassed TextField usage (i.e. the only required 
change is the the class name in the java code)
I've implementend the component with two behaviours and the core lies in 
the onBeforeRender method.
I'm wondering if there are better approaches to achive the result; here 
is the method implementation:

@Override
public void onBeforeRender() {
if (!isValid()) {
add(cssErrorAppender);
add(errorMessageBehaviour);
final String error;
String preMessage=prefix + + errorDescriptionTag + 
class=\+ errorDescriptionClass + \;

String postMessage=/+ errorDescriptionTag + ;
if (hasFeedbackMessage()) {
error = preMessage 
+getFeedbackMessage().getMessage().toString()+ postMessage;

} else {
error = preMessage +getString(input.invalid) +  
postMessage;

}
errorMessageBehaviour.setErrorDescription(error);
addedBehaviour=true;
} else {
if (addedBehaviour) {
remove(cssErrorAppender);
remove(errorMessageBehaviour);
addedBehaviour=false;
}
}
super.onBeforeRender();
}

here is the declaration of behaviour

private AttributeAppender cssErrorAppender=new 
AttributeAppender(class, new ModelString(errorClass),  );
private ErrorMessageBehaviour errorMessageBehaviour=new 
ErrorMessageBehaviour();


Thanks,
   Giovanni

--
Giovanni Cuccu
Responsabile area sviluppo - CUP 2000 Spa
Via del Borgo di S. Pietro, 90/c - 40126 Bologna
e-mail: giovanni.cuccu _at_ cup2000.it


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



Re: requestCycle.getRequestTarget() not giving the target

2011-02-22 Thread MZemeck
This is the best solution I have found...
http://www.richardnichols.net/2010/03/apache-wicket-force-page-reload-to-fix-ajax-back/

Note that when refreshing the page it will return to its default state 
(first tab selected).  I have been meaning to test with 
HybridUrlCodingStrategy to see if the page can maintain its state without 
crashing after using the back button...




From:   leoerlandsson leo.erlands...@tyringe.com
To: users@wicket.apache.org
Date:   02/22/2011 06:22 AM
Subject:Re: requestCycle.getRequestTarget() not giving the target




Hi,

We've seen this problem aswell (unfortunately, I have no solution for
you...).

The problem is probably that Wicket does not yet have Ajax Back Button
Support. When an Ajax call is made, the URL is not changed, so the Browser
cannot know that something (i.e State on server) has changed.

When you click back you come back to the URL used for the _first_ page
version... That's why you get:

java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = link]] 

I don't know how to fix this, but maybe someone elso knows? Perhaps we 
need
Ajax Back Button Support (I know there's a JIRA Issue for it..)


I have this scenario:
1) AjaxTabbePanel has three tabs.
2) Go to 2nd tab
3) Come back to 1st tab
4) one link in 1st tab will take us to some page
5) Click back button of the browser = we wil come back to the page with
the
AjaxTabbedPanel#1st tab
6) Now click on 2nd tab, then 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/requestCycle-getRequestTarget-not-giving-the-target-tp3317022p3318972.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






Notice: This communication, including any attachments, is intended solely 
for the use of the individual or entity to which it is addressed. This 
communication may contain information that is protected from disclosure 
under State and/or Federal law. Please notify the sender immediately if 
you have received this communication in error and delete this email from 
your system. If you are not the intended recipient, you are requested not 
to disclose, copy, distribute or take any action in reliance on the 
contents of this information.

Re: Erase Previous Error Messages in Feedback Panel after Download

2011-02-22 Thread Gabriel Landon

You can rerefresh the whole form :

yourForm.setOutputMarkupId(true);
...
target.addComponent(yourForm)


To highlight the error field (with a red star), I usually use a
FormComponentFeedbackIndicator like that :

RequiredTextFieldString yourTextField = new
RequiredTextFieldString(name);
yourForm.add(yourTextField);
FormComponentFeedbackIndicator yourTextFieldError = new
FormComponentFeedbackIndicator(nameError);
yourTextFieldError.setIndicatorFor(yourTextField );
yourTextFieldError.setOutputMarkupPlaceholderTag(true);
yourForm.add(nomError);

You may also use FormComponentFeedbackBorder.

Gabriel.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Erase-Previous-Error-Messages-in-Feedback-Panel-after-Download-tp3311648p3319765.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



Fixing redirect with relative part for mobile device

2011-02-22 Thread Pepijn de Geus
Hi all,

I'm working on a mobile website to be accessed by all kinds of devices, 
including the Nokia N95.
While testing we found out certain links were not working on the N95, while 
other devices and desktop browsers worked fine. I started a tcpdump and 
narrowed the problem to a redirect Wicket performs.

My page is mounted on '/m/mypage' using the HybridIndexed strategy. When 
clicking this link, Wicket enables versioning by redirecting to '/m/mypage.0' 
(or any other number). The redirect however is not absolute, but relative; the 
Location header contains '/m/../m/mypage.0'. Almost all browsers resolve the 
relative part and are redirected properly. The N95 actually performs a request 
using the relative URL, which Wicket doesn't understand, resulting in a 404.

I found some JavaDoc on WebRequest#sendRedirect(String) proposing a solution to 
this problem (although mentioning a faulty container instead of mobile device):
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/protocol/http/WebResponse.html#sendRedirect%28java.lang.String%29

I tried to use this solution, but for some reason RequestCycle.get() returns 
null while inside the sendRedirect method. I tried to figure out why, but the 
whole request cycle and unsetting/detaching is still a bit messy for me.
Anybody know why this is happening, or other solutions to this problem?

Thanks in advance,
Pepijn



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



Re: Fixing redirect with relative part for mobile device

2011-02-22 Thread Martin Grigorov
Try running your application in different web container. I remember some
version of Tomcat to had that problem.
Per JEE spec it is container's responsibility to make the redirect url
absolute.

On Tue, Feb 22, 2011 at 8:13 PM, Pepijn de Geus pdeg...@me.com wrote:

 Hi all,

 I'm working on a mobile website to be accessed by all kinds of devices,
 including the Nokia N95.
 While testing we found out certain links were not working on the N95, while
 other devices and desktop browsers worked fine. I started a tcpdump and
 narrowed the problem to a redirect Wicket performs.

 My page is mounted on '/m/mypage' using the HybridIndexed strategy. When
 clicking this link, Wicket enables versioning by redirecting to
 '/m/mypage.0' (or any other number). The redirect however is not absolute,
 but relative; the Location header contains '/m/../m/mypage.0'. Almost all
 browsers resolve the relative part and are redirected properly. The N95
 actually performs a request using the relative URL, which Wicket doesn't
 understand, resulting in a 404.

 I found some JavaDoc on WebRequest#sendRedirect(String) proposing a
 solution to this problem (although mentioning a faulty container instead of
 mobile device):

 http://wicket.apache.org/apidocs/1.4/org/apache/wicket/protocol/http/WebResponse.html#sendRedirect%28java.lang.String%29

 I tried to use this solution, but for some reason RequestCycle.get()
 returns null while inside the sendRedirect method. I tried to figure out
 why, but the whole request cycle and unsetting/detaching is still a bit
 messy for me.
 Anybody know why this is happening, or other solutions to this problem?

 Thanks in advance,
 Pepijn



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




Caused by: java.lang.OutOfMemoryError at sun.misc.Unsafe.allocateMemory(Native Method)

2011-02-22 Thread maxima_2007

Hi,

   We using tomcat 6.0.26 on linux and Sun JDK 1.6.0_05, Db - oralce 11g QA
environment getting below error

Caused by: java.lang.OutOfMemoryError
at sun.misc.Unsafe.allocateMemory(Native Method)
at java.nio.DirectByteBuffer.init(DirectByteBuffer.java:99)
at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
at sun.nio.ch.Util.getTemporaryDirectBuffer(Util.java:57)
at sun.nio.ch.IOUtil.read(IOUtil.java:205)
at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:147)
at
com.pega.pegarules.engine.database.InstancesFile.readFile(InstancesFile.java:257)
at
com.pega.pegarules.engine.database.InstancesFile.init(InstancesFile.java:132)
at
com.pega.pegarules.engine.database.InstancesFile.init(InstancesFile.java:102)
at
com.pega.pegarules.engine.database.PegaArchiveImpl.init(PegaArchiveImpl.java:359)
at
com.pega.pegarules.engine.database.PegaArchiveImpl.init(PegaArchiveImpl.java:307)
at
com.pega.pegarules.util.PRRuleMgmtUtils.createArchiveForRead(PRRuleMgmtUtils.java:284)
at
com.pega.pegarules.util.PRRuleMgmtUtils.createArchiveForRead(PRRuleMgmtUtils.java:296)
at
com.pegarules.generated.activity.ra_action_archive_getinventory_36fbbb478a6bb92151b451e0e1207305.step1_circum0(ra_action_archive_getinventory_36fbbb478a6bb92151b451e0e1207305.java:219)
at
com.pegarules.generated.activity.ra_action_archive_getinventory_36fbbb478a6bb92151b451e0e1207305.perform(ra_action_archive_getinventory_36fbbb478a6bb92151b451e0e1207305.java:70)
at
com.pega.pegarules.engine.runtime.Executable.doActivity(Executable.java:3049)
at
com.pega.pegarules.engine.context.base.ThreadRunner.runActivitiesAlt(ThreadRunner.java:574)


and our jvm setting we are using

export JAVA_OPTS='-Xms3072M -Xmx3072M -Xss128k -server -Xverify:none
-XX:+HeapDumpOnOutOfMemoryError -Xconcurrentio -XX:+UseConcMark
SweepGC -XX:PermSize=512m -XX:MaxPermSize=512m -XX:+DisableExplicitGC
-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UsePerfData -XX:
+PrintGCDetails -Xloggc:/opt/prpc/pegalog/GC.log
-Dcom.sun.management.jmxremote.port=19004
-Dcom.sun.management.jmxremote.authentica
te=false -Dcom.sun.management.jmxremote.ssl=false' 

Any one any suggestions please

Thanks in Advance

Max.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Caused-by-java-lang-OutOfMemoryError-at-sun-misc-Unsafe-allocateMemory-Native-Method-tp3319788p3319788.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: Caused by: java.lang.OutOfMemoryError at sun.misc.Unsafe.allocateMemory(Native Method)

2011-02-22 Thread Martijn Dashorst
Read in the heap dump and check what is keeping the memory. visualvm
is one such tool, or you could download a trial for yourkit.

Based on the stack trace it appears that the file you're trying to
read does not fit into memory. But that could be caused by other
objects that are kept in memory.

Martijn

On Tue, Feb 22, 2011 at 7:30 PM, maxima_2007 rajadmi...@gmail.com wrote:

 Hi,

   We using tomcat 6.0.26 on linux and Sun JDK 1.6.0_05, Db - oralce 11g QA
 environment getting below error

 Caused by: java.lang.OutOfMemoryError
        at sun.misc.Unsafe.allocateMemory(Native Method)
        at java.nio.DirectByteBuffer.init(DirectByteBuffer.java:99)
        at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
        at sun.nio.ch.Util.getTemporaryDirectBuffer(Util.java:57)
        at sun.nio.ch.IOUtil.read(IOUtil.java:205)
        at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:147)
        at
 com.pega.pegarules.engine.database.InstancesFile.readFile(InstancesFile.java:257)
        at
 com.pega.pegarules.engine.database.InstancesFile.init(InstancesFile.java:132)
        at
 com.pega.pegarules.engine.database.InstancesFile.init(InstancesFile.java:102)
        at
 com.pega.pegarules.engine.database.PegaArchiveImpl.init(PegaArchiveImpl.java:359)
        at
 com.pega.pegarules.engine.database.PegaArchiveImpl.init(PegaArchiveImpl.java:307)
        at
 com.pega.pegarules.util.PRRuleMgmtUtils.createArchiveForRead(PRRuleMgmtUtils.java:284)
        at
 com.pega.pegarules.util.PRRuleMgmtUtils.createArchiveForRead(PRRuleMgmtUtils.java:296)
        at
 com.pegarules.generated.activity.ra_action_archive_getinventory_36fbbb478a6bb92151b451e0e1207305.step1_circum0(ra_action_archive_getinventory_36fbbb478a6bb92151b451e0e1207305.java:219)
        at
 com.pegarules.generated.activity.ra_action_archive_getinventory_36fbbb478a6bb92151b451e0e1207305.perform(ra_action_archive_getinventory_36fbbb478a6bb92151b451e0e1207305.java:70)
        at
 com.pega.pegarules.engine.runtime.Executable.doActivity(Executable.java:3049)
        at
 com.pega.pegarules.engine.context.base.ThreadRunner.runActivitiesAlt(ThreadRunner.java:574)


 and our jvm setting we are using

 export JAVA_OPTS='-Xms3072M -Xmx3072M -Xss128k -server -Xverify:none
 -XX:+HeapDumpOnOutOfMemoryError -Xconcurrentio -XX:+UseConcMark
 SweepGC -XX:PermSize=512m -XX:MaxPermSize=512m -XX:+DisableExplicitGC
 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UsePerfData -XX:
 +PrintGCDetails -Xloggc:/opt/prpc/pegalog/GC.log
 -Dcom.sun.management.jmxremote.port=19004
 -Dcom.sun.management.jmxremote.authentica
 te=false -Dcom.sun.management.jmxremote.ssl=false'

 Any one any suggestions please

 Thanks in Advance

 Max.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Caused-by-java-lang-OutOfMemoryError-at-sun-misc-Unsafe-allocateMemory-Native-Method-tp3319788p3319788.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





-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

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



RE: [OT] Wicketeers from Czech rep.

2011-02-22 Thread Ladislav DANKO
yes, a lot of ;-)

 

 -Original Message-
 From: danisevsky [mailto:danisev...@gmail.com] 
 Sent: Tuesday, February 22, 2011 4:52 PM
 To: users@wicket.apache.org
 Subject: [OT] Wicketeers from Czech rep.
 
 Hi fans of Wicket!
 
 Is there somebody from Czech rep? I'm thinking about 
 organizing an event.
 
 -
 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



Select All Non-Disabled Items in CheckBoxMultipleChoice

2011-02-22 Thread eugenebalt

I have a CheckBoxMultipleChoice which has some disabled checkboxes (I was
able to achieve that by overriding isDisabled(final Object object, int
index, String selected) on the CheckBoxMultipleChoice).

Now, I have a 'Select All' button which needs to select all *enabled*
checkboxes in that field. How do I find out which checkboxes are enabled, so
I can select them?

If I wanted to select all checkboxes, regardless of enabled/disabled, I
could do
((Collection)umcRolesCheckBoxes.getDefaultModelObject()).addAll(umcRolesCheckBoxes.getChoices());


Thanks
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Select-All-Non-Disabled-Items-in-CheckBoxMultipleChoice-tp3319897p3319897.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: Fixing redirect with relative part for mobile device

2011-02-22 Thread Pepijn de Geus
I'm afraid that's not possible. My company is using GlassFish as a standard.
It should be possible to fix this, since Wicket already suggests a solution. It 
must be possible to get the RequestCycle somehow, right? :)


On 22 feb 2011, at 19:56, Martin Grigorov wrote:

 Try running your application in different web container. I remember some
 version of Tomcat to had that problem.
 Per JEE spec it is container's responsibility to make the redirect url
 absolute.
 
 On Tue, Feb 22, 2011 at 8:13 PM, Pepijn de Geus pdeg...@me.com wrote:
 
 Hi all,
 
 I'm working on a mobile website to be accessed by all kinds of devices,
 including the Nokia N95.
 While testing we found out certain links were not working on the N95, while
 other devices and desktop browsers worked fine. I started a tcpdump and
 narrowed the problem to a redirect Wicket performs.
 
 My page is mounted on '/m/mypage' using the HybridIndexed strategy. When
 clicking this link, Wicket enables versioning by redirecting to
 '/m/mypage.0' (or any other number). The redirect however is not absolute,
 but relative; the Location header contains '/m/../m/mypage.0'. Almost all
 browsers resolve the relative part and are redirected properly. The N95
 actually performs a request using the relative URL, which Wicket doesn't
 understand, resulting in a 404.
 
 I found some JavaDoc on WebRequest#sendRedirect(String) proposing a
 solution to this problem (although mentioning a faulty container instead of
 mobile device):
 
 http://wicket.apache.org/apidocs/1.4/org/apache/wicket/protocol/http/WebResponse.html#sendRedirect%28java.lang.String%29
 
 I tried to use this solution, but for some reason RequestCycle.get()
 returns null while inside the sendRedirect method. I tried to figure out
 why, but the whole request cycle and unsetting/detaching is still a bit
 messy for me.
 Anybody know why this is happening, or other solutions to this problem?
 
 Thanks in advance,
 Pepijn
 
 
 
 -
 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: Fixing redirect with relative part for mobile device

2011-02-22 Thread Martin Grigorov
Then try with custom WebResponse (see WebApplication#newWebResponse()) and
override
its org.apache.wicket.protocol.http.WebResponse.sendRedirect(String) amd use
RequestUtils#toAbsolute()

On Tue, Feb 22, 2011 at 10:03 PM, Pepijn de Geus pdeg...@me.com wrote:

 I'm afraid that's not possible. My company is using GlassFish as a
 standard.
 It should be possible to fix this, since Wicket already suggests a
 solution. It must be possible to get the RequestCycle somehow, right? :)


 On 22 feb 2011, at 19:56, Martin Grigorov wrote:

  Try running your application in different web container. I remember some
  version of Tomcat to had that problem.
  Per JEE spec it is container's responsibility to make the redirect url
  absolute.
 
  On Tue, Feb 22, 2011 at 8:13 PM, Pepijn de Geus pdeg...@me.com wrote:
 
  Hi all,
 
  I'm working on a mobile website to be accessed by all kinds of devices,
  including the Nokia N95.
  While testing we found out certain links were not working on the N95,
 while
  other devices and desktop browsers worked fine. I started a tcpdump and
  narrowed the problem to a redirect Wicket performs.
 
  My page is mounted on '/m/mypage' using the HybridIndexed strategy. When
  clicking this link, Wicket enables versioning by redirecting to
  '/m/mypage.0' (or any other number). The redirect however is not
 absolute,
  but relative; the Location header contains '/m/../m/mypage.0'. Almost
 all
  browsers resolve the relative part and are redirected properly. The N95
  actually performs a request using the relative URL, which Wicket doesn't
  understand, resulting in a 404.
 
  I found some JavaDoc on WebRequest#sendRedirect(String) proposing a
  solution to this problem (although mentioning a faulty container instead
 of
  mobile device):
 
 
 http://wicket.apache.org/apidocs/1.4/org/apache/wicket/protocol/http/WebResponse.html#sendRedirect%28java.lang.String%29
 
  I tried to use this solution, but for some reason RequestCycle.get()
  returns null while inside the sendRedirect method. I tried to figure out
  why, but the whole request cycle and unsetting/detaching is still a bit
  messy for me.
  Anybody know why this is happening, or other solutions to this problem?
 
  Thanks in advance,
  Pepijn
 
 
 
  -
  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: Fixing redirect with relative part for mobile device

2011-02-22 Thread Igor Vaynberg
it is part of the spec that servlet container rewrites any relative
redirect urls to absolute ones. you may want to file a glassfish bug.

-igor

On Tue, Feb 22, 2011 at 10:13 AM, Pepijn de Geus pdeg...@me.com wrote:
 Hi all,

 I'm working on a mobile website to be accessed by all kinds of devices, 
 including the Nokia N95.
 While testing we found out certain links were not working on the N95, while 
 other devices and desktop browsers worked fine. I started a tcpdump and 
 narrowed the problem to a redirect Wicket performs.

 My page is mounted on '/m/mypage' using the HybridIndexed strategy. When 
 clicking this link, Wicket enables versioning by redirecting to '/m/mypage.0' 
 (or any other number). The redirect however is not absolute, but relative; 
 the Location header contains '/m/../m/mypage.0'. Almost all browsers resolve 
 the relative part and are redirected properly. The N95 actually performs a 
 request using the relative URL, which Wicket doesn't understand, resulting in 
 a 404.

 I found some JavaDoc on WebRequest#sendRedirect(String) proposing a solution 
 to this problem (although mentioning a faulty container instead of mobile 
 device):
 http://wicket.apache.org/apidocs/1.4/org/apache/wicket/protocol/http/WebResponse.html#sendRedirect%28java.lang.String%29

 I tried to use this solution, but for some reason RequestCycle.get() returns 
 null while inside the sendRedirect method. I tried to figure out why, but the 
 whole request cycle and unsetting/detaching is still a bit messy for me.
 Anybody know why this is happening, or other solutions to this problem?

 Thanks in advance,
 Pepijn



 -
 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: [OT] Wicketeers from Czech rep.

2011-02-22 Thread Jan Ferko
yes, there are a few.:)

On Tue, 2011-02-22 at 20:32 +0100, Ladislav DANKO wrote:
 yes, a lot of ;-)
 
  
 
  -Original Message-
  From: danisevsky [mailto:danisev...@gmail.com] 
  Sent: Tuesday, February 22, 2011 4:52 PM
  To: users@wicket.apache.org
  Subject: [OT] Wicketeers from Czech rep.
  
  Hi fans of Wicket!
  
  Is there somebody from Czech rep? I'm thinking about 
  organizing an event.
  
  -
  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: Select All Non-Disabled Items in CheckBoxMultipleChoice

2011-02-22 Thread eugenebalt

Can anyone help with this? Thanks
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Select-All-Non-Disabled-Items-in-CheckBoxMultipleChoice-tp3319897p3320046.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: Select All Non-Disabled Items in CheckBoxMultipleChoice

2011-02-22 Thread Igor Vaynberg
your code figures out if they are disabled or not, so use the code to
filter your add...

-igor

On Tue, Feb 22, 2011 at 1:06 PM, eugenebalt eugeneb...@yahoo.com wrote:

 Can anyone help with this? Thanks
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Select-All-Non-Disabled-Items-in-CheckBoxMultipleChoice-tp3319897p3320046.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



Wicket-Spring Hibernate dao

2011-02-22 Thread ookpalm

Hi 

I have a question about wicket spring.

My project is setup with Wicket-Spring plus using Hibernate annotation. I
created a Dao object says CatDao and created a entity for relational
mapping with hibernate says Cat. Both are created by using Spring
applicationContext file.

On my page says AddCat I show the default values of Cat object that I
set in my applicationContext which is rendered correctly in textFields
(Wicket-spring works correctly). But when I use the command
catDao.store(cat); The following error happens:

Last cause: Unknown entity: WICKET_com.ook.Cat$$EnhancerByCGLIB$$d80b8019

I commented out the @SpringBean annotation of the varriable Cat in my AddCat
page and used the operator new directly to the Cat object like

Cat cat = new Cat();

The CatDao still remains the same
@SpringBean
CatDao catDao;

now the command catDao.store(cat); works fine. Data are written to the
Database. I have no clue how to solve this.

Please help.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Spring-Hibernate-dao-tp3320134p3320134.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-Spring Hibernate dao

2011-02-22 Thread Igor Vaynberg
you should be doing cat=new cat() anyways. i assume the default cat
is a singleton in your application context, in which case you do not
want it to be persisted anyways.

-igor

On Tue, Feb 22, 2011 at 1:59 PM, ookpalm ookp...@gmail.com wrote:

 Hi

 I have a question about wicket spring.

 My project is setup with Wicket-Spring plus using Hibernate annotation. I
 created a Dao object says CatDao and created a entity for relational
 mapping with hibernate says Cat. Both are created by using Spring
 applicationContext file.

 On my page says AddCat I show the default values of Cat object that I
 set in my applicationContext which is rendered correctly in textFields
 (Wicket-spring works correctly). But when I use the command
 catDao.store(cat); The following error happens:

 Last cause: Unknown entity: WICKET_com.ook.Cat$$EnhancerByCGLIB$$d80b8019

 I commented out the @SpringBean annotation of the varriable Cat in my AddCat
 page and used the operator new directly to the Cat object like

 Cat cat = new Cat();

 The CatDao still remains the same
 @SpringBean
 CatDao catDao;

 now the command catDao.store(cat); works fine. Data are written to the
 Database. I have no clue how to solve this.

 Please help.
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-Spring-Hibernate-dao-tp3320134p3320134.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



Re: Wicket pages created by guice

2011-02-22 Thread Dan Griffin
Thanks, that does offer more flexibility, but it hasn`t solved my 
problem yet. Guicier and wicket-guice both return objects with wicket, 
not guice proxy when I say something like setResponse(HomePage.class). 
If I inject my page object and say, for example, 
setResponse(injectedPage) it works fine, but I can`t stick to that 
course throughout my application, because Application.getHome() returns 
Class? extends Page.


By the way, the application doesn`t crash, it only throws 
org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: 
Unable to serialize class: com.google.inject.InjectorImpl$4 and then it 
continues doing whatever it was doing.


I found that similar issue was raised before 
http://osdir.com/ml/users-wicket.apache.org/2009-06/msg01059.html, if 
it was resolved I would be happy to know. :)

Take a look at http://code.google.com/p/jolira-tools/wiki/guicier
http://code.google.com/p/jolira-tools/wiki/guicierThere is an extended
integration with Guice.

On Mon, Feb 21, 2011 at 5:16 PM, Dan Griffindangri...@gmail.com  wrote:

   

Sorry for spamming, but I remembered another thing I would like to ask
related to this. The reason why I need to inject a page is because I would
like to use guice AOP feature to wrap an interceptor around wicket pages. If
you can recommend another way to do that , it would be helpful as well. I
did a quick scan through wicket documentation, but couldn`t find anything
useful. Maybe I missed something?

Време: 21.02.2011. 13:31, Dan Griffin пише:

  Hi all,
 

I have guice integrated in my wicket app, and it worked fine until I tried
to inject a page, when I received

java.lang.IllegalArgumentException: Protected method:
checkHierarchyChange(Lorg/apache/wicket/Component;)

Now, I assume this is because of guice integration pitfall
https://cwiki.apache.org/WICKET/guice-integration-pitfall.html, as I
clearly cannot use interfaces here, but the proposed solution (with
deprecated protected no-arg constructor) doesn`t help me here. Any idea how
to get around this?

Thanks in advance,
Dan


   
 
   




Re: CheckBoxMultipleChoice.getInput() = NULL after switch to AjaxSubmit

2011-02-22 Thread kikiya

Not a ton of detail, but I think I've had a similar problem. I had to add an
ajax on update or on change behavior to my form component in order for it to
see the input value. Not sure if that is the optimal solution. But it did
work without any noticed drawback. I'm interested in finding out what would
be optimal however.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CheckBoxMultipleChoice-getInput-NULL-after-switch-to-AjaxSubmit-tp3317829p3320170.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-Spring Hibernate dao

2011-02-22 Thread Dan Griffin
I think that it happened because spring wrapped a proxy around your 
bean, and then hibernate couldn`t recognize its class and which table it 
should look for. I`m not sure if you can get around it, but I agree with 
Igor that you should  create your domain objects with new, rather than 
inject them.

you should be doing cat=new cat() anyways. i assume the default cat
is a singleton in your application context, in which case you do not
want it to be persisted anyways.

-igor

On Tue, Feb 22, 2011 at 1:59 PM, ookpalmookp...@gmail.com  wrote:
   

Hi

I have a question about wicket spring.

My project is setup with Wicket-Spring plus using Hibernate annotation. I
created a Dao object says CatDao and created a entity for relational
mapping with hibernate says Cat. Both are created by using Spring
applicationContext file.

On my page says AddCat I show the default values of Cat object that I
set in my applicationContext which is rendered correctly in textFields
(Wicket-spring works correctly). But when I use the command
catDao.store(cat); The following error happens:

Last cause: Unknown entity: WICKET_com.ook.Cat$$EnhancerByCGLIB$$d80b8019

I commented out the @SpringBean annotation of the varriable Cat in my AddCat
page and used the operator new directly to the Cat object like

Cat cat = new Cat();

The CatDao still remains the same
@SpringBean
CatDao catDao;

now the command catDao.store(cat); works fine. Data are written to the
Database. I have no clue how to solve this.

Please help.
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Spring-Hibernate-dao-tp3320134p3320134.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

   



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



Re: Wicket-Spring Hibernate dao

2011-02-22 Thread Nivedan Nadaraj
Hi,

Is your DAO marked with @Repository annotation?

e.g.
*@Repository(myDao)*
public class SomeDAO extends HibernateSessionDao implements IDao {


Plus in your client you need that @SpringBean,((Spring would inject it)

In my case I use a Service to get to the DAO - May not be necessary

@SpringBean( name = serviceName)
private IService service;

The IService Impl is define like this


@Service(serviceName)

So Client calls the Service and the Service delegates to the DAO.

I think its something to do with the markup/annotation and probably missing
the configuration.

Hope this helps
niv


On Wed, Feb 23, 2011 at 6:26 AM, Dan Griffin dangri...@gmail.com wrote:

 I think that it happened because spring wrapped a proxy around your bean,
 and then hibernate couldn`t recognize its class and which table it should
 look for. I`m not sure if you can get around it, but I agree with Igor that
 you should  create your domain objects with new, rather than inject them.

  you should be doing cat=new cat() anyways. i assume the default cat
 is a singleton in your application context, in which case you do not
 want it to be persisted anyways.

 -igor

 On Tue, Feb 22, 2011 at 1:59 PM, ookpalmookp...@gmail.com  wrote:


 Hi

 I have a question about wicket spring.

 My project is setup with Wicket-Spring plus using Hibernate annotation. I
 created a Dao object says CatDao and created a entity for relational
 mapping with hibernate says Cat. Both are created by using Spring
 applicationContext file.

 On my page says AddCat I show the default values of Cat object that I
 set in my applicationContext which is rendered correctly in textFields
 (Wicket-spring works correctly). But when I use the command
 catDao.store(cat); The following error happens:

 Last cause: Unknown entity: WICKET_com.ook.Cat
 $$EnhancerByCGLIB$$d80b8019

 I commented out the @SpringBean annotation of the varriable Cat in my
 AddCat
 page and used the operator new directly to the Cat object like

 Cat cat = new Cat();

 The CatDao still remains the same
 @SpringBean
 CatDao catDao;

 now the command catDao.store(cat); works fine. Data are written to the
 Database. I have no clue how to solve this.

 Please help.
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-Spring-Hibernate-dao-tp3320134p3320134.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





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




Re: DropDownChoice-Choose One Selected Item

2011-02-22 Thread nivs

Hi,

Thank you for the thoughts. We managed to get around this in the following
way for completness

class TestVO{
public Country selected= countryList.get(0);//I get the first item can 
be
any other way
}

countryChoice = new DropDownChoiceCountry(voName.country, new
PropertyModel(new TestVO(),selected),countryList, defaultChoiceRenderer);

Doing this..sets the Choose One to the default value that was set in the
TestVO.

Reference:
https://cwiki.apache.org/WICKET/dropdownchoice-examples.html
https://cwiki.apache.org/WICKET/dropdownchoice-examples.html 

Thanks
Nive


-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-Choose-One-Selected-Item-tp3298535p3320479.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 pages created by guice

2011-02-22 Thread Ben Tilford
Some things you may look at

IComponentInitalizationListener --
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/application/IComponentInitializationListener.html

IComponentInstantiationListener --
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/application/IComponentInstantiationListener.html

If your really wanting to use Guice/Spring have you considered using a
panel/component and implementing your own provider/factory for the
component? I'ts almost always harder to do this sort of thing with a Page.



On Tue, Feb 22, 2011 at 3:20 PM, Dan Griffin dangri...@gmail.com wrote:

 Thanks, that does offer more flexibility, but it hasn`t solved my problem
 yet. Guicier and wicket-guice both return objects with wicket, not guice
 proxy when I say something like setResponse(HomePage.class). If I inject my
 page object and say, for example, setResponse(injectedPage) it works fine,
 but I can`t stick to that course throughout my application, because
 Application.getHome() returns Class? extends Page.

 By the way, the application doesn`t crash, it only throws
 org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
 Unable to serialize class: com.google.inject.InjectorImpl$4 and then it
 continues doing whatever it was doing.

 I found that similar issue was raised before 
 http://osdir.com/ml/users-wicket.apache.org/2009-06/msg01059.html, if it
 was resolved I would be happy to know. :)

 Take a look at http://code.google.com/p/jolira-tools/wiki/guicier
 http://code.google.com/p/jolira-tools/wiki/guicierThere is an extended
 integration with Guice.

 On Mon, Feb 21, 2011 at 5:16 PM, Dan Griffindangri...@gmail.com  wrote:



 Sorry for spamming, but I remembered another thing I would like to ask
 related to this. The reason why I need to inject a page is because I
 would
 like to use guice AOP feature to wrap an interceptor around wicket pages.
 If
 you can recommend another way to do that , it would be helpful as well. I
 did a quick scan through wicket documentation, but couldn`t find anything
 useful. Maybe I missed something?

 Време: 21.02.2011. 13:31, Dan Griffin пише:

  Hi all,


 I have guice integrated in my wicket app, and it worked fine until I
 tried
 to inject a page, when I received

 java.lang.IllegalArgumentException: Protected method:
 checkHierarchyChange(Lorg/apache/wicket/Component;)

 Now, I assume this is because of guice integration pitfall
 https://cwiki.apache.org/WICKET/guice-integration-pitfall.html, as I
 clearly cannot use interfaces here, but the proposed solution (with
 deprecated protected no-arg constructor) doesn`t help me here. Any idea
 how
 to get around this?

 Thanks in advance,
 Dan












Re: requestCycle.getRequestTarget() not giving the target

2011-02-22 Thread Tejash Tarun
@leoerlandsson: Thanks a lot for the information.

@MZemeck: The solution given in the link provided by u worked for me. Thanks
a lot.

On Tue, Feb 22, 2011 at 10:10 PM, mzem...@osc.state.ny.us wrote:

 This is the best solution I have found...

 http://www.richardnichols.net/2010/03/apache-wicket-force-page-reload-to-fix-ajax-back/

 Note that when refreshing the page it will return to its default state
 (first tab selected).  I have been meaning to test with
 HybridUrlCodingStrategy to see if the page can maintain its state without
 crashing after using the back button...




 From:   leoerlandsson leo.erlands...@tyringe.com
 To: users@wicket.apache.org
 Date:   02/22/2011 06:22 AM
 Subject:Re: requestCycle.getRequestTarget() not giving the target




 Hi,

 We've seen this problem aswell (unfortunately, I have no solution for
 you...).

 The problem is probably that Wicket does not yet have Ajax Back Button
 Support. When an Ajax call is made, the URL is not changed, so the Browser
 cannot know that something (i.e State on server) has changed.

 When you click back you come back to the URL used for the _first_ page
 version... That's why you get:

 java.lang.IllegalStateException: No Page found for component
 [MarkupContainer [Component id = link]]

 I don't know how to fix this, but maybe someone elso knows? Perhaps we
 need
 Ajax Back Button Support (I know there's a JIRA Issue for it..)


 I have this scenario:
 1) AjaxTabbePanel has three tabs.
 2) Go to 2nd tab
 3) Come back to 1st tab
 4) one link in 1st tab will take us to some page
 5) Click back button of the browser = we wil come back to the page with
 the
 AjaxTabbedPanel#1st tab
 6) Now click on 2nd tab, then
 --
 View this message in context:

 http://apache-wicket.1842946.n4.nabble.com/requestCycle-getRequestTarget-not-giving-the-target-tp3317022p3318972.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






 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.