Re: how to create DISQUS like web widgets that can be deployed to third party web pages

2012-04-24 Thread Martin Grigorov
Hi,

I think you can do that by mouning a custom IRequestMapper which
#mapRequest() returns
org.apache.wicket.core.request.handler.ComponentRenderingRequestHandler

On Tue, Apr 24, 2012 at 3:42 AM, bad boy badmas...@yahoo.com wrote:
 Hi  all

 I am looking at a scenario where some of my partner web sites would like to 
 show some panels from my wicket application much like DISQUS or IntenseDebate.

 My wicket web application would run on my domain.

 My partners page would be on his domain

 The partner would have page with an onLoad(){} javascript script ; I want to 
 put AjaxBehavior code in this javascript that would  call my wicket 
 application which could send my wicket panel serialized to a string to the 
 caller javascript . This way the partner web page would be able to display my 
 wicket panels. My wicket panel would only contain AjaxLinks that would 
 refresh / redraw the panel as necessary by adding / removing child components

 Is this possible ? Can I create a AjaxBehavior that can return a Panel 
 serialized  to an HTML string that can be then written to the DOM of the 
 caller HTML page.


 Regards

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




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

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



Re: about the modalwindow in the wicket

2012-04-24 Thread Martin Grigorov
Hi,

On Mon, Apr 23, 2012 at 6:59 PM, lxw_first lxw_fi...@hotmail.com wrote:
 I have a question in trying to change the label content in the ModalWindow.
 There is a label in the ModalWindow. The ModalWindow extends the Panel.
 How to change the content of the modalwindow when the content ofthe
 textfield changed?

textField.add(new AjaxFormComponentUpdatingBehavior(onchange) {
  @Override public void onUpdate(AjaxRequestTarget target) {
 label.setDefaultModelObject(A new value);
 target.add(label);
  }
});

 Anyone can help me?


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/about-the-modalwindow-in-the-wicket-tp4580873p4580873.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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

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



Wicket 1.5 - new browser window support detection

2012-04-24 Thread David Rain
Hi,

I have a question about multi window (mutli tab) support in Wicket 1.5+.
Many things changed .. like concept of IDs and versions... these are now
only simple IDs, etc.
My quetion is how do I enable multi window support in 1.5? There is no
IPgaeSettings#setAutomaticMultiWindowSupport.
The second question is if I can be informed about the fact that new window
was opened. There used to be INewBrowserWindowListener. But no it is gone.
I've seen issue about it but no reactions
https://issues.apache.org/jira/browse/WICKET-4308

Thanks for answers.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-new-browser-window-support-detection-tp4582538p4582538.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.6 release data please

2012-04-24 Thread Martijn Dashorst
02-02-2020

Unless the Mayas get us first (my prediction would be 12-12-12).

Martijn

On Tue, Apr 24, 2012 at 12:44 AM, sudeivas sureshkumar@gmail.com wrote:
 Hello,
      Please let me know the approximate date for Wicket 1.5.6 release.

 -Suresh

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-6-release-data-please-tp4581936p4581936.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: focus locked in place

2012-04-24 Thread Tom Eugelink


This is very sad; I had a label tag (that was copied with the initial HTML) 
wrapping the whole table.


On 2012-04-19 14:11, Tom Eugelink wrote:


Ok, I've opened wicket's ajax debugger and there is NO ajax call.

I hope this helps you find out what causes the jumps in the focused elements.




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



Re: Wicket 1.5 - new browser window support detection

2012-04-24 Thread Andrea Del Bene
AFAIK multi tabs/windows support is enabled by default, you don't need 
to do anything to enable it.

Hi,

I have a question about multi window (mutli tab) support in Wicket 1.5+.
Many things changed .. like concept of IDs and versions... these are now
only simple IDs, etc.
My quetion is how do I enable multi window support in 1.5? There is no
IPgaeSettings#setAutomaticMultiWindowSupport.
The second question is if I can be informed about the fact that new window
was opened. There used to be INewBrowserWindowListener. But no it is gone.
I've seen issue about it but no reactions
https://issues.apache.org/jira/browse/WICKET-4308

Thanks for answers.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-new-browser-window-support-detection-tp4582538p4582538.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 1.5 - new browser window support detection

2012-04-24 Thread David Rain
OK, I also think so.
But I really need to detect the fact, that new window was opened. The
Listener was perfect... I wonder why it has been removed?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-new-browser-window-support-detection-tp4582538p4582816.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



Why everything is stored in Session?

2012-04-24 Thread Philipp Oppermann
Hi, I'm PHP-Programmer and now switching to java (and wicket ;) ). But
one thing confuses me:

Why everything is stored in Session?

In PHP the session is empty except you put something in. And there's
no Back-button-problem in PHP, when you go back then the site with
the previous URL will be loaded.

So why you need to store so much in the session?

Philipp Oppermann

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



Re: Why everything is stored in Session?

2012-04-24 Thread Josh Kamau
Because Wicket is a Stateful java web framework. Not all java web framework
are stateful. Some are stateless e.g playframework.org.

However, some of us prefer a stateful framework. It makes work easy for the
developer.

Welcome to java... A world of options .

Josh.

On Tue, Apr 24, 2012 at 3:34 PM, Philipp Oppermann 
p.opperm...@googlemail.com wrote:

 Hi, I'm PHP-Programmer and now switching to java (and wicket ;) ). But
 one thing confuses me:

 Why everything is stored in Session?

 In PHP the session is empty except you put something in. And there's
 no Back-button-problem in PHP, when you go back then the site with
 the previous URL will be loaded.

 So why you need to store so much in the session?

 Philipp Oppermann

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




Re: Why everything is stored in Session?

2012-04-24 Thread Martin Grigorov
Hi,

Only the last used instance of the page is stored in the session. And
only if this page is stateful.
Wicket does this because if the page is stateful and you have a Link
in that page for example then clicking on this Link will execute its
#onClick() method. To be able to execute it Wicket finds the stored
page instance, finds the Link in the page's component tree and
executes the method.
Without this, Wicket will create a new instance of the page, find the
Link and execute its method - this is how stateless page work.
Pages are stateless by default until you add the first stateful
component or behavior to it.

If you go several pages back (you press several times the back button)
then Wicket will read the page from the disk store.
Read https://cwiki.apache.org/confluence/x/qIaoAQ for more details.

On Tue, Apr 24, 2012 at 3:34 PM, Philipp Oppermann
p.opperm...@googlemail.com wrote:
 Hi, I'm PHP-Programmer and now switching to java (and wicket ;) ). But
 one thing confuses me:

 Why everything is stored in Session?

 In PHP the session is empty except you put something in. And there's
 no Back-button-problem in PHP, when you go back then the site with
 the previous URL will be loaded.

 So why you need to store so much in the session?

 Philipp Oppermann

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




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

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



RadioChoice vs. RadioGroup

2012-04-24 Thread Richard W. Adams
Can someone explain the important differences (besides the API) between 
RadioChoice  RadioGroup? What scenarios/factors would make one use one 
instead of the other? What are the tradeoffs? Etc. From my quick (perhaps 
naive) reading, they seem like equally plausible ways of doing the same 
thing.

I looked at the javadocs, but they didn't give any useful information to 
help me choose between the two classes.

**

This email and any attachments may contain information that is confidential 
and/or privileged for the sole use of the intended recipient.  Any use, review, 
disclosure, copying, distribution or reliance by others, and any forwarding of 
this email or its contents, without the express permission of the sender is 
strictly prohibited by law.  If you are not the intended recipient, please 
contact the sender immediately, delete the e-mail and destroy all copies.
**


Re: RadioChoice vs. RadioGroup

2012-04-24 Thread Martin Grigorov
Hi,

The difference is like DropDownChoice vs. Select components.

The *Choice components generate their body by concatenating strings.
Pros: lighter component
Cons: not much control over the generated markup

Select/RadioGroup need children components like SelectOption/Radio
which themselves generate their markup.
Pros: better control over the generated markup per child
Cons: bigger component tree (more memory footprint). Imagine a page
with 200+ options.

On Tue, Apr 24, 2012 at 3:45 PM, Richard W. Adams rwada...@up.com wrote:
 Can someone explain the important differences (besides the API) between
 RadioChoice  RadioGroup? What scenarios/factors would make one use one
 instead of the other? What are the tradeoffs? Etc. From my quick (perhaps
 naive) reading, they seem like equally plausible ways of doing the same
 thing.

 I looked at the javadocs, but they didn't give any useful information to
 help me choose between the two classes.

 **

 This email and any attachments may contain information that is confidential 
 and/or privileged for the sole use of the intended recipient.  Any use, 
 review, disclosure, copying, distribution or reliance by others, and any 
 forwarding of this email or its contents, without the express permission of 
 the sender is strictly prohibited by law.  If you are not the intended 
 recipient, please contact the sender immediately, delete the e-mail and 
 destroy all copies.
 **



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

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



JavaScript error wcall is not defined

2012-04-24 Thread Dirk Forchel
Similiar to this wiQuery example 
http://wiquery-plugins-demo.appspot.com/demo/;jsessionid=-bDymblOPJUPu9QqdWv7ug?wicket:bookmarkablePage=:com.wiquery.plugins.demo.TestLinkEffectsPage
http://wiquery-plugins-demo.appspot.com/demo/;jsessionid=-bDymblOPJUPu9QqdWv7ug?wicket:bookmarkablePage=:com.wiquery.plugins.demo.TestLinkEffectsPage
 
I use an AjaxLink with an AjaxCallDecorator to decorate my onClick event.
If I click on the Link, the according currentImage is replaced by another
one. Before the Ajax-Call I wanna fade out the image (using the wiQuery
FadeOut effect). The callback-Function of this Effect is set to the
original Wicket Ajax callback. But this is not working the way I thought.
Instead an JavaScript error is shown in my Firebug console wcall is not
defined.
Does somebody have an idea what's going wrong. Or is there another way to
fade out the image component first before replace it with another image?
Thank you.



Unfortunately the generated script is not correct. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/JavaScript-error-wcall-is-not-defined-tp4583516p4583516.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 yui 1.5.5

2012-04-24 Thread fachhoch
I am upgrading my project to 1.5 , I use wicketstuff   yui,  is there  1.5
release for yui ?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-yui-1-5-5-tp4584353p4584353.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 dropdownchoice onselectionchanged must override or implement a supertype method

2012-04-24 Thread Per Newgro

it is because of the @override annotation on a non-existent method.
Check the signature of the

onSelectionChanged


Cheers
Per

Am 24.04.2012 20:04, schrieb kshitiz:

Hi,

I am trying to implement wicket drop down choice with on selection changed
feature. But as I write :

final DropDownChoiceSelectOption  postCategoriesDropDown = new
DropDownChoiceSelectOption(postCategories, iModel,
Arrays.asList(selectOption), choiceRenderer)
{
/**
 *
 */
private static final long serialVersionUID = 1L;

@Override
protected boolean wantOnSelectionChangedNotifications()
{
 return true;
 }

@Override
protected void onSelectionChanged(final Object 
newSelection)
{
SelectOption selectOption = (SelectOption) 
newSelection;

}

};

eclipse shows an error:

*The method onSelectionChanged(Object) of type new
DropDownChoiceSelectOption(){} must override or implement a supertype
method*

Can you please tell me what can be the reason?? I am following
https://cwiki.apache.org/WICKET/dropdownchoice-examples.html
https://cwiki.apache.org/WICKET/dropdownchoice-examples.html

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-dropdownchoice-onselectionchanged-must-override-or-implement-a-supertype-method-tp4584391p4584391.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 dropdownchoice onselectionchanged must override or implement a supertype method

2012-04-24 Thread Sebastien
Right, should probably be something like:
protected void onSelectionChanged(SelectOption newSelection) {};

Also, note that SelectOption is generic...

Regards,
Sebastien.


On Tue, Apr 24, 2012 at 8:18 PM, Per Newgro per.new...@gmx.ch wrote:

 it is because of the @override annotation on a non-existent method.
 Check the signature of the

 onSelectionChanged


 Cheers
 Per

 Am 24.04.2012 20:04, schrieb kshitiz:

  Hi,

 I am trying to implement wicket drop down choice with on selection changed
 feature. But as I write :

 final DropDownChoiceSelectOption  postCategoriesDropDown = new
 DropDownChoiceSelectOption(**postCategories, iModel,
 Arrays.asList(selectOption), choiceRenderer)
{
/**
 *
 */
private static final long serialVersionUID = 1L;

@Override
protected boolean wantOnSelectionChangedNotifica**
 tions()
{
 return true;
 }

@Override
protected void onSelectionChanged(final Object
 newSelection)
{
SelectOption selectOption = (SelectOption)
 newSelection;

}

};

 eclipse shows an error:

 *The method onSelectionChanged(Object) of type new
 DropDownChoiceSelectOption()**{} must override or implement a supertype
 method*

 Can you please tell me what can be the reason?? I am following
 https://cwiki.apache.org/**WICKET/dropdownchoice-**examples.htmlhttps://cwiki.apache.org/WICKET/dropdownchoice-examples.html
 https://cwiki.apache.org/**WICKET/dropdownchoice-**examples.htmlhttps://cwiki.apache.org/WICKET/dropdownchoice-examples.html

 --
 View this message in context: http://apache-wicket.1842946.**
 n4.nabble.com/Wicket-**dropdownchoice-**onselectionchanged-must-**
 override-or-implement-a-**supertype-method-**tp4584391p4584391.htmlhttp://apache-wicket.1842946.n4.nabble.com/Wicket-dropdownchoice-onselectionchanged-must-override-or-implement-a-supertype-method-tp4584391p4584391.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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




Gets an userobject content from a TreeTable when I click on a node?

2012-04-24 Thread Pablo Díaz

Hi,

I'm trying to get the content of a cell when I click on it?.

I've the next code to create de treetable:

|public class DocTreeTable extends TreeTable {

private static final long serialVersionUID = 8799304134058383380L;

public DocTreeTable(String id, TreeModel model) {
super(id, model, createColumns());
}

private static IColumn[] createColumns() {
IColumn columns[] = new IColumn[] {
new PropertyRenderableColumnInteger(new ColumnLocation(
Alignment.LEFT, 3, Unit.EM), Id, 
userObject.idDoc),

new PropertyTreeColumnString(new ColumnLocation(
Alignment.MIDDLE, 50, Unit.PROPORTIONAL), 
Fichero,

userObject.data.name),
new PropertyRenderableColumnString(new ColumnLocation(
Alignment.MIDDLE, 25, Unit.PROPORTIONAL),
Descripción, userObject.data.desc),
new PropertyRenderableColumnString(new ColumnLocation(
Alignment.RIGHT, 25, Unit.PERCENT), Fase,
userObject.data.phase.data.name), };
return columns;
}

@Override
protected void populateTreeItem(final WebMarkupContainer item,
final int level) {
super.populateTreeItem(item, level);
item.add(new AjaxEventBehavior(onclick) {

private static final long serialVersionUID = 1L;

@Override
protected void onEvent(final AjaxRequestTarget target) {
final TreeNode node = (TreeNode) 
item.getDefaultModelObject();

rowClickSelect(node,item.getDefaultModelObject());

}
});
}

private void rowClickSelect(TreeNode node, Object obj) {
node.toString();
if (this.getTreeState().isNodeSelected(node)) {
DocTO doc = (DocTO) obj; // *HERE IS THE ERROR, AND I DON'T 
KNOW HOW SOLVE IT.*

if (node.isLeaf())
getWebPage()
.setResponsePage(
new DocViewPage(doc));
}
}
}|

And I have de next code to create the page with treetable, after reading 
the database content of a docs:

|
public DocsPage(PageParameters pageParameters) {
super(pageParameters);

DocTreeTable() tree = new DocTreeTable(docs, createTreeModel());
tree.setRootLess(false);
tree.getTreeState().setAllowSelectMultiple(false);
add(tree);
}

public DocsPage() {
this(null);
}

private TreeModel createTreeModel(){
List docs = docService.findMainFolders();
return convertToTreeModel(docs);
}
private TreeModel convertToTreeModel(ListObject list){
TreeModel model = null;
DefaultMutableTreeNode rootNode = new 
DefaultMutableTreeNode((DocTO)list.get(0));

addNode(rootNode, list);
model = new DefaultTreeModel(rootNode);
return model;

}

private void addNode(DefaultMutableTreeNode parent, List sub){
for(Object obj : sub){
if(((DocTO)obj).getData().getFolder()){
DefaultMutableTreeNode child = new 
DefaultMutableTreeNode((DocTO)obj);

parent.add(child);
addNode(child, docService.findFolderChilds((DocTO)obj));
}else{
DefaultMutableTreeNode child = new 
DefaultMutableTreeNode((DocTO)obj);

parent.add(child);
}
}
}
|

Thank you in advance,

Pablo.


Login page stateless??

2012-04-24 Thread Alfonso Quiroga
Hi, in my job we have an application, and the LoginPage is like any
other page. The testing team reported that when you see the login
page, a new Session is being created by wicket (they see it in
jProfiler). I've used a StatelessForm, but the session is still being
created.

The problem is that the application will be in internet, and is VERY
easy to attack if we create a session in the login page. The only
workaround I am thining... is creating a plain html file (login), and
then redirect to a wicket page. Any other solution? thanks!!

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



Re: Gets an userobject content from a TreeTable when I click on a node?

2012-04-24 Thread Sven Meier

Hi,

protected void onEvent(final AjaxRequestTarget target) {
  final TreeNode node = (TreeNode) item.getDefaultModelObject();
  rowClickSelect(node, item.getDefaultModelObject());
}

the item's model object is the TreeNode. You probably want to get hold 
on the node's user object:


   rowClickSelect(node, node.getUserObject());

Hope this helps
Sven

On 04/24/2012 08:23 PM, Pablo Díaz wrote:

Hi,

I'm trying to get the content of a cell when I click on it?.

I've the next code to create de treetable:

|public class DocTreeTable extends TreeTable {

private static final long serialVersionUID = 8799304134058383380L;

public DocTreeTable(String id, TreeModel model) {
super(id, model, createColumns());
}

private static IColumn[] createColumns() {
IColumn columns[] = new IColumn[] {
new PropertyRenderableColumnInteger(new ColumnLocation(
Alignment.LEFT, 3, Unit.EM), Id, 
userObject.idDoc),

new PropertyTreeColumnString(new ColumnLocation(
Alignment.MIDDLE, 50, Unit.PROPORTIONAL), 
Fichero,

userObject.data.name),
new PropertyRenderableColumnString(new ColumnLocation(
Alignment.MIDDLE, 25, Unit.PROPORTIONAL),
Descripción, userObject.data.desc),
new PropertyRenderableColumnString(new ColumnLocation(
Alignment.RIGHT, 25, Unit.PERCENT), Fase,
userObject.data.phase.data.name), };
return columns;
}

@Override
protected void populateTreeItem(final WebMarkupContainer item,
final int level) {
super.populateTreeItem(item, level);
item.add(new AjaxEventBehavior(onclick) {

private static final long serialVersionUID = 1L;

@Override
protected void onEvent(final AjaxRequestTarget target) {
final TreeNode node = (TreeNode) 
item.getDefaultModelObject();

rowClickSelect(node,item.getDefaultModelObject());

}
});
}

private void rowClickSelect(TreeNode node, Object obj) {
node.toString();
if (this.getTreeState().isNodeSelected(node)) {
DocTO doc = (DocTO) obj; // *HERE IS THE ERROR, AND I 
DON'T KNOW HOW SOLVE IT.*

if (node.isLeaf())
getWebPage()
.setResponsePage(
new DocViewPage(doc));
}
}
}|

And I have de next code to create the page with treetable, after 
reading the database content of a docs:

|
public DocsPage(PageParameters pageParameters) {
super(pageParameters);

DocTreeTable() tree = new DocTreeTable(docs, 
createTreeModel());

tree.setRootLess(false);
tree.getTreeState().setAllowSelectMultiple(false);
add(tree);
}

public DocsPage() {
this(null);
}

private TreeModel createTreeModel(){
List docs = docService.findMainFolders();
return convertToTreeModel(docs);
}
private TreeModel convertToTreeModel(ListObject list){
TreeModel model = null;
DefaultMutableTreeNode rootNode = new 
DefaultMutableTreeNode((DocTO)list.get(0));

addNode(rootNode, list);
model = new DefaultTreeModel(rootNode);
return model;

}

private void addNode(DefaultMutableTreeNode parent, List sub){
for(Object obj : sub){
if(((DocTO)obj).getData().getFolder()){
DefaultMutableTreeNode child = new 
DefaultMutableTreeNode((DocTO)obj);

parent.add(child);
addNode(child, docService.findFolderChilds((DocTO)obj));
}else{
DefaultMutableTreeNode child = new 
DefaultMutableTreeNode((DocTO)obj);

parent.add(child);
}
}
}
|

Thank you in advance,

Pablo.




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



Re: Login page stateless??

2012-04-24 Thread Bas Gooren
It simply means there is another component on your login page which 
makes the page stateful.


To find out which one, override onBeforeRender() in the login page (log 
is a slf4j Logger):


@Override
protected void onBeforeRender()
{
super.onBeforeRender();

log.debug( Stateless? {}, getSession().isTemporary() );

if( !getSession().isTemporary()  log.isTraceEnabled() )
{
// Print which component is stateful
visitChildren( Component.class, new IVisitorComponent()
{
@Override
public Object component( Component component )
{
if( !component.isStateless() )
{
log.trace( + Stateful: {}, component );
}

return CONTINUE_TRAVERSAL;
}
} );
}
}
Op 24-4-2012 20:50, schreef Alfonso Quiroga:

Hi, in my job we have an application, and the LoginPage is like any
other page. The testing team reported that when you see the login
page, a new Session is being created by wicket (they see it in
jProfiler). I've used a StatelessForm, but the session is still being
created.

The problem is that the application will be in internet, and is VERY
easy to attack if we create a session in the login page. The only
workaround I am thining... is creating a plain html file (login), and
then redirect to a wicket page. Any other solution? thanks!!

-
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: Login page stateless??

2012-04-24 Thread Dan Alvizu
The problem is that the application will be in internet, and is VERY
easy to attack if we create a session in the login page

Are you worried about a session fixation attack? I just call
Session#replaceSession():

http://wicket.apache.org/apidocs/1.5/org/apache/wicket/Session.html#replaceSession()

-Dan

On Tue, Apr 24, 2012 at 2:40 PM, Bas Gooren b...@iswd.nl wrote:

 It simply means there is another component on your login page which makes
 the page stateful.

 To find out which one, override onBeforeRender() in the login page (log is
 a slf4j Logger):

 @Override
protected void onBeforeRender()
{
super.onBeforeRender();

log.debug( Stateless? {}, getSession().isTemporary() );

if( !getSession().isTemporary()  log.isTraceEnabled() )
{
// Print which component is stateful
visitChildren( Component.class, new IVisitorComponent()
{
@Override
public Object component( Component component )
{
if( !component.isStateless() )
{
log.trace( + Stateful: {}, component );
}

return CONTINUE_TRAVERSAL;
}
} );
}
}
 Op 24-4-2012 20:50, schreef Alfonso Quiroga:

  Hi, in my job we have an application, and the LoginPage is like any
 other page. The testing team reported that when you see the login
 page, a new Session is being created by wicket (they see it in
 jProfiler). I've used a StatelessForm, but the session is still being
 created.

 The problem is that the application will be in internet, and is VERY
 easy to attack if we create a session in the login page. The only
 workaround I am thining... is creating a plain html file (login), and
 then redirect to a wicket page. Any other solution? thanks!!

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


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




AbstractAjaxBehavior and second request

2012-04-24 Thread Brian Mulholland
I have a javascript widget on my page that will issue multiple
requests.  I am using an AbstractAjaxBehavior and priming the
javascript component with the uri from getCallbackUri().  First
request works flawlessly.  But the next request using the same uri
(excepting the extra parameters that the javascript widget tacks on),
and it is not getting to the onRequest() method.

I can confirm that the request is going out because I can see it in firebug.

first request:
http://localhost:9080/ManagementCenter/?wicket:interface=:7:subscriptionList::IActivePageBehaviorListener:0:wicket:ignoreIfNotActive=true_dc=1335302423707page=1start=0limit=20group=%5B%7B%22property%22%3A%22RECIPIENT_USER%22%2C%22direction%22%3A%22ASC%22%7D%5Dsort=%5B%7B%22property%22%3A%22RECIPIENT_USER%22%2C%22direction%22%3A%22ASC%22%7D%5D

second request:
http://localhost:9080/ManagementCenter/?wicket:interface=:7:subscriptionList::IActivePageBehaviorListener:0:wicket:ignoreIfNotActive=true_dc=1335302444162page=2start=20limit=20group=%5B%7B%22property%22%3A%22RECIPIENT_USER%22%2C%22direction%22%3A%22ASC%22%7D%5Dsort=%5B%7B%22property%22%3A%22RECIPIENT_USER%22%2C%22direction%22%3A%22ASC%22%7D%5D

I see the wicket:interface portion in there.  Does this number need to
increment or something?

Brian Mulholland
For every complex problem, there is an answer that is clear, simple and wrong.
--H.L. Mencken

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



Access submit form values during validation

2012-04-24 Thread Russell Pitre
I have some logic that is called during validation and part of this logic
is to determine the type of form submission based on a selected radio
choice button. For instance, the user can choose Still Updating or
Final. When Final is selected the data moves on to the next step in a
workflow and the record is no longer editable by the user.

In the validation logic I call a helper method which looks like this:

public boolean isFinalSubmission() {

RadioGroupInteger status = (RadioGroupInteger)
form.get(submissionStatusChoice);
 Integer statusConverted = submissionStatusChoice; // backing model
object of the radio choice (a property on the panel)
 if(status.getConvertedInput() != null) {
statusConverted = status.getConvertedInput();
}
 if (LOG.isDebugEnabled()) {
LOG.debug(status.getConvertedInput():  + status.getConvertedInput());
LOG.debug(status.getModelObject():  + status.getModelObject());
}

if ((statusConverted.equals(SubmissionStatus.FINAL.getIdentifier()) ||
statusConverted.equals(SubmissionStatus.INITIAL_FINAL_EER.getIdentifier()))
 submitToAQB) {
return true;
} else {
return false;
}
}

My debug messages are printing different values for the submission status.

14:42:50.050 [http-8080-1] DEBUG u.n.s.n.e.w.p.report.ReportEntryForm -
status.getConvertedInput(): 4
14:42:50.050 [http-8080-1] DEBUG u.n.s.n.e.w.p.report.ReportEntryForm -
status.getModelObject(): 3


Couple questions, is the backing model on a form component updated after
form validation passes completely and successfully? Second, is
myFormComponent.getConvertedInput() a bad practice?


Thanks


Re: Access submit form values during validation

2012-04-24 Thread Sven Meier

is the backing model on a form component updated after
form validation passes completely and successfully?


Yes, it's all or nothing: either validation fails and nothing is pushed into 
the model(s), or validation succeeds and all models are updated.


is myFormComponent.getConvertedInput() a bad practice?


It's not very common but there are special cases where its useful, e.g.

  
http://stackoverflow.com/questions/7650104/wicket-date-range-from-to-validation

Sven


On 04/24/2012 11:58 PM, Russell Pitre wrote:

I have some logic that is called during validation and part of this logic
is to determine the type of form submission based on a selected radio
choice button. For instance, the user can choose Still Updating or
Final. When Final is selected the data moves on to the next step in a
workflow and the record is no longer editable by the user.

In the validation logic I call a helper method which looks like this:

public boolean isFinalSubmission() {

RadioGroupInteger  status = (RadioGroupInteger)
form.get(submissionStatusChoice);
  Integer statusConverted = submissionStatusChoice; // backing model
object of the radio choice (a property on the panel)
  if(status.getConvertedInput() != null) {
statusConverted = status.getConvertedInput();
}
  if (LOG.isDebugEnabled()) {
LOG.debug(status.getConvertedInput():  + status.getConvertedInput());
LOG.debug(status.getModelObject():  + status.getModelObject());
}

if ((statusConverted.equals(SubmissionStatus.FINAL.getIdentifier()) ||
statusConverted.equals(SubmissionStatus.INITIAL_FINAL_EER.getIdentifier()))
  submitToAQB) {
return true;
} else {
return false;
}
}

My debug messages are printing different values for the submission status.

14:42:50.050 [http-8080-1] DEBUG u.n.s.n.e.w.p.report.ReportEntryForm -
status.getConvertedInput(): 4
14:42:50.050 [http-8080-1] DEBUG u.n.s.n.e.w.p.report.ReportEntryForm -
status.getModelObject(): 3


Couple questions, is the backing model on a form component updated after
form validation passes completely and successfully? Second, is
myFormComponent.getConvertedInput() a bad practice?


Thanks




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



Re: Gets an userobject content from a TreeTable when I click on a node?

2012-04-24 Thread Pablo Diaz
Hi, thank you for your answer.

I have 1.5.3 Wicket versión and I haven't the function getUserObject() to
use in TreeNode Object.


2012/4/24 Sven Meier s...@meiers.net

 Hi,


 protected void onEvent(final AjaxRequestTarget target) {
   final TreeNode node = (TreeNode) item.getDefaultModelObject();
   rowClickSelect(node, item.getDefaultModelObject());
 }

 the item's model object is the TreeNode. You probably want to get hold on
 the node's user object:

   rowClickSelect(node, node.getUserObject());

 Hope this helps
 Sven


 On 04/24/2012 08:23 PM, Pablo Díaz wrote:

 Hi,

 I'm trying to get the content of a cell when I click on it?.

 I've the next code to create de treetable:

 |public class DocTreeTable extends TreeTable {

private static final long serialVersionUID = 8799304134058383380L;

public DocTreeTable(String id, TreeModel model) {
super(id, model, createColumns());
}

private static IColumn[] createColumns() {
IColumn columns[] = new IColumn[] {
new PropertyRenderableColumn**Integer(new
 ColumnLocation(
Alignment.LEFT, 3, Unit.EM), Id,
 userObject.idDoc),
new PropertyTreeColumnString(new ColumnLocation(
Alignment.MIDDLE, 50, Unit.PROPORTIONAL),
 Fichero,
userObject.data.name),
new PropertyRenderableColumn**String(new ColumnLocation(
Alignment.MIDDLE, 25, Unit.PROPORTIONAL),
Descripción, userObject.data.desc),
new PropertyRenderableColumn**String(new ColumnLocation(
Alignment.RIGHT, 25, Unit.PERCENT), Fase,

 userObject.data.phase.data.**namehttp://userObject.data.phase.data.name),
 };
return columns;
}

@Override
protected void populateTreeItem(final WebMarkupContainer item,
final int level) {
super.populateTreeItem(item, level);
item.add(new AjaxEventBehavior(onclick) {

private static final long serialVersionUID = 1L;

@Override
protected void onEvent(final AjaxRequestTarget target) {
final TreeNode node = (TreeNode)
 item.getDefaultModelObject();
rowClickSelect(node,item.**getDefaultModelObject());

}
});
}

private void rowClickSelect(TreeNode node, Object obj) {
node.toString();
if (this.getTreeState().**isNodeSelected(node)) {
DocTO doc = (DocTO) obj; // *HERE IS THE ERROR, AND I DON'T
 KNOW HOW SOLVE IT.*

if (node.isLeaf())
getWebPage()
.setResponsePage(
new DocViewPage(doc));
}
}
 }|

 And I have de next code to create the page with treetable, after reading
 the database content of a docs:
 |
public DocsPage(PageParameters pageParameters) {
super(pageParameters);

DocTreeTable() tree = new DocTreeTable(docs, createTreeModel());
tree.setRootLess(false);
tree.getTreeState().**setAllowSelectMultiple(false);
add(tree);
}

public DocsPage() {
this(null);
}

private TreeModel createTreeModel(){
List docs = docService.findMainFolders();
return convertToTreeModel(docs);
}
private TreeModel convertToTreeModel(List**Object list){
TreeModel model = null;
DefaultMutableTreeNode rootNode = new
 DefaultMutableTreeNode((DocTO)**list.get(0));
addNode(rootNode, list);
model = new DefaultTreeModel(rootNode);
return model;

}

private void addNode(DefaultMutableTreeNode parent, List sub){
for(Object obj : sub){
if(((DocTO)obj).getData().**getFolder()){
DefaultMutableTreeNode child = new
 DefaultMutableTreeNode((DocTO)**obj);
parent.add(child);
addNode(child, docService.findFolderChilds((**DocTO)obj));
}else{
DefaultMutableTreeNode child = new
 DefaultMutableTreeNode((DocTO)**obj);
parent.add(child);
}
}
}
 |

 Thank you in advance,

 Pablo.



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




Re: Gets an userobject content from a TreeTable when I click on a node?

2012-04-24 Thread Sven Meier
Sorry, I've seen you're using DefaultMutableTreeNode when you're 
converting your structure to the tree.


So you have to cast to the TreeNode implementation:

  rowClickSelect(node, ((DefaultMutableTreeNode)node).getUserObject());


Sven


On 04/25/2012 12:30 AM, Pablo Diaz wrote:

Hi, thank you for your answer.

I have 1.5.3 Wicket versión and I haven't the function getUserObject() to
use in TreeNode Object.


2012/4/24 Sven Meiers...@meiers.net


Hi,



protected void onEvent(final AjaxRequestTarget target) {
  final TreeNode node = (TreeNode) item.getDefaultModelObject();
  rowClickSelect(node, item.getDefaultModelObject());
}

the item's model object is the TreeNode. You probably want to get hold on
the node's user object:

   rowClickSelect(node, node.getUserObject());

Hope this helps
Sven


On 04/24/2012 08:23 PM, Pablo Díaz wrote:


Hi,

I'm trying to get the content of a cell when I click on it?.

I've the next code to create de treetable:

|public class DocTreeTable extends TreeTable {

private static final long serialVersionUID = 8799304134058383380L;

public DocTreeTable(String id, TreeModel model) {
super(id, model, createColumns());
}

private static IColumn[] createColumns() {
IColumn columns[] = new IColumn[] {
new PropertyRenderableColumn**Integer(new
ColumnLocation(
Alignment.LEFT, 3, Unit.EM), Id,
userObject.idDoc),
new PropertyTreeColumnString(new ColumnLocation(
Alignment.MIDDLE, 50, Unit.PROPORTIONAL),
Fichero,
userObject.data.name),
new PropertyRenderableColumn**String(new ColumnLocation(
Alignment.MIDDLE, 25, Unit.PROPORTIONAL),
Descripción, userObject.data.desc),
new PropertyRenderableColumn**String(new ColumnLocation(
Alignment.RIGHT, 25, Unit.PERCENT), Fase,

userObject.data.phase.data.**namehttp://userObject.data.phase.data.name),
};
return columns;
}

@Override
protected void populateTreeItem(final WebMarkupContainer item,
final int level) {
super.populateTreeItem(item, level);
item.add(new AjaxEventBehavior(onclick) {

private static final long serialVersionUID = 1L;

@Override
protected void onEvent(final AjaxRequestTarget target) {
final TreeNode node = (TreeNode)
item.getDefaultModelObject();
rowClickSelect(node,item.**getDefaultModelObject());

}
});
}

private void rowClickSelect(TreeNode node, Object obj) {
node.toString();
if (this.getTreeState().**isNodeSelected(node)) {
DocTO doc = (DocTO) obj; // *HERE IS THE ERROR, AND I DON'T
KNOW HOW SOLVE IT.*

if (node.isLeaf())
getWebPage()
.setResponsePage(
new DocViewPage(doc));
}
}
}|

And I have de next code to create the page with treetable, after reading
the database content of a docs:
|
public DocsPage(PageParameters pageParameters) {
super(pageParameters);

DocTreeTable() tree = new DocTreeTable(docs, createTreeModel());
tree.setRootLess(false);
tree.getTreeState().**setAllowSelectMultiple(false);
add(tree);
}

public DocsPage() {
this(null);
}

private TreeModel createTreeModel(){
List docs = docService.findMainFolders();
return convertToTreeModel(docs);
}
private TreeModel convertToTreeModel(List**Object  list){
TreeModel model = null;
DefaultMutableTreeNode rootNode = new
DefaultMutableTreeNode((DocTO)**list.get(0));
addNode(rootNode, list);
model = new DefaultTreeModel(rootNode);
return model;

}

private void addNode(DefaultMutableTreeNode parent, List sub){
for(Object obj : sub){
if(((DocTO)obj).getData().**getFolder()){
DefaultMutableTreeNode child = new
DefaultMutableTreeNode((DocTO)**obj);
parent.add(child);
addNode(child, docService.findFolderChilds((**DocTO)obj));
}else{
DefaultMutableTreeNode child = new
DefaultMutableTreeNode((DocTO)**obj);
parent.add(child);
}
}
}
|

Thank you in advance,

Pablo.



--**--**-
To unsubscribe, e-mail: 
users-unsubscribe@wicket.**apache.orgusers-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: Gets an userobject content from a TreeTable when I click on a node?

2012-04-24 Thread Pablo Diaz
Yes, I've tried this solution at this moment and its ok.

Thank you so much!!!

2012/4/25 Sven Meier s...@meiers.net

 Sorry, I've seen you're using DefaultMutableTreeNode when you're
 converting your structure to the tree.

 So you have to cast to the TreeNode implementation:

  rowClickSelect(node, ((DefaultMutableTreeNode)node)**.getUserObject());


 Sven



 On 04/25/2012 12:30 AM, Pablo Diaz wrote:

 Hi, thank you for your answer.

 I have 1.5.3 Wicket versión and I haven't the function getUserObject() to
 use in TreeNode Object.


 2012/4/24 Sven Meiers...@meiers.net

  Hi,


  protected void onEvent(final AjaxRequestTarget target) {
  final TreeNode node = (TreeNode) item.getDefaultModelObject();
  rowClickSelect(node, item.getDefaultModelObject());
 }

 the item's model object is the TreeNode. You probably want to get hold on
 the node's user object:

   rowClickSelect(node, node.getUserObject());

 Hope this helps
 Sven


 On 04/24/2012 08:23 PM, Pablo Díaz wrote:

  Hi,

 I'm trying to get the content of a cell when I click on it?.

 I've the next code to create de treetable:

 |public class DocTreeTable extends TreeTable {

private static final long serialVersionUID = 8799304134058383380L;

public DocTreeTable(String id, TreeModel model) {
super(id, model, createColumns());
}

private static IColumn[] createColumns() {
IColumn columns[] = new IColumn[] {
new PropertyRenderableColumnInteger(new

 ColumnLocation(
Alignment.LEFT, 3, Unit.EM), Id,
 userObject.idDoc),
new PropertyTreeColumnString(new ColumnLocation(
Alignment.MIDDLE, 50, Unit.PROPORTIONAL),
 Fichero,
userObject.data.name),
new PropertyRenderableColumnString(new
 ColumnLocation(

Alignment.MIDDLE, 25, Unit.PROPORTIONAL),
Descripción, userObject.data.desc),
new PropertyRenderableColumnString(new
 ColumnLocation(

Alignment.RIGHT, 25, Unit.PERCENT), Fase,
userObject.data.phase.data.name
 http://userObject.data.**phase.data.namehttp://userObject.data.phase.data.name
 ),

 };
return columns;
}

@Override
protected void populateTreeItem(final WebMarkupContainer item,
final int level) {
super.populateTreeItem(item, level);
item.add(new AjaxEventBehavior(onclick) {

private static final long serialVersionUID = 1L;

@Override
protected void onEvent(final AjaxRequestTarget target) {
final TreeNode node = (TreeNode)
 item.getDefaultModelObject();
rowClickSelect(node,item.getDefaultModelObject());


}
});
}

private void rowClickSelect(TreeNode node, Object obj) {
node.toString();
if (this.getTreeState().isNodeSelected(node)) {

DocTO doc = (DocTO) obj; // *HERE IS THE ERROR, AND I DON'T
 KNOW HOW SOLVE IT.*

if (node.isLeaf())
getWebPage()
.setResponsePage(
new DocViewPage(doc));
}
}
 }|

 And I have de next code to create the page with treetable, after reading
 the database content of a docs:
 |
public DocsPage(PageParameters pageParameters) {
super(pageParameters);

DocTreeTable() tree = new DocTreeTable(docs,
 createTreeModel());
tree.setRootLess(false);
tree.getTreeState().setAllowSelectMultiple(false);

add(tree);
}

public DocsPage() {
this(null);
}

private TreeModel createTreeModel(){
List docs = docService.findMainFolders();
return convertToTreeModel(docs);
}
private TreeModel convertToTreeModel(ListObject  list){

TreeModel model = null;
DefaultMutableTreeNode rootNode = new
 DefaultMutableTreeNode((DocTO)list.get(0));

addNode(rootNode, list);
model = new DefaultTreeModel(rootNode);
return model;

}

private void addNode(DefaultMutableTreeNode parent, List sub){
for(Object obj : sub){
if(((DocTO)obj).getData().getFolder()){
DefaultMutableTreeNode child = new
 DefaultMutableTreeNode((DocTO)obj);
parent.add(child);
addNode(child, docService.findFolderChilds((***
 *DocTO)obj));

}else{
DefaultMutableTreeNode child = new
 DefaultMutableTreeNode((DocTO)obj);

parent.add(child);
}
}
}
 |

 Thank you in advance,

 Pablo.


  --**
 --**-
 To unsubscribe, e-mail: 
 users-unsubscribe@wicket.**apa**che.orghttp://apache.org
 users-unsubscribe@**wicket.apache.orgusers-unsubscr...@wicket.apache.org
 

 For additional commands, e-mail: