Re: Hints for creating a form-embedded Grid

2010-11-10 Thread Thierry Peng

MattyDE schrieb:

As i mentioned in a another thread i build my own GridView Component from
Scratch (just extending Panel).
But now our customer want a special, editable Grid.

Its no problem on my side to add "TextboxColumns", "DropDownColumns" and so
on, but i cant figure out how to connect them to a special form.

I have tried to add my whole GridView Component (which is the container of
the Textbox, DropDown, any FormComponent) and submit this form.

In FireBug i see that all this Components are send by Ajax-Request to the
server-side. But will they end in the FormComponents automatically by
Wicket-internal-Form-Processing?

If this is true, iam almost done (i think ;) )

Any other hints for develop a form-embedded Grid?
  

Hello Matty

have a look at the inmethod-grid 
 in 
wicketstuff


It contains the editable feature, works out of the box and is easily 
extendable.


greetings

thierry

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



Hints for creating a form-embedded Grid

2010-11-10 Thread MattyDE

As i mentioned in a another thread i build my own GridView Component from
Scratch (just extending Panel).
But now our customer want a special, editable Grid.

Its no problem on my side to add "TextboxColumns", "DropDownColumns" and so
on, but i cant figure out how to connect them to a special form.

I have tried to add my whole GridView Component (which is the container of
the Textbox, DropDown, any FormComponent) and submit this form.

In FireBug i see that all this Components are send by Ajax-Request to the
server-side. But will they end in the FormComponents automatically by
Wicket-internal-Form-Processing?

If this is true, iam almost done (i think ;) )

Any other hints for develop a form-embedded Grid?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Hints-for-creating-a-form-embedded-Grid-tp3037298p3037298.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: Memory Leak in 1.4.13?

2010-11-10 Thread Brad Grier
Hopefully I can recreate in a quickstart. The pages in our app are 
dynamically created. If this leak is somehow related to how the layout 
engine works it might be difficult. I'll see what I can do.


-Original Message- 
From: Jeremy Thomerson

Sent: Wednesday, November 10, 2010 5:23 PM
To: users@wicket.apache.org
Subject: Re: Memory Leak in 1.4.13?

On Wed, Nov 10, 2010 at 5:57 PM, Brad Grier 
wrote:



I recently upgraded our app from 1.4.12 to 1.4.13. Our app has an admin
screen that shows the current session size using Session’s getSizeInBytes
method. This screen is just a panel that gets replaced/refreshed via Ajax
when a link is clicked. Today I noticed that every time I clicked the link
to reload the panel the session size grows by around 3000 KB and never 
does

a gc. If I roll back to 1.4.12 and the problem goes away.

In the Netbeans profiler, the only thing I see spiraling out of control 
are
byte[] objects (serialized objects?). Nothing unusual appears with the 
size

or number of my application specific objects. For now I’m rolling back to
1.4.12 as I’m not sure how this is affecting things outside this specific
screen.

Thanks.



Please create a quickstart and see if you can reproduce this.  If you can,
attach it to a JIRA.  We'll fix it.

--
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org* 



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



Re: onSubmit method and validators

2010-11-10 Thread Jeremy Thomerson
and here (although it is out of date and I hope to update it soon):
http://www.jeremythomerson.com/blog/2008/11/wicket-quickstart-tutorial/

On Wed, Nov 10, 2010 at 5:27 PM, Pedro Santos  wrote:

> I mean: http://wicket.apache.org/help/
>
> On Wed, Nov 10, 2010 at 2:55 PM, Pedro Santos  wrote:
>
> > There are good information at
> > http://wicket.apache.org/contribute/patch.html
> >
> >
> > On Wed, Nov 10, 2010 at 5:49 PM, Henrique  wrote:
> >
> >> No problem...I'll keep for a little while and if it persists I can
> >> fill a ticket.
> >> What's the URL for wicket's jira?
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
> >
> >
> > --
> > Pedro Henrique Oliveira dos Santos
> >
>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>



-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*


Re: Wicket ajax-enabled enclosures

2010-11-10 Thread Jeremy Thomerson
On Tue, Nov 9, 2010 at 4:27 AM, Martin Makundi <
martin.maku...@koodaripalvelut.com> wrote:

> Hi!
>
> Does  have capability to "setOutputMarkupPlaceholderTag"
> ?
>
> What I mean is that when I have:
> 
> 
>   optional content
>
> 
> 
>
> If I set it invisible via ajax I cannot set it visible again.
>
> Instead, is there a way to do something like:
>
>
> 
>   optional content
>
> 
>
> So that it would automatically handle visible/hidden
> "setOutputMarkupPlaceholderTag" flavour so that I can repaint a hidden
> element via ajax?
>

Not currently.  wicket:enclosure is an auto-added component, which means it
goes away after the rendering cycle.  Since you didn't add it in your code,
you can't access it to call setOutputMarkupPlaceholderTag on it.

You could probably extend it so that it adds a behavior to the child
component that changes the ajax markup ID of the component.  See
IAjaxRegionMarkupIdProvider

Provide a patch on JIRA and we'll review it.

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*


Re: [OT] WicketForge 0.7.2 available for IDEA 9

2010-11-10 Thread 7zark7

Great, thanks!

On 11/10/10 5:25 PM, Minas Manthos wrote:


WicketForge 0.7.2 is available for download.

change notes: http://plugins.intellij.net/plugin/?id=1545




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



[OT] WicketForge 0.7.2 available for IDEA 9

2010-11-10 Thread Minas Manthos

WicketForge 0.7.2 is available for download.

change notes: http://plugins.intellij.net/plugin/?id=1545

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/OT-WicketForge-0-7-2-available-for-IDEA-9-tp3037143p3037143.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: Memory Leak in 1.4.13?

2010-11-10 Thread Jeremy Thomerson
On Wed, Nov 10, 2010 at 5:57 PM, Brad Grier wrote:

> I recently upgraded our app from 1.4.12 to 1.4.13. Our app has an admin
> screen that shows the current session size using Session’s getSizeInBytes
> method. This screen is just a panel that gets replaced/refreshed via Ajax
> when a link is clicked. Today I noticed that every time I clicked the link
> to reload the panel the session size grows by around 3000 KB and never does
> a gc. If I roll back to 1.4.12 and the problem goes away.
>
> In the Netbeans profiler, the only thing I see spiraling out of control are
> byte[] objects (serialized objects?). Nothing unusual appears with the size
> or number of my application specific objects. For now I’m rolling back to
> 1.4.12 as I’m not sure how this is affecting things outside this specific
> screen.
>
> Thanks.


Please create a quickstart and see if you can reproduce this.  If you can,
attach it to a JIRA.  We'll fix it.

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*


Memory Leak in 1.4.13?

2010-11-10 Thread Brad Grier
I recently upgraded our app from 1.4.12 to 1.4.13. Our app has an admin screen 
that shows the current session size using Session’s getSizeInBytes method. This 
screen is just a panel that gets replaced/refreshed via Ajax when a link is 
clicked. Today I noticed that every time I clicked the link to reload the panel 
the session size grows by around 3000 KB and never does a gc. If I roll back to 
1.4.12 and the problem goes away.

In the Netbeans profiler, the only thing I see spiraling out of control are 
byte[] objects (serialized objects?). Nothing unusual appears with the size or 
number of my application specific objects. For now I’m rolling back to 1.4.12 
as I’m not sure how this is affecting things outside this specific screen. 

Thanks.

Re: onSubmit method and validators

2010-11-10 Thread Pedro Santos
I mean: http://wicket.apache.org/help/

On Wed, Nov 10, 2010 at 2:55 PM, Pedro Santos  wrote:

> There are good information at
> http://wicket.apache.org/contribute/patch.html
>
>
> On Wed, Nov 10, 2010 at 5:49 PM, Henrique  wrote:
>
>> No problem...I'll keep for a little while and if it persists I can
>> fill a ticket.
>> What's the URL for wicket's jira?
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>



-- 
Pedro Henrique Oliveira dos Santos


Re: tooltip inside webMarkupContainer refreshing

2010-11-10 Thread taygolf

wow you are my hero!!!

I have been stuck on this all week and could not figure out what I was doing
wrong. Of course it was something simple like that that I completely over
looked.

Thanks for the help for sure!

T
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/tooltip-inside-webMarkupContainer-refreshing-tp3036878p3036965.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: tooltip inside webMarkupContainer refreshing

2010-11-10 Thread Sven Meier
Hi,

apply the golden rule and "never pull out of a model to push into another one":

AttributeModifier am1 = new AttributeModifier("title", true, 
  new AbstractReadOnlyModel() {
public String getObject() {
  KeyMemberData kmd = (KeyMemberData)item.getModelObject();
  Employee emp = kmd.getEmployee();

  return emp.getLastName()+", "+emp.getFirstName()+" \r\n Title:
"+emp.getPositionTitle()+" \r\n Phone: "+emp.getPhone()+" \r\n Email:
"+emp.getEmailAddress();
}
  }
);

Regards

Sven

Am 10.11.2010 um 21:55 schrieb taygolf:

>   KeyMemberData kmd = 
> (KeyMemberData)item.getModelObject();
>   Employee emp = kmd.getEmployee();
>   AttributeModifier am1 = new 
> AttributeModifier("title", true, new
> Model(emp.getLastName()+", "+emp.getFirstName()+" \r\n Title:
> "+emp.getPositionTitle()+" \r\n Phone: "+emp.getPhone()+" \r\n Email:
> "+emp.getEmailAddress()));


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



tooltip inside webMarkupContainer refreshing

2010-11-10 Thread taygolf

Hey guys. I have a ListView that contains a list of employee names. This list
is wrapped in a webMarkupContainer which allows the user to add and delete
names from the listview. All of this works properly. 

I have setup a tooltip that allows the user to hover over the employee name
and it will display more information about the employee like title and phone
number and such. This also works when it is added.

The problem comes in when the user deletes or edits the employee. Say the
user wants to delete an employee from the list. The employee is deleted from
the list but the tooltip for the old employee remains. The same thing
happens if the user wants to change one employee to another.

It seems that the data is getting refreshed but the tooltip is not.

Any clue on what I can do here? I posted this question on Sunday but it did
not show up on the message board so I thought I would post it again.

Here is the code for the ListView



ListView lv = new ListView("rows", kmList) {
public void populateItem(final ListItem 
item)
{
final int index = item.getIndex();
item.add(new AttributeModifier("class", true, 
new
AbstractReadOnlyModel()
{
public String getObject()
{
return (index % 2 == 1) ? "even" : "odd";
}
}));
item.add(new AttributeModifier("height", true, 
new
Model("20")));
//create delete button using a modal and ajax 
link
final ModalWindow deletemodal;
deletemodal = new ModalWindow("deletemodal");
deletemodal.setInitialHeight(100);
deletemodal.setInitialWidth(350);
deletemodal.setResizable(true);
deletemodal.setPageMapName("KeymemberDelete");
deletemodal.setCookieName("KeymemberDelete");
deletemodal.setTitle("Delete Key Member");
deletemodal.setPageCreator(new 
ModalWindow.PageCreator() {
public Page createPage() {
return new DeleteRow(item.getIndex(), 
deletemodal, pd,
"keymember");
}
});
deletemodal.setWindowClosedCallback(new
ModalWindow.WindowClosedCallback() {
public void onClose(AjaxRequestTarget target) {
target.addComponent(listContainer);
if(pd.getKeyMemberList().isEmpty()){
listContainer.setVisible(false);
}
}
});
item.add(new AjaxFallbackLink("deletelink") {
public void onClick(AjaxRequestTarget target) {
  deletemodal.show(target);
}
});

item.add(deletemodal);

//create modal and ajax link to edit keymembers
final ModalWindow editmodal;
editmodal = new ModalWindow("editmodal");
editmodal.setInitialHeight(300);
editmodal.setInitialWidth(700);
editmodal.setResizable(true);
editmodal.setPageMapName("KeymemberEdit");
editmodal.setCookieName("KeymemberEdit");
editmodal.setTitle("Update Key Member");
editmodal.setPageCreator(new 
ModalWindow.PageCreator() {
public Page createPage() {
return new KeyMemberPopup(item.getIndex(), 
"update",
editmodal, pd);
}
});
editmodal.setWindowClosedCallback(new
ModalWindow.WindowClosedCallback() {
public void onClose(AjaxRequestTarget target) {
target.addComponent(listContainer);
}
});
AjaxFallbackLink kmlink = new 
AjaxFallbackLink("kmlink") {
public void onClick(AjaxRequestTarget target) {
editmodal.show(target);
 

Re: onSubmit method and validators

2010-11-10 Thread Pedro Santos
There are good information at http://wicket.apache.org/contribute/patch.html

On Wed, Nov 10, 2010 at 5:49 PM, Henrique  wrote:

> No problem...I'll keep for a little while and if it persists I can
> fill a ticket.
> What's the URL for wicket's jira?
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos


WicketTester clickLink: Ajax-Response not rendered into the page?

2010-11-10 Thread Hans Lesmeister
Hi,

I have a page processed by the wicket-tester. On the page, there is an
AjaxLink. Now I do a clickLink on that AjaxLink. If I do a pagedump after
the clickLink, I can see the Ajax-Response which looks good. The Response
contains markup to replace an exisiting Container. Unfortunately, the
container is not actually replaced in the last rendered page.

If I try to get the container with getByWicketId(..) but it returns null
because now that method works on the Ajax-Response from the clickLink
(before the clickLink, getByWicketId(...) gives me the correct container)

I guess I oversee something obvious but I am stuck here. How can I simulate
a series of ajax-clicks on a page?

Regards
Hans




Re: onSubmit method and validators

2010-11-10 Thread Henrique
No problem...I'll keep for a little while and if it persists I can
fill a ticket.
What's the URL for wicket's jira?

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



Re: onSubmit method and validators

2010-11-10 Thread Pedro Santos
If you don't solve your problem, do you mind to fill an ticket on JIRA with
an quickstart demonstrating the problem?

On Wed, Nov 10, 2010 at 5:17 PM, Henrique  wrote:

> Yes, even in what would be the "second" submit, with all the right
> input entered.
>
> It's as if the form just stopped responding, onsSubmit is never called
> ever again, just onError time after time.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos


Re: onSubmit method and validators

2010-11-10 Thread Henrique
Yes, even in what would be the "second" submit, with all the right
input entered.

It's as if the form just stopped responding, onsSubmit is never called
ever again, just onError time after time.

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



Re: CheckBoxes cleared by Modal popup

2010-11-10 Thread brettTi

Seems to be a nested form issue.

The modal has a form.  If i change the modal's AjaxSubmitLink to an
AjaxLink, the problem on the outer form goes away.  I need the submmit on
the modal, so this doesn't really solve my problem so I moved the modal
window so that its not nested.

I'm good for now, but wondering if there is an easier way.  I don't want the
inner submit to do anything to the outer form


-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CheckBoxes-cleared-by-Modal-popup-tp3035463p3036681.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: onSubmit method and validators

2010-11-10 Thread Pedro Santos
On Wed, Nov 10, 2010 at 12:03 PM, Henrique  wrote:

> The business logic is a simple access to a DAO to save what the user
> has entered into the form, like so:
>
>   public void onSubmit() {
>
>   Item item = (Item)getModelObject();
>
>   User user = UserLoggedInSession.get().getUser();
>   item.setUser(user);
>   item.setCategory(selectedCategory);
>   item.setTimestamp(new DateTime());
>   item.setActive(true);
>
>   ItemDAO.persist(item);
>   setResponsePage(UserHomePage.class);
>   }
>
> Isn't this the logical place to put this code?
> Once the user leaves out a certain input, onError() is called and
> onSubmit() never gets called again.
>

even in the some next form submit with no validations errors?


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


-- 
Pedro Henrique Oliveira dos Santos


Re: onSubmit method and validators

2010-11-10 Thread Henrique
This seems like a pretty basic thing to do, and since Wicket gives us
lots of validators to use, I would hate to have to manually validate
each input in the onSubmit method.

Am I the only one having this problem?

Thanks!

On Wed, Nov 10, 2010 at 11:33 AM, Henrique  wrote:
> Could it have something to do with the fact that I am using a
> CompoundPropoertyModel?
> I can't think of a simpler example, here is the code:
>
> public class PublishItem extends WebPage {
>
>       private AddItemForm form;
>
>       public PublishItem() {
>
>               form = new AddItemForm("addItemForm");
>               add(form);
>
>               add(new FeedbackPanel("feedback"));
>       }
>
>       public final class AddItemForm extends Form {
>
>               private RequiredTextField title;
>
>               public AddItemForm(final String componentName) {
>
>                       super(componentName, new
> CompoundPropertyModel(new Item()));
>                       add(new RequiredTextField("title"));
>               }
>
>               public void onSubmit() {
>
>                       Item item = (Item)getModelObject();
>
>                       User user = UserLoggedInSession.get().getUser();
>                       item.setUser(user);
>
>                       ItemDAO.persist(item);
>               }
>       }
> }
>



-- 
Henrique Boregio

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



Re: Are there any cases when I can rearrange component tree?

2010-11-10 Thread samket
If you have markup like this:

You can put any panel (named "c") in using the add-method and later switch it 
to any panel (named "c") using the replace-method. You could create lots of 
tiny reusable panels and compose them into various structures. In my mind, 
Wicket is just as flexible as desktop programming because markup is limiting 
only where you want it to be limiting. When a panel needs lots of flexibility 
it tends to be small and when it doesn't it tends to be large.



- Original Message -
From: Dmitry Grigoriev
Sent: 11/10/10 05:41 AM
To: users@wicket.apache.org
Subject: Are there any cases when I can rearrange component tree?

Hello all,I'm new to Wicket. Just wonder about subj (theoretical interest). On 
onehand, stateful component model has no architectural limitations on itsown 
preventing me from reattaching component to different parent, justlike I can do 
with desktop applications or with any self-contained treestructure. On another 
hand, Wicket's component tree structure is boundto hard-coded markup, making 
such change-of-parent impossible.Is thereany opportunity to do this? (No matter 
how sophisticated.)The reason for my interest is that I'm collecting ideas for 
statelesscomponents support in my web framework. Stateless component 
hierarchywould likely be immutable (hard-coded into application logic rather 
thanstate) which looks like a significant limitation at first sight,compared to 
"do-anything-you-want" desktop programming. But I don't yethave much experience 
with web component frameworks and don't know isthis limitation really annoying 
or not. For now it seems to me thatWicket has this lim
 itation too but does not suffer a lot from it. Am Iright?Thanks.-- 
Cheers,dimgel-To
 unsubscribe, e-mail: users-unsubscr...@wicket.apache.orgfor 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



mobile Apllication via Wicket

2010-11-10 Thread Madlip89

Hey everyone,

i must started a apllication with wicket.

This is a Web-Application. A must find out, Who send the Request?
(SmartPhones or Desctop PC)

I started this with a Javascript that's call by "browserdetect". Now I'm
searching a way to realise that's in wicket. Can u help me, from what object
or variable i get this information?

please.

thank u

Madlip 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/mobile-Apllication-via-Wicket-tp3036192p3036192.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: mobile Apllication via Wicket

2010-11-10 Thread Madlip89

woaaahhh that's great man! Thank you very very much!!! u god man!

For other people her is the exemplar:

final ServletWebRequest req = (ServletWebRequest)
RequestCycle.get().getRequest();
final String remoteAddr =
req.getHttpServletRequest().getRemoteAddr(); 
final String platform =
req.getHttpServletRequest().getHeader("User-Agent");
System.out.println("Das kann es sein: " + remoteAddr);
System.out.println("Das kann es sein: " + platform);
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/mobile-Apllication-via-Wicket-tp3036192p3036229.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: For objects out of session, work with directly or use loadable detachable model

2010-11-10 Thread Igor Vaynberg
even though they are in session it is still better to use a detachable
model. if you dont you may end up with the instance in session and in
your page diverging on back button because wicket clones the page with
the page being the root not the session so it wont handle the
reference properly. the rule of thumb is that unless the lifecycle is
managed by the page use a model.

-igor

On Wed, Nov 10, 2010 at 5:32 AM, Brown, Berlin [GCG-PFS]
 wrote:
> For objects that I get from session, I was trying to avoid accessing
> them in the constructor but I wanted to setup my default model so that
> they are pulled on the load method from a loadabledetachable model.
>
> Which approach do you use?  Here are the three approaches,
>
> (The code below is pseudo code, I am typing it out from memory).
>
> ** Scenario 1.  Add a call to the constructor.
>
> public class SomePage extends Page {
>
>   public SomePage() {
>      ...
>      ...
>      final bigSessObjBean = WicketSession.get().getSomeObjBean();  <---
> Access object from session in local constructor method scope.
>      final Form x  = new Form("form", new
> Model(bigSessObjBean)) { <--- Obj bean as default model
>           ...
>      }
>
>     or even...
>
>     final Form x  = new Form("form") {
>           ...
>          onSubmit()  {
>               bigSessObjBean.getData(); < Here, accessing bigSess
> Obj Bean
>          }
>      }
>
>   }
>
> }
>
>
> ** Scenario 2.  Use loadable detachable Model
>
> public class SomePage extends Page {
>
>   public SomePage() {
>      ...
>      ...
>
>     l = new LoadableDetachableModel() {
>        public Bean load() {
>            return WicketSession.get().getSessBeanObj();
>        }
>     };
>     final Form x  = new Form("form", l) {
>           ...
>          onSubmit()  {
>              getDefaultModel().getData(); < Here, accessing bigSess
> Obj Bean
>          }
>      }
>
>   }
>
> }
>
> ** Scenario 3: Call the session get when you need it.
>
>  final Form x  = new Form("form", l) {
>           ...
>          onSubmit()  {
>            WicketSession.get().getSessBeanObj();.getData(); < Here,
> accessing bigSess Obj Bean
>          }
>      }
>
> Berlin Brown (POL)
>

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



Re: Free wicket from component hierarchy hell

2010-11-10 Thread Igor Vaynberg
you guys are both making an argument against queuing, and against
each-other. paradox.

-igor

On Wed, Nov 10, 2010 at 5:08 AM, Carl-Eric Menzel  wrote:
> On Wed, 10 Nov 2010 07:31:28 -0500
> James Carman  wrote:
>
>> On Wed, Nov 10, 2010 at 3:49 AM, Carl-Eric Menzel
>>  wrote:
>> >
>> > So either there is a difference between the forms (different submit
>> > method maybe?), then this move would make a semantic/behavioral
>> > difference and needs to be done in code.
>> >
>>
>> As I said, the two forms edit different values on the same object.
>> Yes, this change would be a semantic/behavioral change, but you could
>> actually do it with just a change in the markup.  It wouldn't require
>> a change to the code.  This is assuming you queue the fields onto the
>> containing panel and not onto the contained forms, which is entirely
>> possible (and even likely).  How many times have you accidentally
>> called add() when you meant to call rowItem.add() in a repeater?  With
>> the queue() method, you wouldn't get an error message saying the
>> markup doesn't match.  It would just figure it out and you'd be none
>> the wiser.
>
> That's exactly my point :-)
>
> This is not a good example to allow queuing, because there's no gain.
> Either there is an important difference between the two forms, then it
> doesn't make sense to queue *above* the forms, or there is no
> difference between the forms, then you can just have *one* form and not
> need queue at all.
>
> By "needs to be done in code" I mean that it is not something that
> should be doable in markup.
>
> Carl-Eric
> www.wicketbuch.de
>
> -
> 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: Free wicket from component hierarchy hell

2010-11-10 Thread Igor Vaynberg
On Wed, Nov 10, 2010 at 1:05 AM, Carl-Eric Menzel  wrote:
> On Tue, 9 Nov 2010 12:16:00 -0800
> Igor Vaynberg  wrote:
>
>> the difficult part is that doing this to complex pages is...difficult.
>> in the example above it is easy to see the two components that need to
>> be renested. but, in complex pages there can be 20 components that
>> need to be renested, and they are probably initially added from a
>> bunch of helper methods that attempted to keep the code clean. so, it
>> may be difficult to find all 20 componets. queuing can make
>> maintenance and refactoring of pages easier.
>
> I can see how it might make it somewhat easier, but it seems to me that
> one is treading on rather thin ice.

well. the thin ice part of the argument remains to be proven. when can
it cause problems? how about some practical examples?

> And speaking of these helper methods: Maybe it's my increasingly
> functional style coming from some exposure to Scala, but I really hate
> it when these methods add stuff behind my back to anything else than
> the component they're returning.

you are explicitly telling it to add things behind your back. the
queue() method does not replace the add(), its an addition. it
operates on a container, so it returns the container back - that makes
sense.

>> yes, ive had to do it plenty times. ive had to go into pages that were
>> already written and ajaxify them. sometimes a table needs to be
>> updated via ajax, it needs to be wrapped in a container. other times a
>> set of related form fields needs to be updated, its easier to wrap
>> them in a container and update it rather then having to add them one
>> by one from multiple places.
>
> But wouldn't such a page be a prime candidate for a proper refactoring
> anyway? I'm getting a "quick & dirty" feeling.

not at all. adding three or four ajax-zones into an existing page does
not warrant a refactor, nor would there be anything to refactor. there
was no need for these things before, they are there purely to
facilitate the new requirement of making something ajaxy.

-igor

>
>> > IMHO valid use cases have not been provided yet.
>>
>> we can agree to disagree
>
> Certainly, especially since you do make some valid arguments.
>
> Carl-Eric
> www.wicketbuch.de
>
> -
> 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: Free wicket from component hierarchy hell

2010-11-10 Thread Igor Vaynberg
i can only hazard a guess, but if i did it would be that "it was the
simplest and cleanest solution that made sense". that is always a good
starting point.

-igor

On Wed, Nov 10, 2010 at 6:19 AM, Frank Silbermann
 wrote:
> What were the reasons for requiring the hierarchies to match in the
> original design of Wicket?
>
> -
> 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: mobile Apllication via Wicket

2010-11-10 Thread Wayne W
We use the excellent wurfl open source project to help us out with devices.


On Wed, Nov 10, 2010 at 3:49 PM, jcgarciam  wrote:
>
> In server side, just check the User-Agent header from your HttpRequest.
>
>
> On Wed, Nov 10, 2010 at 11:41 AM, Madlip89 [via Apache Wicket] <
> ml-node+3036192-1884488973-65...@n4.nabble.com
>> wrote:
>
>> Hey everyone,
>>
>> i must started a apllication with wicket.
>>
>> This is a Web-Application. A must find out, Who send the Request?
>> (SmartPhones or Desctop PC)
>>
>> I started this with a Javascript that's call by "browserdetect". Now I'm
>> searching a way to realise that's in wicket. Can u help me, from what object
>> or variable i get this information?
>>
>> please.
>>
>> thank u
>>
>> Madlip
>>
>> --
>>  View message @
>> http://apache-wicket.1842946.n4.nabble.com/mobile-Apllication-via-Wicket-tp3036192p3036192.html
>> To start a new topic under Apache Wicket, email
>> ml-node+1842946-398011874-65...@n4.nabble.com
>> To unsubscribe from Apache Wicket, click 
>> here.
>>
>>
>>
>
>
> --
> Sincerely,
> JC (http://www.linkedin.com/in/jcgarciam)
> Work smarter, not harder!.
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/mobile-Apllication-via-Wicket-tp3036192p3036212.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: mobile Apllication via Wicket

2010-11-10 Thread jcgarciam

In server side, just check the User-Agent header from your HttpRequest.


On Wed, Nov 10, 2010 at 11:41 AM, Madlip89 [via Apache Wicket] <
ml-node+3036192-1884488973-65...@n4.nabble.com
> wrote:

> Hey everyone,
>
> i must started a apllication with wicket.
>
> This is a Web-Application. A must find out, Who send the Request?
> (SmartPhones or Desctop PC)
>
> I started this with a Javascript that's call by "browserdetect". Now I'm
> searching a way to realise that's in wicket. Can u help me, from what object
> or variable i get this information?
>
> please.
>
> thank u
>
> Madlip
>
> --
>  View message @
> http://apache-wicket.1842946.n4.nabble.com/mobile-Apllication-via-Wicket-tp3036192p3036192.html
> To start a new topic under Apache Wicket, email
> ml-node+1842946-398011874-65...@n4.nabble.com
> To unsubscribe from Apache Wicket, click 
> here.
>
>
>


-- 
Sincerely,
JC (http://www.linkedin.com/in/jcgarciam)
Work smarter, not harder!.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/mobile-Apllication-via-Wicket-tp3036192p3036212.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: Cannot get current page from AjaxPagingNavigator

2010-11-10 Thread jcgarciam

Ohh sorry, now that i read your code carefully i see you have a case of the
Chicken and the Egg!! :)

On Wed, Nov 10, 2010 at 11:30 AM, Juan Carlos Garcia wrote:

> I would change:
>   final Label currentPage = new Label("currentPage", new Model());
>
> to this:
> Label currentPage = new Label("currentPage", new LoadableDetachableModel(){
>  public Object load(){
>   return pagination.getPageable().getCurrentPage() + 1;
>
>
> }
>
> });
>
> and then just remove the last part:
>   currentPage.setDefaultModel(model);
>
> On Wed, Nov 10, 2010 at 5:19 AM, vp143 [via Apache Wicket] <
> ml-node+3035648-2145298352-65...@n4.nabble.com
> > wrote:
>
>> I got it working with the following code- thanks Pedro and JC
>>
>> final Label currentPage = new Label("currentPage", new Model());
>> currentPage.setOutputMarkupId(true);
>> add(currentPage);
>>
>> final AjaxPagingNavigator pagination = new
>> AjaxPagingNavigator("navigator", dataList) {
>> @Override
>> protected void onAjaxEvent(AjaxRequestTarget target) {
>> target.addComponent(currentPage);
>> super.onAjaxEvent(target);
>> }
>> };
>> add(pagination);
>>
>> LoadableDetachableModel model = new LoadableDetachableModel() {
>> public Object load(){
>> return pagination.getPageable().getCurrentPage() + 1;
>> }
>> };
>> currentPage.setDefaultModel(model);
>>
>> It had to be written like this because the model needs pagination which
>> would not have been initialised if written as an inner class when creating
>> the label.
>> Please let me know if anyone finds a better way of writing it.
>>
>> Many thanks again
>> Vishal
>>
>> --
>>  View message @
>> http://apache-wicket.1842946.n4.nabble.com/Cannot-get-current-page-from-AjaxPagingNavigator-tp3034524p3035648.html
>> To start a new topic under Apache Wicket, email
>> ml-node+1842946-398011874-65...@n4.nabble.com
>> To unsubscribe from Apache Wicket, click 
>> here.
>>
>>
>>
>
>
> --
> Sincerely,
> JC (http://www.linkedin.com/in/jcgarciam)
> Work smarter, not harder!.
>
>


-- 
Sincerely,
JC (http://www.linkedin.com/in/jcgarciam)
Work smarter, not harder!.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Cannot-get-current-page-from-AjaxPagingNavigator-tp3034524p3036177.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: onSubmit method and validators

2010-11-10 Thread Henrique
Could it have something to do with the fact that I am using a
CompoundPropoertyModel?
I can't think of a simpler example, here is the code:

public class PublishItem extends WebPage {

   private AddItemForm form;

   public PublishItem() {

   form = new AddItemForm("addItemForm");
   add(form);

   add(new FeedbackPanel("feedback"));
   }

   public final class AddItemForm extends Form {

   private RequiredTextField title;

   public AddItemForm(final String componentName) {

   super(componentName, new
CompoundPropertyModel(new Item()));
   add(new RequiredTextField("title"));
   }

   public void onSubmit() {

   Item item = (Item)getModelObject();

   User user = UserLoggedInSession.get().getUser();
   item.setUser(user);

   ItemDAO.persist(item);
   }
   }
}

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



Re: Cannot get current page from AjaxPagingNavigator

2010-11-10 Thread jcgarciam

I would change:
  final Label currentPage = new Label("currentPage", new Model());

to this:
Label currentPage = new Label("currentPage", new LoadableDetachableModel(){
 public Object load(){
  return pagination.getPageable().getCurrentPage() + 1;

}

});

and then just remove the last part:
  currentPage.setDefaultModel(model);

On Wed, Nov 10, 2010 at 5:19 AM, vp143 [via Apache Wicket] <
ml-node+3035648-2145298352-65...@n4.nabble.com
> wrote:

> I got it working with the following code- thanks Pedro and JC
>
> final Label currentPage = new Label("currentPage", new Model());
> currentPage.setOutputMarkupId(true);
> add(currentPage);
>
> final AjaxPagingNavigator pagination = new
> AjaxPagingNavigator("navigator", dataList) {
> @Override
> protected void onAjaxEvent(AjaxRequestTarget target) {
> target.addComponent(currentPage);
> super.onAjaxEvent(target);
> }
> };
> add(pagination);
>
> LoadableDetachableModel model = new LoadableDetachableModel() {
> public Object load(){
> return pagination.getPageable().getCurrentPage() + 1;
> }
> };
> currentPage.setDefaultModel(model);
>
> It had to be written like this because the model needs pagination which
> would not have been initialised if written as an inner class when creating
> the label.
> Please let me know if anyone finds a better way of writing it.
>
> Many thanks again
> Vishal
>
> --
>  View message @
> http://apache-wicket.1842946.n4.nabble.com/Cannot-get-current-page-from-AjaxPagingNavigator-tp3034524p3035648.html
> To start a new topic under Apache Wicket, email
> ml-node+1842946-398011874-65...@n4.nabble.com
> To unsubscribe from Apache Wicket, click 
> here.
>
>
>


-- 
Sincerely,
JC (http://www.linkedin.com/in/jcgarciam)
Work smarter, not harder!.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Cannot-get-current-page-from-AjaxPagingNavigator-tp3034524p3036168.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: Free wicket from component hierarchy hell

2010-11-10 Thread James Carman
On Wed, Nov 10, 2010 at 8:08 AM, Carl-Eric Menzel  wrote:
>
> That's exactly my point :-)
>
> This is not a good example to allow queuing, because there's no gain.
> Either there is an important difference between the two forms, then it
> doesn't make sense to queue *above* the forms, or there is no
> difference between the forms, then you can just have *one* form and not
> need queue at all.
>
> By "needs to be done in code" I mean that it is not something that
> should be doable in markup.
>

Again, the main point I was making is that with queuing, it is
possible that the markup can be used to change behavior.

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



RE: Free wicket from component hierarchy hell

2010-11-10 Thread Frank Silbermann
What were the reasons for requiring the hierarchies to match in the
original design of Wicket?

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



SV: onSubmit method and validators

2010-11-10 Thread Wilhelmsen Tor Iver
 
> Isn't this the logical place to put this code?

Yes, once all validation has passed, you will want to persist the correct data.

> Once the user leaves out a certain input, onError() is called and
> onSubmit() never gets called again.

Strange, it should be called on the next submit if the user fills it in... is 
the issue that it never accepts the value after that? Remember, you as a coder 
has told the form that the field is required before the data is acceptable. If 
you want the data to be submitted to onSubmit() anyway you need to remove the 
"instruction" to the validator and instead have a check in onSubmit that 
presents a warning that the field really ought to have been filled out..

- Tor Iver


RE: onSubmit method and validators

2010-11-10 Thread Henrique
The business logic is a simple access to a DAO to save what the user
has entered into the form, like so:

   public void onSubmit() {

   Item item = (Item)getModelObject();

   User user = UserLoggedInSession.get().getUser();
   item.setUser(user);
   item.setCategory(selectedCategory);
   item.setTimestamp(new DateTime());
   item.setActive(true);

   ItemDAO.persist(item);
   setResponsePage(UserHomePage.class);
   }

Isn't this the logical place to put this code?
Once the user leaves out a certain input, onError() is called and
onSubmit() never gets called again.

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



SV: onSubmit method and validators

2010-11-10 Thread Wilhelmsen Tor Iver

> The issue I am having is that once this happens, the onSubmit() method
> is no longer called and wicket starts calling the onError() method.

Which is as expected: You usually do not want to process a form that fails 
validation.

> Since my business logic is inside the onSubmit() method, it never gets called.

What business logic do you want to run on invalid form data? Try looking into 
running that code in some of the other lifecycle-oriented methods like 
onBeforeRender() or the like.

- Tor Iver


For objects out of session, work with directly or use loadable detachable model

2010-11-10 Thread Brown, Berlin [GCG-PFS]
For objects that I get from session, I was trying to avoid accessing
them in the constructor but I wanted to setup my default model so that
they are pulled on the load method from a loadabledetachable model.
 
Which approach do you use?  Here are the three approaches,
 
(The code below is pseudo code, I am typing it out from memory).
 
** Scenario 1.  Add a call to the constructor.
 
public class SomePage extends Page {
 
   public SomePage() {
  ...
  ...
  final bigSessObjBean = WicketSession.get().getSomeObjBean();  <---
Access object from session in local constructor method scope.
  final Form x  = new Form("form", new
Model(bigSessObjBean)) { <--- Obj bean as default model
   ...
  }
 
 or even...
 
 final Form x  = new Form("form") {
   ...
  onSubmit()  {  
   bigSessObjBean.getData(); < Here, accessing bigSess
Obj Bean
  }
  }
 
   }
 
}
 
 
** Scenario 2.  Use loadable detachable Model
 
public class SomePage extends Page {
 
   public SomePage() {
  ...
  ...
 
 l = new LoadableDetachableModel() {
public Bean load() {
return WicketSession.get().getSessBeanObj();
}
 };
 final Form x  = new Form("form", l) {
   ...
  onSubmit()  {  
  getDefaultModel().getData(); < Here, accessing bigSess
Obj Bean
  }
  }
 
   }
 
}
 
** Scenario 3: Call the session get when you need it.
 
 final Form x  = new Form("form", l) { 
   ...
  onSubmit()  {  
WicketSession.get().getSessBeanObj();.getData(); < Here,
accessing bigSess Obj Bean
  }
  }
 
Berlin Brown (POL)


Re: Wicket JQuery drag and drop behaviors

2010-11-10 Thread armandoxxx

And I don't .. and that was my main problem :( .. but I got links now ;) 

I tried to find wicket jquery project on wicket stuff and no luck with that
either .. so that's how it all happened :D 

why don't you guys that work on wicket + jquery projects get together and
make one project ? That would make it a lot easier for all of you since
you're making same thing. 

Regards

Armando
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-JQuery-drag-and-drop-behaviors-tp3033676p3035898.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: input type number

2010-11-10 Thread Martijn Dashorst
I'd rather drop this check, or make it configurable (*and* add support
for the new types).

Martijn

On Wed, Nov 10, 2010 at 12:15 PM, Martin Grigorov  wrote:
> Override org.apache.wicket.markup.html.form.TextField.getInputType()
>
> There is a project in trunk/wicketstuff-code/jdk1.6/ for these. It is in
> early state.
>
> On Wed, Nov 10, 2010 at 12:12 PM, Benjamin Lorenz <
> benjamin.lor...@kapowtech.com> wrote:
>
>> Hello,
>>
>> how can I create input fields with input type number (html 5). With
>> TextField, I get "must be applied to a tag with 'type' attribute matching
>> 'text', not 'number'". But there's no NumberField in the Wicket API?! Please
>> help!
>>
>> Best,
>> Benjamin
>>
>>
>



-- 
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: Free wicket from component hierarchy hell

2010-11-10 Thread Carl-Eric Menzel
On Wed, 10 Nov 2010 07:31:28 -0500
James Carman  wrote:

> On Wed, Nov 10, 2010 at 3:49 AM, Carl-Eric Menzel
>  wrote:
> >
> > So either there is a difference between the forms (different submit
> > method maybe?), then this move would make a semantic/behavioral
> > difference and needs to be done in code.
> >
> 
> As I said, the two forms edit different values on the same object.
> Yes, this change would be a semantic/behavioral change, but you could
> actually do it with just a change in the markup.  It wouldn't require
> a change to the code.  This is assuming you queue the fields onto the
> containing panel and not onto the contained forms, which is entirely
> possible (and even likely).  How many times have you accidentally
> called add() when you meant to call rowItem.add() in a repeater?  With
> the queue() method, you wouldn't get an error message saying the
> markup doesn't match.  It would just figure it out and you'd be none
> the wiser.

That's exactly my point :-)

This is not a good example to allow queuing, because there's no gain.
Either there is an important difference between the two forms, then it
doesn't make sense to queue *above* the forms, or there is no
difference between the forms, then you can just have *one* form and not
need queue at all.

By "needs to be done in code" I mean that it is not something that
should be doable in markup.

Carl-Eric
www.wicketbuch.de

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



panel can not be refreshed

2010-11-10 Thread Mehmet.Kaplankiran
Hello,

I have implemented iframe and can view documents. Unfortunately, only in the 
class
MyPdfResource hard-coded filename (example: private string filename = 
"test.pdf";) can be displayed.
The files can not be refreshed. I hope someone can help me.

greetings, Mehmet

HTML:


++ class DocEditPage 
+
public class DocEditPage extends MainTemplate
{

private byte[] file;
private String fileName;
private String contentType;

...
public DocEditPage(PageParameters params)
{
...
add(renderFileContent("mypdf"));
}
...

private MyPdfPanel renderFileContent(String id)
{
return new MyPdfPanel(id, getRenderFileContentModel(), 
getContentTypeModel(), getFileNameModel);
}
...
private IModel getRenderFileContentModel()
{

return new AbstractReadOnlyModel()
{
@Override
public Object getObject()
{
return file;
}
};
}

private IModel getContentTypeModel()
{
return new AbstractReadOnlyModel()
{
@Override
public Object getObject()
{
return contentType;
}
};
}

private IModel getFileNameModel()
{
return new AbstractReadOnlyModel()
{
@Override
public Object getObject()
{
return fileName;
}
};
}

...

private DISTree disTree(String id)
{
return new DISTree(id)
{
@Override
public void selectNode(AjaxRequestTarget target, 
DISTreeNode node)
{
//set file and contentType;
...
DocEditPage.this.contentType = 
content.getContentType();
DocEditPage.this.file = content.getOrbLk();
}
}
}

}

++ class MyPdfPanel 
+
public class MyPdfPanel extends Panel
{

public MyPdfPanel(String id, IModel fileContentModel, IModel 
fileNameModel, IModel contentTypeModel)
{
//super(id, fileContentModel);
super(id);

file = (byte[]) fileContentModel.getObject();
String fileName =  (String) fileNameModel.getObject();
String contentType = (String) contentTypeModel.getObject();
setRenderBodyOnly(true);
add(new DocumentInlineFrame("mypdf", new MyPdfResource(file, 
contentType, fileName)));
}

}

++ class MyPdfResource 
+
public class MyPdfResource extends DynamicWebResource
{
private static final long serialVersionUID = 1L;
...
private byte[] file;
private String contentType = "application/pdf";
private String fileName = "test.pdf";
...
public MyPdfResource(byte[] file, String contenttype, String filename)
{
if (file != null)
this.file = file;
if (contenttype != null && !"".equalsIgnoreCase(contenttype))
contentType = contenttype;
if (filename != null && !"".equalsIgnoreCase(filename))
fileName = filename;
}
...
}




Re: input type number

2010-11-10 Thread Martin Grigorov
Override org.apache.wicket.markup.html.form.TextField.getInputType()

There is a project in trunk/wicketstuff-code/jdk1.6/ for these. It is in
early state.

On Wed, Nov 10, 2010 at 12:12 PM, Benjamin Lorenz <
benjamin.lor...@kapowtech.com> wrote:

> Hello,
>
> how can I create input fields with input type number (html 5). With
> TextField, I get "must be applied to a tag with 'type' attribute matching
> 'text', not 'number'". But there's no NumberField in the Wicket API?! Please
> help!
>
> Best,
> Benjamin
>
>


input type number

2010-11-10 Thread Benjamin Lorenz
Hello,

how can I create input fields with input type number (html 5). With TextField, 
I get "must be applied to a tag with 'type' attribute matching 'text', not 
'number'". But there's no NumberField in the Wicket API?! Please help!

Best,
Benjamin



Tree - component nodeLink not found on page

2010-11-10 Thread Wayne W
Hi,

we recently introduced a extensions.markup.html.tree.Tree component in
our product.
However we're seeing some errors in production where the nodeLink in
the component cannot be found in the page.

In our onNodeLinkClicked we just perform a setResponsePage with a
bookmarkable page.

I've done a lot of searching around this issue and it seems the main
culprits are invalid html or the browser caching something.

However we - alas - cannot reproduce this in any way.

How does this work? - is it basically telling me that that link
(nodeLink) has activity been removed from the page by are code
somewhere, however the url has code our of sync with our state on the
server? is that right?

thanks

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



Re: Free wicket from component hierarchy hell

2010-11-10 Thread Carl-Eric Menzel
On Tue, 9 Nov 2010 12:16:00 -0800
Igor Vaynberg  wrote:

> the difficult part is that doing this to complex pages is...difficult.
> in the example above it is easy to see the two components that need to
> be renested. but, in complex pages there can be 20 components that
> need to be renested, and they are probably initially added from a
> bunch of helper methods that attempted to keep the code clean. so, it
> may be difficult to find all 20 componets. queuing can make
> maintenance and refactoring of pages easier.

I can see how it might make it somewhat easier, but it seems to me that
one is treading on rather thin ice.

And speaking of these helper methods: Maybe it's my increasingly
functional style coming from some exposure to Scala, but I really hate
it when these methods add stuff behind my back to anything else than
the component they're returning.

> yes, ive had to do it plenty times. ive had to go into pages that were
> already written and ajaxify them. sometimes a table needs to be
> updated via ajax, it needs to be wrapped in a container. other times a
> set of related form fields needs to be updated, its easier to wrap
> them in a container and update it rather then having to add them one
> by one from multiple places.

But wouldn't such a page be a prime candidate for a proper refactoring
anyway? I'm getting a "quick & dirty" feeling.

> > IMHO valid use cases have not been provided yet.
> 
> we can agree to disagree

Certainly, especially since you do make some valid arguments.

Carl-Eric
www.wicketbuch.de

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



Re: Free wicket from component hierarchy hell

2010-11-10 Thread Carl-Eric Menzel
On Tue, 9 Nov 2010 12:17:38 -0800
Igor Vaynberg  wrote:

> i wonder if queuing can actually replace icomponentresolver and
> auto-adding. i wonder if after onbeforerender we can do what unqueing
> does now, parse the markup, find any missing components, and insert
> them. autocomponents and autoadd() is something ive always disliked
> because it doesnt work for anything that needs to stick around across
> requests.

I was initially opposed to the "liquid hierarchy" idea, and still do
not like the original proposal. *This* however makes things much more
interesting. I think this may actually be useful.

Initial thoughts about this: What about the assumptions in
onBeforeRender? What are the consequences of having the queued
components available only after that phase?

Carl-Eric
www.wicketbuch.de

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



Re: Wicket JQuery drag and drop behaviors

2010-11-10 Thread Ernesto Reinaldo Barreiro
Armando,

Yes maybe you are right... but if type "wicket jquery " on google on
the first page I get references both jWicket and wiQuery and you can
always resort to ask questions on this list;-)

Ernesto

On Wed, Nov 10, 2010 at 8:44 AM, armandoxxx  wrote:
>
> Just a thought for all you posters that provided wicket + jquery project
> links. These links should also be available on wicket pages .. I googled for
> wicket + jquery implementations before I started to implement my own tiny
> little DnD behaviors, but found only wicket + "other JS libs" pages, so
> these links need to be put somewhere on more visible place ... or be more
> promoted ...
>
> Regards
>
> Armando
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Wicket-JQuery-drag-and-drop-behaviors-tp3033676p3035616.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: Free wicket from component hierarchy hell

2010-11-10 Thread James Carman
On Wed, Nov 10, 2010 at 3:49 AM, Carl-Eric Menzel  wrote:
>
> So either there is a difference between the forms (different submit
> method maybe?), then this move would make a semantic/behavioral
> difference and needs to be done in code.
>

As I said, the two forms edit different values on the same object.
Yes, this change would be a semantic/behavioral change, but you could
actually do it with just a change in the markup.  It wouldn't require
a change to the code.  This is assuming you queue the fields onto the
containing panel and not onto the contained forms, which is entirely
possible (and even likely).  How many times have you accidentally
called add() when you meant to call rowItem.add() in a repeater?  With
the queue() method, you wouldn't get an error message saying the
markup doesn't match.  It would just figure it out and you'd be none
the wiser.

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



Re: Free wicket from component hierarchy hell

2010-11-10 Thread Carl-Eric Menzel
On Tue, 9 Nov 2010 11:49:32 -0500
James Carman  wrote:

> > Are you moving a field from one form to another? But that does
> > change the semantics, doesn't it? If it doesn't, why are there two
> > forms?
> >
> 
> Both forms "edit" one particular object (say a Person).  They just
> edit different values on the same object.  Again, I'm not sure this is
> the best example, but it's at least plausible.

So either there is a difference between the forms (different submit
method maybe?), then this move would make a semantic/behavioral
difference and needs to be done in code.

Or there is no difference at all. Why are there two forms then? Just
use one.

No offense meant, but this does not seem to be a plausible example to
me.

Carl-Eric
www.wicketbuch.de

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



Re: Cannot get current page from AjaxPagingNavigator

2010-11-10 Thread vp143

I got it working with the following code- thanks Pedro and JC

final Label currentPage = new Label("currentPage", new Model());
currentPage.setOutputMarkupId(true);
add(currentPage);

final AjaxPagingNavigator pagination = new
AjaxPagingNavigator("navigator", dataList) {
@Override
protected void onAjaxEvent(AjaxRequestTarget target) {
target.addComponent(currentPage);
super.onAjaxEvent(target);
}
};
add(pagination);

LoadableDetachableModel model = new LoadableDetachableModel() {
public Object load(){
return pagination.getPageable().getCurrentPage() + 1;
}
};
currentPage.setDefaultModel(model);

It had to be written like this because the model needs pagination which
would not have been initialised if written as an inner class when creating
the label.
Please let me know if anyone finds a better way of writing it.

Many thanks again
Vishal
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Cannot-get-current-page-from-AjaxPagingNavigator-tp3034524p3035648.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