Re: visural-wicket 0.6.5 released!

2010-11-25 Thread Mark Doyle
Great library.  I always expected more of these since component creation and
reuse is one of Wickets a key strengths.

What I like about this lib is it's clean and finished.  There is no feeling
of immaturity or of a project that has died off.


On Thu, Nov 25, 2010 at 2:02 PM, alex shubert wrote:

> I must ask it: why did you make such fat header at your page? Did you
> every try to take a look at this in 1600*900 notebook screen?
> All you writings begins in bottom second part of the screen. It is not
> my busenees of course, but why dont you kill that nice picture and
> resize header to just contain "pragmatic" without strong empty white
> line?
>
> Ah, forget it. At least you did not add banner on the top of all of that
>  :)
>
> --
> Best regards
> Alex
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: wicketNewbee Unable to finde Component with ID

2010-11-20 Thread Mark Doyle
I thought that markup was your input html and not the rendered html!

On Tue, Nov 16, 2010 at 3:48 PM, James Carman wrote:

> You need to post your code somewhere for us to see it.  I'm sure it's
> something simple.
>
> On Tue, Nov 16, 2010 at 9:43 AM, JayJay  wrote:
> >
> > I added the href=#...same error.
> > --
> > View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/wicketNewbee-Unable-to-finde-Component-with-ID-tp3043334p3044929.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: wicketNewbee Unable to finde Component with ID

2010-11-16 Thread Mark Doyle
Sure.


   
   
Home
Termine

Mitglieder
Mitglied
werden
Spiel
vereinbaren
Admin
   
   

That should work with your BookmarkablePageLink code.


On Tue, Nov 16, 2010 at 9:58 AM, JayJay  wrote:

>
> Csn you give me an example, please.
>
> regards jayjay
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/wicketNewbee-Unable-to-finde-Component-with-ID-tp3043334p3044425.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: wicketNewbee Unable to finde Component with ID

2010-11-15 Thread Mark Doyle
You still have no wicket:id for the navigation links...

On Mon, Nov 15, 2010 at 6:00 PM, JayJay  wrote:

>
> Thank you for the fast reply.
>
> But that´s probably an error in the board-software.
> The tags have been removed from the software.
>
> here ist the right markup:
>
> http://wicket.apache.org/";>
> 
> Wicket Examples - navomatic
> 
> 
> 
> 
>
>
>
>Fußballverein DLRG
>
> 
>
>
> Home
> Termine
> Mitglieder
> Mitglied werden
> Spiel vereinbaren
> Admin
>
>
> 
>
>
>
>Login
>
>
>
>
>EMail
>
>
>
>Passwort
> type="password">
>
>
>
>Anmelden
>
>
>
>
>
>
>
>test Border on 
>
>
>
>
>created by Julian von
> den Busch
>
>
> 
> 
> 
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/wicketNewbee-Unable-to-finde-Component-with-ID-tp3043334p3043410.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: Need Wicket Book

2010-11-12 Thread Mark Doyle
You don't get royalties? :o


It's a great book by the way, in fact I think it's the perfect book to start
your Wicket career with.

On Thu, Nov 11, 2010 at 2:53 PM, Martijn Dashorst <
martijn.dasho...@gmail.com> wrote:

> On Thu, Nov 11, 2010 at 2:15 PM, Nico Guba  wrote:
> > Wouldn't the imminent release of Wicket 1.5 warrant a second edition?
> > It would be most welcome indeed :)
>
> Writing the second edition would not be on the scale of 'imminent'.
> The first edition took 2 guys roughly 2 years of personal time. Not
> something
> I'd like to repeat soon... If someone would pay me to write the book
> full time... that would be a whole different discussion :)
>
> Martijn
>
> -
> 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-11 Thread Mark Doyle
I don't have any details to add except I say I saw this today too.

I have a page with a lot of ajax panels on that are switched in and out.  If
I refreshed the page without doing anything the session size would grow
continuously.

I also noticed some odd memory size (2.1MB +) related to the
AutoCompleteBehaviour.

I switched back to 1.4.12 and it seems to have disappeared.


EDIT: I still get the large sizes related to the AutoCompleteBehavior
(although not as large) so that's probably something stupid I have done :)

  From session inspector:

   - 
Interface[target:SolrSearchFormPanel$SolrQueryForm$1(basicSearch:searchForm:solrSearchForm:searchKeyword),
   page: org.esa.huginn.webapp.HuginnHomePageV2(32), interface:
   IActivePageBehaviorListener.onRequest]
   -
   
org.apache.wicket.extensions.ajax.markup.html.autocomplete.autocompletebehavio...@191ac0df
   - Session updatedPageMap updated, name: DEFAULT
   - 1.2M


On Thu, Nov 11, 2010 at 7:44 PM, Pedro Santos  wrote:

> Hi guys, can you give a try?
>
>
> https://issues.apache.org/jira/browse/WICKET-3108?focusedCommentId=12931123&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_12931123
>
> On Thu, Nov 11, 2010 at 10:05 AM, Martijn Dashorst <
> martijn.dasho...@gmail.com> wrote:
>
> > It is real, in our application we encountered this as well, but
> > thought it was something we did wrong. Switching to httpsessionstore
> > solved our immediate problem, so we didn't think to investigate
> > further.
> >
> > The culprit might be the commits related to
> > https://issues.apache.org/jira/browse/WICKET-3108
> >
> > If you could, revert those changes in a local wicket copy and see if
> > the problem still persists.
> >
> > Initial investigation shows that it is not easy to reproduce.
> >
> > Martijn
> >
> > On Thu, Nov 11, 2010 at 6:00 AM, Brad Grier 
> > wrote:
> > > 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
> > >
> > >
> >
> >
> >
> > --
> > 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
> >
> >
>
>
> --
> Pedro Henrique Oliveira dos Santos
>


Re: Accessing the cells in a row of a DataTable

2010-10-27 Thread Mark Doyle
I think I may have circumnavigated this issue by discovering the wonders of
AjaxEditableLabel and AjaxEditableChoiceLabel :D

I'll post my results when I've tested it.  Hopefully this will be helpful to
somebody else in the future.

On Wed, Oct 27, 2010 at 10:59 AM, Mark Doyle
wrote:

> Of course, here is the entire Panel constructor:
>
> private DropDownChoice dropdown;
>
> public AjaxDropDownChoicePanel(String id, IModel model,
> IModel> choicesModel) {
> super(id);
> System.out.println("dropdown model = " + model.getObject());
>
> dropdown = new DropDownChoice("dropdown", model, choicesModel);
> dropdown.setOutputMarkupId(true);
> dropdown.add(new AjaxFormComponentUpdatingBehavior("onchange") {
> private static final long serialVersionUID = 1L;
>
> protected void onUpdate(AjaxRequestTarget target) {
> dropdown.setEnabled(false);
> System.err.println("Not yet implemented but you selected " +
> dropdown.getDefaultModelObjectAsString());
> target.addComponent(dropdown);
> }
> });
> add(dropdown);
> }
>
> On Wed, Oct 27, 2010 at 4:54 AM, Jeremy Thomerson <
> jer...@wickettraining.com> wrote:
>
>> Show the code for the dropdownchoice creation (in your panel)
>>
>> On Tue, Oct 26, 2010 at 6:14 PM, Mark Doyle > >wrote:
>>
>> > I suppose this is related so I'll keep the thread going.
>> >
>> > As part of the above use case I have created a custom PropertyColumn
>> that
>> > uses a DropDownChoice.
>> >
>> > Everything seems to be working except for the initial display, this is
>> > always set to "Choose One".
>> >
>> > The code that builds the dropdown is in the populateItem method of the
>> > custom Property Column.  As you can see it has a model set
>> (propertyModel)
>> > which wraps a String.
>> >
>> > PropertyModel propertyModel = new
>> PropertyModel(rowModel,
>> > getPropertyExpression());
>> > System.out.println("propertyModel value = " +
>> propertyModel.getObject());
>> > AjaxDropDownChoicePanel cp = new AjaxDropDownChoicePanel(componentId,
>> > propertyModel, selectionOptionsModel);
>> >
>> > The AjaxDropDownChoicePanel is simply a panel that wraps the DropDown in
>> a
>> > some select tags.  It instantiates a DropDownChoice with the passed in
>> > parameters.  The DropDownChoice is instantiated is of type String, that
>> > is, DropDownChoice.
>> >
>> > NOTE: The syso is printing the expected value.
>> >
>> >
>> >
>> > On Sat, Oct 23, 2010 at 10:18 PM, James Carman
>> > wrote:
>> >
>> > > Use a fragment.  Search this list for my FragmentColumn.  I think I've
>> > > posted it before
>> > > On Oct 23, 2010 4:04 PM, "Mark Doyle" 
>> > > wrote:
>> > > > Ok, I've nearly got this finished.
>> > > >
>> > > > Does anybody know how to add a link in populateItem() that doesn't
>> > render
>> > > as
>> > > > "[cell]"? I could create a customised Panel I suppose but it seems
>> like
>> > > > overkill.
>> > > >
>> > > > Maybe a fragment...hmmm
>> > > >
>> > > >
>> > > > On Fri, Oct 22, 2010 at 11:56 AM, Mark Doyle
>> > > > wrote:
>> > > >
>> > > >> Oh and the table isn't the parent:
>> > > >>
>> > > >> // get the table to rerender
>> > > >> target.addComponent(this.getParent());
>> > > >>
>> > > >> I had to do a six step "parental grab"; I'm sure there is a better
>> > way!
>> > > :D
>> > > >>
>> > > >>
>> > > >>
>> > > >> On Fri, Oct 22, 2010 at 11:54 AM, Mark Doyle <
>> > > markjohndo...@googlemail.com
>> > > >> > wrote:
>> > > >>
>> > > >>> Thanks Mike, this was definitely a great pointer in the right
>> > > direction;
>> > > >>> I'm beginning to grasp the column system now.
>> > > >>>
>> > > >>> I do have some issues though as detailed below.
>> > > >>>
>> > > >>> Firstly, my business model is out of my control so I had to wrap
>>

Re: Accessing the cells in a row of a DataTable

2010-10-27 Thread Mark Doyle
Of course, here is the entire Panel constructor:

private DropDownChoice dropdown;

public AjaxDropDownChoicePanel(String id, IModel model,
IModel> choicesModel) {
super(id);
System.out.println("dropdown model = " + model.getObject());

dropdown = new DropDownChoice("dropdown", model, choicesModel);
dropdown.setOutputMarkupId(true);
dropdown.add(new AjaxFormComponentUpdatingBehavior("onchange") {
private static final long serialVersionUID = 1L;

protected void onUpdate(AjaxRequestTarget target) {
dropdown.setEnabled(false);
System.err.println("Not yet implemented but you selected " +
dropdown.getDefaultModelObjectAsString());
target.addComponent(dropdown);
}
});
add(dropdown);
}

On Wed, Oct 27, 2010 at 4:54 AM, Jeremy Thomerson  wrote:

> Show the code for the dropdownchoice creation (in your panel)
>
> On Tue, Oct 26, 2010 at 6:14 PM, Mark Doyle  >wrote:
>
> > I suppose this is related so I'll keep the thread going.
> >
> > As part of the above use case I have created a custom PropertyColumn that
> > uses a DropDownChoice.
> >
> > Everything seems to be working except for the initial display, this is
> > always set to "Choose One".
> >
> > The code that builds the dropdown is in the populateItem method of the
> > custom Property Column.  As you can see it has a model set
> (propertyModel)
> > which wraps a String.
> >
> > PropertyModel propertyModel = new PropertyModel(rowModel,
> > getPropertyExpression());
> > System.out.println("propertyModel value = " + propertyModel.getObject());
> > AjaxDropDownChoicePanel cp = new AjaxDropDownChoicePanel(componentId,
> > propertyModel, selectionOptionsModel);
> >
> > The AjaxDropDownChoicePanel is simply a panel that wraps the DropDown in
> a
> > some select tags.  It instantiates a DropDownChoice with the passed in
> > parameters.  The DropDownChoice is instantiated is of type String, that
> > is, DropDownChoice.
> >
> > NOTE: The syso is printing the expected value.
> >
> >
> >
> > On Sat, Oct 23, 2010 at 10:18 PM, James Carman
> > wrote:
> >
> > > Use a fragment.  Search this list for my FragmentColumn.  I think I've
> > > posted it before
> > > On Oct 23, 2010 4:04 PM, "Mark Doyle" 
> > > wrote:
> > > > Ok, I've nearly got this finished.
> > > >
> > > > Does anybody know how to add a link in populateItem() that doesn't
> > render
> > > as
> > > > "[cell]"? I could create a customised Panel I suppose but it seems
> like
> > > > overkill.
> > > >
> > > > Maybe a fragment...hmmm
> > > >
> > > >
> > > > On Fri, Oct 22, 2010 at 11:56 AM, Mark Doyle
> > > > wrote:
> > > >
> > > >> Oh and the table isn't the parent:
> > > >>
> > > >> // get the table to rerender
> > > >> target.addComponent(this.getParent());
> > > >>
> > > >> I had to do a six step "parental grab"; I'm sure there is a better
> > way!
> > > :D
> > > >>
> > > >>
> > > >>
> > > >> On Fri, Oct 22, 2010 at 11:54 AM, Mark Doyle <
> > > markjohndo...@googlemail.com
> > > >> > wrote:
> > > >>
> > > >>> Thanks Mike, this was definitely a great pointer in the right
> > > direction;
> > > >>> I'm beginning to grasp the column system now.
> > > >>>
> > > >>> I do have some issues though as detailed below.
> > > >>>
> > > >>> Firstly, my business model is out of my control so I had to wrap
> that
> > > in
> > > a
> > > >>> class that contains the editable state. I don't like doing that it
> > but
> > > it's
> > > >>> useful to see if I can get it to work and it shouldn't effect the
> > > process on
> > > >>> the whole.
> > > >>>
> > > >>> The main difference is I'm attempting to do this using different
> > > columns,
> > > >>> that is, not having a custom column that takes a type and switches.
> > The
> > > >>> problem is that the models for each column seem to wrap different
> > > instances
> > > >>> of the business object.
> > > >>>
> &

Re: Accessing the cells in a row of a DataTable

2010-10-27 Thread Mark Doyle
Of course, here is the entire Panel constructor:

private DropDownChoice dropdown;

public AjaxDropDownChoicePanel(String id, IModel model,
IModel> choicesModel) {
super(id);
System.out.println("dropdown model = " + model.getObject());

dropdown = new DropDownChoice("dropdown", model, choicesModel);
dropdown.setOutputMarkupId(true);
dropdown.add(new AjaxFormComponentUpdatingBehavior("onchange") {
private static final long serialVersionUID = 1L;

protected void onUpdate(AjaxRequestTarget target) {
dropdown.setEnabled(false);
System.err.println("Not yet implemented but you selected " +
dropdown.getDefaultModelObjectAsString());
target.addComponent(dropdown);
}
});
add(dropdown);
}

On Wed, Oct 27, 2010 at 4:54 AM, Jeremy Thomerson  wrote:

> Show the code for the dropdownchoice creation (in your panel)
>
> On Tue, Oct 26, 2010 at 6:14 PM, Mark Doyle  >wrote:
>
> > I suppose this is related so I'll keep the thread going.
> >
> > As part of the above use case I have created a custom PropertyColumn that
> > uses a DropDownChoice.
> >
> > Everything seems to be working except for the initial display, this is
> > always set to "Choose One".
> >
> > The code that builds the dropdown is in the populateItem method of the
> > custom Property Column.  As you can see it has a model set
> (propertyModel)
> > which wraps a String.
> >
> > PropertyModel propertyModel = new PropertyModel(rowModel,
> > getPropertyExpression());
> > System.out.println("propertyModel value = " + propertyModel.getObject());
> > AjaxDropDownChoicePanel cp = new AjaxDropDownChoicePanel(componentId,
> > propertyModel, selectionOptionsModel);
> >
> > The AjaxDropDownChoicePanel is simply a panel that wraps the DropDown in
> a
> > some select tags.  It instantiates a DropDownChoice with the passed in
> > parameters.  The DropDownChoice is instantiated is of type String, that
> > is, DropDownChoice.
> >
> > NOTE: The syso is printing the expected value.
> >
> >
> >
> > On Sat, Oct 23, 2010 at 10:18 PM, James Carman
> > wrote:
> >
> > > Use a fragment.  Search this list for my FragmentColumn.  I think I've
> > > posted it before
> > > On Oct 23, 2010 4:04 PM, "Mark Doyle" 
> > > wrote:
> > > > Ok, I've nearly got this finished.
> > > >
> > > > Does anybody know how to add a link in populateItem() that doesn't
> > render
> > > as
> > > > "[cell]"? I could create a customised Panel I suppose but it seems
> like
> > > > overkill.
> > > >
> > > > Maybe a fragment...hmmm
> > > >
> > > >
> > > > On Fri, Oct 22, 2010 at 11:56 AM, Mark Doyle
> > > > wrote:
> > > >
> > > >> Oh and the table isn't the parent:
> > > >>
> > > >> // get the table to rerender
> > > >> target.addComponent(this.getParent());
> > > >>
> > > >> I had to do a six step "parental grab"; I'm sure there is a better
> > way!
> > > :D
> > > >>
> > > >>
> > > >>
> > > >> On Fri, Oct 22, 2010 at 11:54 AM, Mark Doyle <
> > > markjohndo...@googlemail.com
> > > >> > wrote:
> > > >>
> > > >>> Thanks Mike, this was definitely a great pointer in the right
> > > direction;
> > > >>> I'm beginning to grasp the column system now.
> > > >>>
> > > >>> I do have some issues though as detailed below.
> > > >>>
> > > >>> Firstly, my business model is out of my control so I had to wrap
> that
> > > in
> > > a
> > > >>> class that contains the editable state. I don't like doing that it
> > but
> > > it's
> > > >>> useful to see if I can get it to work and it shouldn't effect the
> > > process on
> > > >>> the whole.
> > > >>>
> > > >>> The main difference is I'm attempting to do this using different
> > > columns,
> > > >>> that is, not having a custom column that takes a type and switches.
> > The
> > > >>> problem is that the models for each column seem to wrap different
> > > instances
> > > >>> of the business object.
> > > >>>
> &

Re: Accessing the cells in a row of a DataTable

2010-10-26 Thread Mark Doyle
I suppose this is related so I'll keep the thread going.

As part of the above use case I have created a custom PropertyColumn that
uses a DropDownChoice.

Everything seems to be working except for the initial display, this is
always set to "Choose One".

The code that builds the dropdown is in the populateItem method of the
custom Property Column.  As you can see it has a model set (propertyModel)
which wraps a String.

PropertyModel propertyModel = new PropertyModel(rowModel,
getPropertyExpression());
System.out.println("propertyModel value = " + propertyModel.getObject());
AjaxDropDownChoicePanel cp = new AjaxDropDownChoicePanel(componentId,
propertyModel, selectionOptionsModel);

The AjaxDropDownChoicePanel is simply a panel that wraps the DropDown in a
some select tags.  It instantiates a DropDownChoice with the passed in
parameters.  The DropDownChoice is instantiated is of type String, that
is, DropDownChoice.

NOTE: The syso is printing the expected value.



On Sat, Oct 23, 2010 at 10:18 PM, James Carman
wrote:

> Use a fragment.  Search this list for my FragmentColumn.  I think I've
> posted it before
> On Oct 23, 2010 4:04 PM, "Mark Doyle" 
> wrote:
> > Ok, I've nearly got this finished.
> >
> > Does anybody know how to add a link in populateItem() that doesn't render
> as
> > "[cell]"? I could create a customised Panel I suppose but it seems like
> > overkill.
> >
> > Maybe a fragment...hmmm
> >
> >
> > On Fri, Oct 22, 2010 at 11:56 AM, Mark Doyle
> > wrote:
> >
> >> Oh and the table isn't the parent:
> >>
> >> // get the table to rerender
> >> target.addComponent(this.getParent());
> >>
> >> I had to do a six step "parental grab"; I'm sure there is a better way!
> :D
> >>
> >>
> >>
> >> On Fri, Oct 22, 2010 at 11:54 AM, Mark Doyle <
> markjohndo...@googlemail.com
> >> > wrote:
> >>
> >>> Thanks Mike, this was definitely a great pointer in the right
> direction;
> >>> I'm beginning to grasp the column system now.
> >>>
> >>> I do have some issues though as detailed below.
> >>>
> >>> Firstly, my business model is out of my control so I had to wrap that
> in
> a
> >>> class that contains the editable state. I don't like doing that it but
> it's
> >>> useful to see if I can get it to work and it shouldn't effect the
> process on
> >>> the whole.
> >>>
> >>> The main difference is I'm attempting to do this using different
> columns,
> >>> that is, not having a custom column that takes a type and switches. The
> >>> problem is that the models for each column seem to wrap different
> instances
> >>> of the business object.
> >>>
> >>> The code below shows how I'm creating the columns. The link in the
> >>> AbstractColumn grabs the business object and toggles editable.
> >>> The EditablePropertyColumn's populateItem method then get's it's
> rowModel
> >>> object (the business object) and checks the editable state. This is
> where
> >>> it goes wrong as each column seems to have it's own copy of the rows
> >>> business model object. I guess this is how the columns with with
> datagrid.
> >>>
> >>> /**
> >>> * Creates the columns for the synonym data table
> >>> *
> >>> * @return
> >>> */
> >>> @SuppressWarnings("serial")
> >>> private List> createColumns() {
> >>> List> columns = new
> >>> ArrayList>();
> >>>
> >>> columns.add(new AbstractColumn(new
> >>> Model("Edit")) {
> >>> public void populateItem(Item>
> >>> cellItem, String componentId, IModel model) {
> >>> AjaxFallbackLink editLink = new
> >>> AjaxFallbackLink(componentId, model) {
> >>> @Override
> >>> public void onClick(AjaxRequestTarget target) {
> >>> EditStateSynonymWrapper selected = (EditStateSynonymWrapper)
> >>> getDefaultModelObject();
> >>> System.out.println("selected value = " +
> selected.wrappedSynonym.value);
> >>> selected.setEditing(!selected.isEditing());
> >>>
> >>> // FIXME WHAT!? There must be a better way than this to get the parent
> >>> table. :D
> >>> MarkupContainer dataTable =
> >>>
> getParent().getParent

Re: Accessing the cells in a row of a DataTable

2010-10-23 Thread Mark Doyle
Ok, I've nearly got this finished.

Does anybody know how to add a link in populateItem() that doesn't render as
"[cell]"?  I could create a customised Panel I suppose but it seems like
overkill.

Maybe a fragment...hmmm


On Fri, Oct 22, 2010 at 11:56 AM, Mark Doyle
wrote:

> Oh and the table isn't the parent:
>
> // get the table to rerender
>  target.addComponent(this.getParent());
>
> I had to do a six step "parental grab"; I'm sure there is a better way! :D
>
>
>
> On Fri, Oct 22, 2010 at 11:54 AM, Mark Doyle  > wrote:
>
>> Thanks Mike, this was definitely a great pointer in the right direction;
>> I'm beginning to grasp the column system now.
>>
>> I do have some issues though as detailed below.
>>
>> Firstly, my business model is out of my control so I had to wrap that in a
>> class that contains the editable state.  I don't like doing that it but it's
>> useful to see if I can get it to work and it shouldn't effect the process on
>> the whole.
>>
>> The main difference is I'm attempting to do this using different columns,
>> that is, not having a custom column that takes a type and switches.  The
>> problem is that the models for each column seem to wrap different instances
>> of the business object.
>>
>> The code below shows how I'm creating the columns.  The link in the
>> AbstractColumn grabs the business object and toggles editable.
>>  The EditablePropertyColumn's populateItem method then get's it's rowModel
>> object (the business object) and checks the editable state.  This is where
>> it goes wrong as each column seems to have it's own copy of the rows
>> business model object.  I guess this is how the columns with with datagrid.
>>
>> /**
>>  * Creates the columns for the synonym data table
>>  *
>>  * @return
>>  */
>> @SuppressWarnings("serial")
>>  private List> createColumns() {
>> List> columns = new
>> ArrayList>();
>>
>> columns.add(new AbstractColumn(new
>> Model("Edit")) {
>>  public void populateItem(Item>
>> cellItem, String componentId, IModel model) {
>>  AjaxFallbackLink editLink = new
>> AjaxFallbackLink(componentId, model) {
>> @Override
>>  public void onClick(AjaxRequestTarget target) {
>> EditStateSynonymWrapper selected = (EditStateSynonymWrapper)
>> getDefaultModelObject();
>>  System.out.println("selected value = " + selected.wrappedSynonym.value);
>> selected.setEditing(!selected.isEditing());
>>
>> // FIXME WHAT!? There must be a better way than this to get the parent
>> table. :D
>> MarkupContainer dataTable =
>> getParent().getParent().getParent().getParent().getParent().getParent();
>>  target.addComponent(dataTable);
>> }
>> };
>>  cellItem.add(editLink);
>> // cellItem.add(new EditLinkFragment(componentId, SynonymAdminPanel.this,
>> model));
>>  }
>> });
>>
>> columns.add(new PropertyColumn(new
>> Model("Category"), "wrappedSynonym.category"));
>>  // columns.add(new EditablePropertyColumn(new
>> Model("State"),
>> // "wrappedSynonym.state", new PropertyModel(this, "selected")));
>>  columns.add(new EditablePropertyColumn(new
>> Model("State"), "wrappedSynonym.state"));
>>  columns.add(new PropertyColumn(new
>> Model("Root"), "wrappedSynonym.root"));
>> columns.add(new PropertyColumn(new
>> Model("Value"), "wrappedSynonym.value"));
>>  columns.add(new PropertyColumn(new
>> Model("Rational"), "wrappedSynonym.rational"));
>>  columns.add(new PropertyColumn(new
>> Model("Taxonomy parent"), "wrappedSynonym.taxonomyParent"));
>>
>> return columns;
>> }
>>
>>
>>
>> On Thu, Oct 21, 2010 at 3:50 PM, Michael O'Cleirigh <
>> michael.ocleir...@rivulet.ca> wrote:
>>
>>>  Hi Mark,
>>>
>>> The cell's of a datatable are created by the IColumn.  So you need to
>>> create a wrapping object or additional IModel that contains the edit-ability
>>> of each row and then use that inside the populateItem(...) method of the
>>> column to figure out which case to show (i.e. the label or the textfield).
>>>
>>> One way to persist the change immediately is to use an
>>> AjaxFormComponentUpdatingBehavior on the onblur event of the textfield to
>>> push the changes thr

Re: Accessing the cells in a row of a DataTable

2010-10-22 Thread Mark Doyle
Oh and the table isn't the parent:
// get the table to rerender
 target.addComponent(this.getParent());

I had to do a six step "parental grab"; I'm sure there is a better way! :D



On Fri, Oct 22, 2010 at 11:54 AM, Mark Doyle
wrote:

> Thanks Mike, this was definitely a great pointer in the right direction;
> I'm beginning to grasp the column system now.
>
> I do have some issues though as detailed below.
>
> Firstly, my business model is out of my control so I had to wrap that in a
> class that contains the editable state.  I don't like doing that it but it's
> useful to see if I can get it to work and it shouldn't effect the process on
> the whole.
>
> The main difference is I'm attempting to do this using different columns,
> that is, not having a custom column that takes a type and switches.  The
> problem is that the models for each column seem to wrap different instances
> of the business object.
>
> The code below shows how I'm creating the columns.  The link in the
> AbstractColumn grabs the business object and toggles editable.
>  The EditablePropertyColumn's populateItem method then get's it's rowModel
> object (the business object) and checks the editable state.  This is where
> it goes wrong as each column seems to have it's own copy of the rows
> business model object.  I guess this is how the columns with with datagrid.
>
> /**
>  * Creates the columns for the synonym data table
>  *
>  * @return
>  */
> @SuppressWarnings("serial")
>  private List> createColumns() {
> List> columns = new
> ArrayList>();
>
> columns.add(new AbstractColumn(new
> Model("Edit")) {
>  public void populateItem(Item>
> cellItem, String componentId, IModel model) {
>  AjaxFallbackLink editLink = new
> AjaxFallbackLink(componentId, model) {
> @Override
>  public void onClick(AjaxRequestTarget target) {
> EditStateSynonymWrapper selected = (EditStateSynonymWrapper)
> getDefaultModelObject();
>  System.out.println("selected value = " + selected.wrappedSynonym.value);
> selected.setEditing(!selected.isEditing());
>
> // FIXME WHAT!? There must be a better way than this to get the parent
> table. :D
> MarkupContainer dataTable =
> getParent().getParent().getParent().getParent().getParent().getParent();
>  target.addComponent(dataTable);
> }
> };
>  cellItem.add(editLink);
> // cellItem.add(new EditLinkFragment(componentId, SynonymAdminPanel.this,
> model));
>  }
> });
>
> columns.add(new PropertyColumn(new
> Model("Category"), "wrappedSynonym.category"));
>  // columns.add(new EditablePropertyColumn(new
> Model("State"),
> // "wrappedSynonym.state", new PropertyModel(this, "selected")));
>  columns.add(new EditablePropertyColumn(new
> Model("State"), "wrappedSynonym.state"));
>  columns.add(new PropertyColumn(new
> Model("Root"), "wrappedSynonym.root"));
> columns.add(new PropertyColumn(new
> Model("Value"), "wrappedSynonym.value"));
>  columns.add(new PropertyColumn(new
> Model("Rational"), "wrappedSynonym.rational"));
>  columns.add(new PropertyColumn(new
> Model("Taxonomy parent"), "wrappedSynonym.taxonomyParent"));
>
> return columns;
> }
>
>
>
> On Thu, Oct 21, 2010 at 3:50 PM, Michael O'Cleirigh <
> michael.ocleir...@rivulet.ca> wrote:
>
>>  Hi Mark,
>>
>> The cell's of a datatable are created by the IColumn.  So you need to
>> create a wrapping object or additional IModel that contains the edit-ability
>> of each row and then use that inside the populateItem(...) method of the
>> column to figure out which case to show (i.e. the label or the textfield).
>>
>> One way to persist the change immediately is to use an
>> AjaxFormComponentUpdatingBehavior on the onblur event of the textfield to
>> push the changes through.
>>
>> Do something like this:
>>
>> class MyColumn extends AbstractColumn {
>>
>>public static enum ColumnType { LINK, COL1, COL2 };
>>
>>private ColumnType type;
>>
>>public MyColumn (IModelheader, ColumnType type) {
>>super (header);
>>this.type = type;
>>}
>>@Override
>>public void populateItem(Item> cellItem,
>>String componentId, IModel rowModel) {
>>
>>
>>switch (this.type) {
>>
>>case LINK :
>>// add in the ajax link to the cell item
>>// inside

Re: Accessing the cells in a row of a DataTable

2010-10-22 Thread Mark Doyle
Thanks Mike, this was definitely a great pointer in the right direction; I'm
beginning to grasp the column system now.

I do have some issues though as detailed below.

Firstly, my business model is out of my control so I had to wrap that in a
class that contains the editable state.  I don't like doing that it but it's
useful to see if I can get it to work and it shouldn't effect the process on
the whole.

The main difference is I'm attempting to do this using different columns,
that is, not having a custom column that takes a type and switches.  The
problem is that the models for each column seem to wrap different instances
of the business object.

The code below shows how I'm creating the columns.  The link in the
AbstractColumn grabs the business object and toggles editable.
 The EditablePropertyColumn's populateItem method then get's it's rowModel
object (the business object) and checks the editable state.  This is where
it goes wrong as each column seems to have it's own copy of the rows
business model object.  I guess this is how the columns with with datagrid.

/**
 * Creates the columns for the synonym data table
 *
 * @return
 */
@SuppressWarnings("serial")
private List> createColumns() {
List> columns = new
ArrayList>();

columns.add(new AbstractColumn(new
Model("Edit")) {
 public void populateItem(Item>
cellItem, String componentId, IModel model) {
AjaxFallbackLink editLink = new
AjaxFallbackLink(componentId, model) {
@Override
public void onClick(AjaxRequestTarget target) {
EditStateSynonymWrapper selected = (EditStateSynonymWrapper)
getDefaultModelObject();
System.out.println("selected value = " + selected.wrappedSynonym.value);
selected.setEditing(!selected.isEditing());

// FIXME WHAT!? There must be a better way than this to get the parent
table. :D
MarkupContainer dataTable =
getParent().getParent().getParent().getParent().getParent().getParent();
target.addComponent(dataTable);
}
};
cellItem.add(editLink);
// cellItem.add(new EditLinkFragment(componentId, SynonymAdminPanel.this,
model));
}
});

columns.add(new PropertyColumn(new
Model("Category"), "wrappedSynonym.category"));
// columns.add(new EditablePropertyColumn(new
Model("State"),
// "wrappedSynonym.state", new PropertyModel(this, "selected")));
columns.add(new EditablePropertyColumn(new
Model("State"), "wrappedSynonym.state"));
columns.add(new PropertyColumn(new
Model("Root"), "wrappedSynonym.root"));
columns.add(new PropertyColumn(new
Model("Value"), "wrappedSynonym.value"));
columns.add(new PropertyColumn(new
Model("Rational"), "wrappedSynonym.rational"));
columns.add(new PropertyColumn(new
Model("Taxonomy parent"), "wrappedSynonym.taxonomyParent"));

return columns;
}



On Thu, Oct 21, 2010 at 3:50 PM, Michael O'Cleirigh <
michael.ocleir...@rivulet.ca> wrote:

>  Hi Mark,
>
> The cell's of a datatable are created by the IColumn.  So you need to
> create a wrapping object or additional IModel that contains the edit-ability
> of each row and then use that inside the populateItem(...) method of the
> column to figure out which case to show (i.e. the label or the textfield).
>
> One way to persist the change immediately is to use an
> AjaxFormComponentUpdatingBehavior on the onblur event of the textfield to
> push the changes through.
>
> Do something like this:
>
> class MyColumn extends AbstractColumn {
>
>public static enum ColumnType { LINK, COL1, COL2 };
>
>private ColumnType type;
>
>public MyColumn (IModelheader, ColumnType type) {
>super (header);
>this.type = type;
>}
>@Override
>public void populateItem(Item> cellItem,
>String componentId, IModel rowModel) {
>
>
>switch (this.type) {
>
>case LINK :
>// add in the ajax link to the cell item
>// inside the onclick do:
>// get the row model object and then set its editable field.
>cellItem.add(new AjaxLink(componentId) {
>public void onClick(AjaxRequestTarget target) {
>  BusinessObject bo = rowModel.getObject();
>
>
>   bo.setEditable(true);
>// get the table to rerender
>target.addComponent(this.getParent());
>}
>});
>
>break;
>
>case COL1:
>case COL2:
>
>BusinessObject bo = rowModel.getObject();
>
>
>if (bo.isEditable()) {
>// this might not work as textfield wants an input
> tag but you can put the field on a panel and then add in the panel here.
>cellItem.add (new TextField(componentId, )
>}
>else {
>cellItem.add(new Label(componentId, ...)
>}
>
>}
>
>}
> };
>
> Regards,
>
> Mike
>
>  Hi all,
>>
>

Accessing the cells in a row of a DataTable

2010-10-21 Thread Mark Doyle
Hi all,

I'm having a bit of trouble wrapping my head around the DataTable with
regards to what I need to do.

The perfect example of my goal is in Wicket Examples, namely, the Ajax
Editable Tree Table:
http://wicketstuff.org/wicket14/ajax/tree/table/editable.0

Rather than use
the Tree table I must alter an existing DataTable.  I was thinking that
I could create an editable textfield for the cells which I could enable or
disable using an edit link in the first column.

A bit like this:

Edit | col1 | col2

edit | text  | ksfuh
-
edit | text  | fsdkl

Using the edit link I can get the model object of the row but I'm not sure
how I can get the row that represents this and set it's cells to editable.

The Editable text field is much like the one in the example and with the
entire table wrapped in a form.  This means I can deal with the submission
of the changes easy enough.


Perhaps this is the wrong way to go about ithmmm, thoughts?


Re: Trouble creating a behaviour that adds JS and also a Body onLoad event

2010-07-31 Thread Mark Doyle
Yeah, I actually messed up the behaviour because I never noticed the
rendOnLoad method.

I've done as you suggested in the behaviour and then simply added that to
the component.  It works perfectly, thanks Martin.


The progression to more advanced Wicket certainly requires more web specific
knowledge that Wicket has shielded me from in the past :)


On Sat, Jul 31, 2010 at 12:48 PM, Martin Makundi <
martin.maku...@koodaripalvelut.com> wrote:

> Headercontribution can be added to many things ...
>
> 2010/7/31 Mark Doyle :
> > Ah ok, I'll test that.  I never thought of just adding it to the Page.
> >
> >
> > What, if any, is the difference between this and adding the behaviour to
> the
> > WebPage which is a kind of Component?
> >
> >
> > On Fri, Jul 30, 2010 at 7:03 PM, Martin Makundi <
> > martin.maku...@koodaripalvelut.com> wrote:
> >
> >> Hi!
> >>
> >> You could try this:
> >>
> >> public class HomePage extends WebPage implements IHeaderContributor {
> >>  @Override
> >>  public void renderHead(IHeaderResponse response) {
> >>response.renderOnLoadJavascript(javascript)
> >>  }
> >>
> >>
> >> **
> >> Martin
> >>
> >> 2010/7/30 Mark Doyle :
> >> > Firstly, I'm having some trouble finding a decent behaviour tutorial.
>  If
> >> > anybody knows of one post a link up.
> >> >
> >> > Now, the problem I am having is creating a behaviour that adds some JS
> to
> >> > the head and sets an onLoad method.  The JS project instructs users to
> >> add:
> >> >
> >> > 
> >> >
> >> > but I'm not sure how Wicket supports this.
> >> >
> >> > Any ideas?
> >> >
> >> > Cheers
> >> >
> >>
> >> -
> >> 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: Trouble creating a behaviour that adds JS and also a Body onLoad event

2010-07-31 Thread Mark Doyle
Ah ok, I'll test that.  I never thought of just adding it to the Page.


What, if any, is the difference between this and adding the behaviour to the
WebPage which is a kind of Component?


On Fri, Jul 30, 2010 at 7:03 PM, Martin Makundi <
martin.maku...@koodaripalvelut.com> wrote:

> Hi!
>
> You could try this:
>
> public class HomePage extends WebPage implements IHeaderContributor {
>  @Override
>  public void renderHead(IHeaderResponse response) {
>response.renderOnLoadJavascript(javascript)
>  }
>
>
> **
> Martin
>
> 2010/7/30 Mark Doyle :
> > Firstly, I'm having some trouble finding a decent behaviour tutorial.  If
> > anybody knows of one post a link up.
> >
> > Now, the problem I am having is creating a behaviour that adds some JS to
> > the head and sets an onLoad method.  The JS project instructs users to
> add:
> >
> > 
> >
> > but I'm not sure how Wicket supports this.
> >
> > Any ideas?
> >
> > Cheers
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Trouble creating a behaviour that adds JS and also a Body onLoad event

2010-07-30 Thread Mark Doyle
Firstly, I'm having some trouble finding a decent behaviour tutorial.  If
anybody knows of one post a link up.

Now, the problem I am having is creating a behaviour that adds some JS to
the head and sets an onLoad method.  The JS project instructs users to add:



but I'm not sure how Wicket supports this.

Any ideas?

Cheers


Sub tabs in Tabbed Panel

2010-07-23 Thread Mark Doyle
Hi all,

Is there a component that will allows me to add a "subset" of panel
links to a Tabbed panel which themselves link to new panels?

Perhaps an example of the finished article would explain it better :)
http://www.webdesignerwall.com/tutorials/css3-dropdown-menu/

I guess some tab links would change the panel whilst others would need
a rollover effect that displays the sub-tab link.  The sub tab links
would then behave as normal tabs.


If there is nothing out there already I guess hacking up an extended
TabbedPanel is the only course of action!

Cheers

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



Re: Best way to hide a component

2010-07-23 Thread Mark Doyle
Yeah, I do something similar.

You can override the isVisible method in your components, possibly
adding some logic that ties the visibility to a variable.  You only
have to manage the one variable then and all the components will know
when to display or not.

On Fri, Jul 23, 2010 at 9:02 AM, Nivedan Nadaraj  wrote:
> I have done the setVisible too for hiding components. Sometimes if there
> were a group of them, placing them in a container(WebMarkupContainer)
> and setting the visibility to t/f on the container works too.
>
> Cheers
> Niv
>
>
> On Fri, Jul 23, 2010 at 2:36 PM, Andrea Selva  wrote:
>
>> Hi,
>> Instead of switching between components, i think that using the setVisible
>> method of component class could be a better solution. This is the principle
>> i read in the in Wicket in Action book when the want to hide a container of
>> other thing.
>> I hope this could help you
>>  Andrea
>>
>> On Thu, Jul 22, 2010 at 11:22 PM, mgoodson 
>> wrote:
>>
>> >
>> > Hi, this could be a stupid question but I am just wondering what the best
>> > way
>> > is to hide a component.
>> > Say I have a button on a form and when it renders sometimes I want it to
>> > show and some times not.
>> > I could either use 2 fragments, one with the button in it and one that's
>> > empty and switch between the two. Or the other option that I can think of
>> > is
>> > to turn the visibility on and off.
>> > Anyone got any reasons for or against with option?
>> > Thanks
>> > --
>> > View this message in context:
>> >
>> http://apache-wicket.1842946.n4.nabble.com/Best-way-to-hide-a-component-tp2299412p2299412.html
>> > Sent from the Wicket - User 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