how to change the panel data from a modal window opened from AjaxLink.onClick() ?

2014-06-12 Thread Duke
Hi all, dear wicket experts!
I have some issue in my code, I suspect that it is because of ajax behavior,
that I not quite understand.
I have a MyPanel extends CheckedFolderT, that I create in
NestedTree.newContentComponent() {}. This MyPanel has some public data,
boolean bChanged for example.  MyPanel has an AjaxLink that creates and
shows a ModalWindow using for edit a MyPanel data. 

MyPanel.java
public class MyPanel extends CheckedFolderT {
public MyPanel(String id, AbstractTree tree, IModelT model, ModalWindow
dialog, ...) {
...
AjaxLink link = new AjaxLink(editlink, model) {
  public void onClick(AjaxRequestTarget target) {
MyPanel.this.dialog.setWindowClosedCallback(new WindowClosedCallback() {
  public void onClose(AjaxRequestTarget target) {
if*(bChanged == true)* {
   //update Panel model, to show an updated in ModalWindow data in a
tree
   MyPanel.this.tree.updateNode(model.getObject(), target);
}
  }
}
MyPanel.this.dialog.setPageCreator(new ModalWindow.PageCreator() {
  return new EditPage(MyPanel panel, ...);
}
MyPanel.this.dialog.show(target);
  }
}
}
}

In an EditPage I try to modify MyPanel.bChanged field when a user changed
Panel data and try to close a Modal EditPage.
EditPage.java
...
protected void onSubmit(AjaxRequestTarget target, Form? form) {
   panel.bChanged = true;
   EditPage.this.modalWindow.close(target);
}

When ModalWindow closed, onClose(AjaxRequestTarget target) method in MyPanel
fired. But a bChanged is always false in it. Why?
And hence the more general question:
How can I know that data in a modal EditPage is changed by user? 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-change-the-panel-data-from-a-modal-window-opened-from-AjaxLink-onClick-tp4666216.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 change the panel data from a modal window opened from AjaxLink.onClick() ?

2014-06-12 Thread Duke
Addition:

NestedTree and ModalWindow is placed on a TreePage:
TreePage.html
div wicket:id=modaleditdialog/div
div wicket:id=tree[tree]/div

TreePage.java

public TreePage () {
dialog = new ModalEditDialog(modaleditdialog);
dialog.setResizable(true);
dialog.setAutoSize(true);
dialog.setOutputMarkupId(true);
...
add(dialog);

NestedTreeT nestedTree = new NestedTreeT(id, provider) {
  protected Component newContentComponent(String id, IModelT model) {
MyPanel panel = new MyPanel(id, this, model, dialog,...);
panel.setOutputMarkupId(true);
return panel;
  }
}
nestedTree.setOutputMarkupId(true);
add(nestedTree);
...
}

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-change-the-panel-data-from-a-modal-window-opened-from-AjaxLink-onClick-tp4666216p4666217.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 change the panel data from a modal window opened from AjaxLink.onClick() ?

2014-06-12 Thread Duke
Thanks Martin! 

I tried to use a reference to bChanged through the first page, but it
permanently bind ModalWindow with first page and I cant use it in another
pages.

For the first way - There will be no serialization/deserialization when I
will use Panel insted of a Page in ModalWindow?

Best regards,

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-change-the-panel-data-from-a-modal-window-opened-from-AjaxLink-onClick-tp4666216p4666227.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 CDI application junit test

2014-04-17 Thread Duke
Hi Stepan!
Do you try DeltaSpike yourself? I try to run cdi in tests just like in  this
guide
http://struberg.wordpress.com/2012/03/27/unit-testing-strategies-for-cdi-based-projects/
 
. And weld-se is failed in a simple test debuuging on a cdiContainer.boot();
with many WELD-001409 exceptions, like this:
Testcase: LoginPageTest:Caused an ERROR
Exception List with 5 exceptions:
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous
dependencies for type DeltaSpikeContextExtension with qualifiers @Default
  at injection point [BackedAnnotatedField] @Inject private
org.apache.deltaspike.core.impl.scope.conversation.GroupedConversationArtifactProducer.deltaSpikeContextExtension
  at
org.apache.deltaspike.core.impl.scope.conversation.GroupedConversationArtifactProducer.deltaSpikeContextExtension(GroupedConversationArtifactProducer.java:0)
  Possible dependencies: 
  - Extension [class
org.apache.deltaspike.core.impl.scope.DeltaSpikeContextExtension] with
qualifiers [@Default];
jar:file:/C:/projects/WebApplication1/lib/DeltaSpike-0.6/deltaspike-core-impl-0.6.jar!/META-INF/services/javax.enterprise.inject.spi.Extension@25[org.apache.deltaspike.core.impl.scope.DeltaSpikeContextExtension@1571a74],
  - org.glassfish.jersey.gf.cdi.internal.CdiComponentProvider$Hk2Bean@52b341

Can you show me the right way to find a solution? Where I may make mistakes?

PS I use NB8.0, GF4.0.1 with weld upgraded to 2.0.5Final, Ecipselink-2.5.2
and wicket 6.14 with wicket-cdi 1.1 module.

Best regards,
Andrey

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665459.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 CDI application junit test

2014-04-15 Thread Duke
Thanks Martin, I read WICKET-5264, but I don't understand... I havn't any
injections in anonymous inner classes in my code. I try to inject
EntityManager in public class LoginPage.
If I remove any injections, fail remains. It disappers only if I remove 
{ new CdiConfiguration().configure(this); } in Application.init(), but my
injections are nulls in this case.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665412.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 CDI application junit test

2014-04-15 Thread Duke
I'm sorry, I did not immediately explained. 
At first I tried to create tests for an existing application that uses
wicket-cdi 1.0 and Glassfish 3.1.2. I did not succeed because of
'javax.naming.NamingException: Lookup failed for 'java:comp/BeanManager''. 
Then I think that with wicket-cdi1.1 it will be easer to write tests, and
later I will whatever migrate to glassfish4.0. Thats why I try to create a
simple test application with wicket-cdi 1.1 from wicket v6.14 and
Glassfish4.0, to understand what is necessary to do in migration.
Can't build this simple application yet. It fails without any injections,
even I try to use at least one anonymous class. I must write a code without
any anonymous classes? Or what can I do?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665415.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 CDI application junit test

2014-04-15 Thread Duke
Found some info in mail archives. I will try to upgrade gf4 with weld 2.1.x
as I read. Thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665416.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 CDI application junit test

2014-04-14 Thread Duke
Hi all.
Tried to build simple example with EntityManager injection:

public class LoginPage extends BasePage {

@Inject EntityManager em;
...
}

public class Application extends WebApplication {
@Override
protected void init() {
super.init(); 
new CdiConfiguration().configure(this);
}
}

It fails on new CdiConfiguration().configure(this); with message:
Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-70 Simple
bean [EnhancedAnnotatedTypeImpl]  class
org.apache.wicket.markup.html.panel.FeedbackPanel$1 cannot be a non-static
inner class
at
org.jboss.weld.injection.producer.BasicInjectionTarget.checkType(BasicInjectionTarget.java:81)
at
org.jboss.weld.injection.producer.BasicInjectionTarget.init(BasicInjectionTarget.java:69)
at
org.jboss.weld.injection.producer.BeanInjectionTarget.init(BeanInjectionTarget.java:52)
at
org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:95)
at
org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:78)

If I comment line with configuring of CdiConfiguration, all injections are
nulls ((
What I am doing wrong?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665402.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 CDI application junit test

2014-04-11 Thread Duke
Thanks, Stephan. I will try to use DeltaSpike with wicket-cdi1.0 in tests.

PS Maybe using wicket-cdi1.1 version will be more easy and it will not need
any additional libraries?
PPS I don't understand about wicket-cdi 1.1 version. Will it work correctly
with glassfish 4.0? I tryed cdi1.0, but it don't work. Then I found an issue
about this problem.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665371.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 CDI application junit test

2014-04-11 Thread Duke
Found your thread, David :) Many thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366p4665373.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



Wicket CDI application junit test

2014-04-10 Thread Duke
Hi everyone.
I'm trying to write some tests for my wicket-cdi application. But I can't
init wicket WebApplication, resulting:

 javax.naming.NamingException: Lookup failed for 'java:comp/BeanManager' in
SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory,
java.naming.factory.url.pkgs=com.sun.enterprise.naming,
java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl}
[Root exception is javax.naming.NamingException: Invocation exception: Got
null ComponentInvocation ]
in WebAdminApplication.java row:
manager = (BeanManager)new InitialContext().lookup(java:comp/BeanManager);

LoginPageTest.java
public class LoginPageTest {
private static WicketTester tester;
@BeforeClass
public static void setUpClass() {
tester = new WicketTester(new WebAdminApplication());
}
@AfterClass
public static void tearDownClass() {
}
@Test
public void testRenderLoginPage() {
LoginPage p = tester.startPage(LoginPage.class);
tester.assertRenderedPage(LoginPage.class);
...
}
}

WebAdminApplication.java
public class WebAdminApplication extends WebApplication {
protected void init() {
super.init();
BeanManager manager = null;
try {
manager = (BeanManager)new
InitialContext().lookup(java:comp/BeanManager);
} catch (NamingException ex) {
logger.error(Error while creating BeanManager. Error text: {},
ex.toString());
}
new CdiConfiguration(manager).configure(this);
...
}
}

How I can get BeanManager for tests?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-CDI-application-junit-test-tp4665366.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: [ANN] wicket-dnd project

2014-03-11 Thread Duke
Hi all,
I'm try to use wicket-dnd 0.6.0 in my project.
I got a strange behavior in my NetBeans 7.4 IDE when I add wicket-dnd
library to my project library list.
After adding and saving project, if I close IDE and open it, it stop to
highlight errors in code editor. It highlihgt a file in a list, that it has
a error, but not highlight error in code text.
I don't understand a link between highliting errors in ide and wicket-dnd
library ((

before adding wicket-dnd:
http://apache-wicket.1842946.n4.nabble.com/file/n4664893/netbeans1.jpg 

after adding wicket-dnd:
http://apache-wicket.1842946.n4.nabble.com/file/n4664893/netbeans2.jpg 




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ANN-wicket-dnd-project-tp1889824p4664893.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: [ANN] wicket-dnd project

2014-03-11 Thread Duke
Thanks for reply.
Unfortunately I can't change IDE now, its not my choice.

Also, I found some strange code in wicket-dnd theme.css files:

div.dnd-hover-cover {
display: none;
}
table.dnd-hover-table {
border-spacing: 0px;
*border-collapse: collapse:*
}

Maybe it is a missprint? And right will be like this:
border-collapse: collapse*;*
?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ANN-wicket-dnd-project-tp1889824p4664895.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: [ANN] wicket-dnd project

2014-03-11 Thread Duke
Thanks Sven,
I am newbe in css/html, thats why I was in doubt.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ANN-wicket-dnd-project-tp1889824p4664899.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 get wiki Framework Documentation for offline reading

2014-02-12 Thread Duke
Hi, Martin. Hi everyone!
What about a offline wicket api  documentation
http://ci.apache.org/projects/wicket/apidocs/6.x/  ? Sometime it's usefull
to get it without any internet connection.  Can we download it anyware?
Best regards,
Andrey

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-get-wiki-Framework-Documentation-for-offline-reading-tp4664374p4664411.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