Re: Is there a way to search component by its wicket ID ?

2012-08-14 Thread nunofaria11
Hi there,

I'm not really sure if searching a component by its ID is a good idea - It
kinda' breaks modularity and goes against the OO approach. 

I have never searched a component by its ID but assuming you need the full
path (hierarchy) to it, such component will be hard to use in any other
context because you harcoded the path to that component.

Whenever I need to get access to a component I simply store it in a Map or
component List for later search and/or use.

Best regards
nuno





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Is-there-a-way-to-search-component-by-its-wicket-ID-tp4651175p4651221.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: Searching for new experience with wicket

2012-08-13 Thread nunofaria11
Hello there,

I would also be interested in contributing to Wicket. I've recently started
working (recent graduate) and I am now working with technologies such as
Java, Wicket, Hibernate, CSS (messing around with Twitter Bootstrap) and a
little bit of JavaScript and JQuery.

Also I think it would br a great learning opportunity for me =)
I can initially offer 6 to 8h p. week.

What would I need to do?

Best regards.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Searching-for-new-experience-with-wicket-tp465p4651165.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



Generic search form/panel implementation

2012-08-13 Thread nunofaria11
Hi,

I am trying to implement a generic search form/panel in Wicket. The form
should allow searches in several fields in an Entity (using the DAO pattern)
in order to filter the output of a ListView or a DataView. What is the best
way to do this? I've thought of doing this using an extended DataProvider
but I haven't really seen any real example.

Did anyone implemented such a thing? Some pointers would be nice.

Regards
Nuno



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Generic-search-form-panel-implementation-tp4651164.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



Check component onSubmit behavior selects all

2012-06-20 Thread nunofaria11
Hi

I have a problem when submitting a form that has a ListView with a group of
Check components. Everything seems to work fine (checkgroupselector, the
selected collection model gets updated) - but when I submit the form that
contains the checkgroup (in my case, jump between a tab in a TabbedPanel and
go back to the first tab) all Check components appear selected.



...

protected void populateItem(ListItem item) {


final MyClass object = item.getModelObject();

IModel objectModel = item.getModel();


Check check = new Check("check", *objectModel*);

item.add(check);

...




I believe this has something to do with the *objectModel* being added to the
Check component - when submitting somehow the model for selected items sees
the attaching to the Check as a selection behavior.

Does anyone has any directions?

--
Nuno Faria


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Check-component-onSubmit-behavior-selects-all-tp4650124.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: Properly share data model in TabbedPanel

2012-06-20 Thread nunofaria11
Worked like a charm. Thank you everyone.
And for future users who bump into this thread, solved it with this...

TabbedPanel tabbedPanel = new TabbedPanel("tabs", tabs) {

@Override
protected WebMarkupContainer newLink(String linkId, final int
index) {
return new SubmitLink(linkId) {

@Override
public void onSubmit() {
setSelectedTab(index);
}
};
}
};

2012/6/20 Martin Grigorov-4 [via Apache Wicket] <
ml-node+s1842946n4650114...@n4.nabble.com>

> You need to update the value of "coors" somehow before going to the next
> tab.
> As Sven explained clicking on the tab wont submit the form inside a tab
> panel.
> You can submit the form in a tab panel explicitly with its own button.
> You can wrap the tabbed panel in a form and use a SubmitLink to switch
> between the tabs.
>
> On Wed, Jun 20, 2012 at 11:28 AM, nunofaria11 <[hidden 
> email]<http://user/SendEmail.jtp?type=node&node=4650114&i=0>>
> wrote:
>
> > So are you suggesting that I create a form inside each tab-panel? Or a
> form
> > that includes the whole TabbedPanel?
> >
> > 2012/6/20 Sven Meier [via Apache Wicket] <
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=4650114&i=1>>
> >
> >> >  when I click a submit button the data gets refreshed inside the
> model
> >> >  and I can see the changes when I switch tabs, but only then
> >> >  In the second panel there is nothing special, only an AjaxSubmitLink
> >> >  that repaints a WebMarkupContainer.
> >>
> >> TabbedPanel uses links by default, so form values are lost when you
> >> switch tabs.
> >>
> >> You can use SubmitLinks instead, see TabbedPanel#newLink().
> >>
> >> Sven
> >>
> >> On 06/20/2012 12:37 AM, nunofaria11 wrote:
> >>
> >> > That is indeed a useful link. Thank you...
> >> > However, I still get the same behavior
> >> >
> >> > Here is what I have:
> >> >
> >> > public class HomePage extends WebPage {
> >> >
> >> >  private static final long serialVersionUID = 1L;
> >> >  private ArrayList  coords = new ArrayList();
> >> >
> >> >  public HomePage() {
> >> >  final ArrayList tabsList = new ArrayList();
> >> >  final PropertyModel>  model = new
> >> PropertyModel>(this, "coords");
> >> >  tabsList.add(new AbstractTab(new Model("City
> Chooser"))
> >> {
> >> >
> >> >  @Override
> >> >  public WebMarkupContainer getPanel(String string) {
> >> >  return new CitiesPanel(string, model);
> >> >  }
> >> >  });
> >> >
> >> >  tabsList.add(new AbstractTab(new Model("Map Tab")) {
> >> >
> >> >  @Override
> >> >  public WebMarkupContainer getPanel(String string) {
> >> >  CoordsPanel panel = new CoordsPanel(string, model);
> >> >  return panel;
> >> >  }
> >> >  });
> >> >
> >> >  TabbedPanel tabbedPanel = new TabbedPanel("tabs", tabsList);
> >> >  add(tabbedPanel);
> >> >  }
> >> > }
> >> >
> >> > Something weird happens though: in my second panel (CoordsPanel),
> when I
> >> click a submit button the data gets refreshed inside the model and I
> can
> >> see the changes when I switch tabs, but only then - and it is still the
> >> only way I can perform changes in the model.
> >> >
> >> > In the second panel there is nothing special, only an AjaxSubmitLink
> >> that repaints a WebMarkupContainer. Does that have any impact in the
> >> TabbedPanel?
> >> >
> >> >
> >> > A 19/06/2012, às 21:39, Martin Grigorov-4 [via Apache Wicket]
> escreveu:
> >> >
> >> >> it sounds like you are using static models.
> >> >> read about dynamic models at:
> >> >> https://cwiki.apache.org/WICKET/working-with-wicket-models.html
> >> >> On Tue, Jun 19, 2012 at 11:36 PM, nunofaria11<[hidden email]>
>  wrote:
> >> >>
&g

Re: Properly share data model in TabbedPanel

2012-06-20 Thread nunofaria11
So are you suggesting that I create a form inside each tab-panel? Or a form
that includes the whole TabbedPanel?

2012/6/20 Sven Meier [via Apache Wicket] <
ml-node+s1842946n4650096...@n4.nabble.com>

> >  when I click a submit button the data gets refreshed inside the model
> >  and I can see the changes when I switch tabs, but only then
> >  In the second panel there is nothing special, only an AjaxSubmitLink
> >  that repaints a WebMarkupContainer.
>
> TabbedPanel uses links by default, so form values are lost when you
> switch tabs.
>
> You can use SubmitLinks instead, see TabbedPanel#newLink().
>
> Sven
>
> On 06/20/2012 12:37 AM, nunofaria11 wrote:
>
> > That is indeed a useful link. Thank you...
> > However, I still get the same behavior
> >
> > Here is what I have:
> >
> > public class HomePage extends WebPage {
> >
> >  private static final long serialVersionUID = 1L;
> >  private ArrayList  coords = new ArrayList();
> >
> >  public HomePage() {
> >  final ArrayList tabsList = new ArrayList();
> >  final PropertyModel>  model = new
> PropertyModel>(this, "coords");
> >  tabsList.add(new AbstractTab(new Model("City Chooser"))
> {
> >
> >  @Override
> >  public WebMarkupContainer getPanel(String string) {
> >  return new CitiesPanel(string, model);
> >  }
> >  });
> >
> >  tabsList.add(new AbstractTab(new Model("Map Tab")) {
> >
> >  @Override
> >  public WebMarkupContainer getPanel(String string) {
> >  CoordsPanel panel = new CoordsPanel(string, model);
> >  return panel;
> >  }
> >  });
> >
> >  TabbedPanel tabbedPanel = new TabbedPanel("tabs", tabsList);
> >  add(tabbedPanel);
> >  }
> > }
> >
> > Something weird happens though: in my second panel (CoordsPanel), when I
> click a submit button the data gets refreshed inside the model and I can
> see the changes when I switch tabs, but only then - and it is still the
> only way I can perform changes in the model.
> >
> > In the second panel there is nothing special, only an AjaxSubmitLink
> that repaints a WebMarkupContainer. Does that have any impact in the
> TabbedPanel?
> >
> >
> > A 19/06/2012, às 21:39, Martin Grigorov-4 [via Apache Wicket] escreveu:
> >
> >> it sounds like you are using static models.
> >> read about dynamic models at:
> >> https://cwiki.apache.org/WICKET/working-with-wicket-models.html
> >> On Tue, Jun 19, 2012 at 11:36 PM, nunofaria11<[hidden email]>  wrote:
> >>
> >>> By doesn't work I meant the data (inside the model) that was supposed
> to
> >>> change does not change.
> >>>
> >>> 2012/6/19 Martin Grigorov-4 [via Apache Wicket]<
> >>> [hidden email]>
> >>>
> >>>> On Tue, Jun 19, 2012 at 11:26 PM, nunofaria11<[hidden email]<
> http://user/SendEmail.jtp?type=node&node=4650084&i=0>>
> >>>> wrote:
> >>>>> Hi, I am trying to properly share a model between tabs in a
> TabbedPanel.
> >>>>> I've been trying to pass the model to the Panels returned in the
> >>>> getPanel
> >>>>> hook (below), but it seems not to work.
> >>>> "Doesn't work" doesn't explain much.
> >>>> Give us more information/code.
> >>>>
> >>>>>
> >>>>>
> >>>>> tabs.add(new AbstractTab(new Model("Title")) {
> >>>>>
> >>>>>
> >>>>>@Override
> >>>>>
> >>>>>public WebMarkupContainer getPanel(String panelId) {
> >>>>>
> >>>>>  return new MyPanel(panelId, model);
> >>>>>}
> >>>>>
> >>>>> });
> >>>>>
> >>>>> TabbedPanel tabbedPanel = new TabbedPanel("tabs", tabs);
> >>>>>
> >>>>>
> >>>>>
> >>>>> Can someone point me to an example where this is done?
> >>>>>
> >>>>>
> >>>>> --
> >>>>> View this message in context:
> >>>>
> http://apache-wicket.1842946.n4.nabble.com/Properly-sha

Re: Properly share data model in TabbedPanel

2012-06-19 Thread nunofaria11
That is indeed a useful link. Thank you...
However, I still get the same behavior 

Here is what I have:

public class HomePage extends WebPage {

private static final long serialVersionUID = 1L;
private ArrayList coords = new ArrayList();

public HomePage() {
final ArrayList tabsList = new ArrayList();
final PropertyModel> model = new 
PropertyModel>(this, "coords");
tabsList.add(new AbstractTab(new Model("City Chooser")) {

@Override
public WebMarkupContainer getPanel(String string) {
return new CitiesPanel(string, model);
}
});

tabsList.add(new AbstractTab(new Model("Map Tab")) {

@Override
public WebMarkupContainer getPanel(String string) {
CoordsPanel panel = new CoordsPanel(string, model);
return panel;
}
});

TabbedPanel tabbedPanel = new TabbedPanel("tabs", tabsList);
add(tabbedPanel);
}
}

Something weird happens though: in my second panel (CoordsPanel), when I click 
a submit button the data gets refreshed inside the model and I can see the 
changes when I switch tabs, but only then - and it is still the only way I can 
perform changes in the model.

In the second panel there is nothing special, only an AjaxSubmitLink that 
repaints a WebMarkupContainer. Does that have any impact in the TabbedPanel?


A 19/06/2012, às 21:39, Martin Grigorov-4 [via Apache Wicket] escreveu:

> it sounds like you are using static models. 
> read about dynamic models at: 
> https://cwiki.apache.org/WICKET/working-with-wicket-models.html

> 
> On Tue, Jun 19, 2012 at 11:36 PM, nunofaria11 <[hidden email]> wrote:
> 
> > By doesn't work I meant the data (inside the model) that was supposed to 
> > change does not change. 
> > 
> > 2012/6/19 Martin Grigorov-4 [via Apache Wicket] < 
> > [hidden email]> 
> > 
> >> On Tue, Jun 19, 2012 at 11:26 PM, nunofaria11 <[hidden 
> >> email]<http://user/SendEmail.jtp?type=node&node=4650084&i=0>> 
> >> wrote: 
> >> > Hi, I am trying to properly share a model between tabs in a TabbedPanel. 
> >> > I've been trying to pass the model to the Panels returned in the 
> >> getPanel 
> >> > hook (below), but it seems not to work. 
> >> 
> >> "Doesn't work" doesn't explain much. 
> >> Give us more information/code. 
> >> 
> >> > 
> >> > 
> >> > 
> >> > tabs.add(new AbstractTab(new Model("Title")) { 
> >> > 
> >> > 
> >> >   @Override 
> >> > 
> >> >   public WebMarkupContainer getPanel(String panelId) { 
> >> > 
> >> > return new MyPanel(panelId, model); 
> >> >   } 
> >> > 
> >> > }); 
> >> > 
> >> > TabbedPanel tabbedPanel = new TabbedPanel("tabs", tabs); 
> >> > 
> >> > 
> >> > 
> >> > Can someone point me to an example where this is done? 
> >> > 
> >> > 
> >> > -- 
> >> > View this message in context: 
> >> http://apache-wicket.1842946.n4.nabble.com/Properly-share-data-model-in-TabbedPanel-tp4650082.html
> >> > Sent from the Users forum mailing list archive at Nabble.com. 
> >> > 
> >> > - 
> >> > To unsubscribe, e-mail: [hidden 
> >> > email]<http://user/SendEmail.jtp?type=node&node=4650084&i=1> 
> >> > For additional commands, e-mail: [hidden 
> >> > email]<http://user/SendEmail.jtp?type=node&node=4650084&i=2> 
> >> > 
> >> 
> >> 
> >> 
> >> -- 
> >> Martin Grigorov 
> >> jWeekend 
> >> Training, Consulting, Development 
> >> http://jWeekend.com
> >> 
> >> - 
> >> To unsubscribe, e-mail: [hidden 
> >> email]<http://user/SendEmail.jtp?type=node&node=4650084&i=3> 
> >> For additional commands, e-mail: [hidden 
> >> email]<http://user/SendEmail.jtp?type=node&node=4650084&i=4> 
> >> 
> >> 
> >> 
> >> -- 
> >>  If you reply to this email, your message will be added to the discussion 
> >> below: 
> >> 
> >> 
> >> . 
> >>

Re: Properly share data model in TabbedPanel

2012-06-19 Thread nunofaria11
By doesn't work I meant the data (inside the model) that was supposed to
change does not change.

2012/6/19 Martin Grigorov-4 [via Apache Wicket] <
ml-node+s1842946n4650084...@n4.nabble.com>

> On Tue, Jun 19, 2012 at 11:26 PM, nunofaria11 <[hidden 
> email]<http://user/SendEmail.jtp?type=node&node=4650084&i=0>>
> wrote:
> > Hi, I am trying to properly share a model between tabs in a TabbedPanel.
> > I've been trying to pass the model to the Panels returned in the
> getPanel
> > hook (below), but it seems not to work.
>
> "Doesn't work" doesn't explain much.
> Give us more information/code.
>
> >
> >
> >
> > tabs.add(new AbstractTab(new Model("Title")) {
> >
> >
> >   @Override
> >
> >   public WebMarkupContainer getPanel(String panelId) {
> >
> > return new MyPanel(panelId, model);
> >   }
> >
> > });
> >
> > TabbedPanel tabbedPanel = new TabbedPanel("tabs", tabs);
> >
> >
> >
> > Can someone point me to an example where this is done?
> >
> >
> > --
> > View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Properly-share-data-model-in-TabbedPanel-tp4650082.html
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > -
> > To unsubscribe, e-mail: [hidden 
> > email]<http://user/SendEmail.jtp?type=node&node=4650084&i=1>
> > For additional commands, e-mail: [hidden 
> > email]<http://user/SendEmail.jtp?type=node&node=4650084&i=2>
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> To unsubscribe, e-mail: [hidden 
> email]<http://user/SendEmail.jtp?type=node&node=4650084&i=3>
> For additional commands, e-mail: [hidden 
> email]<http://user/SendEmail.jtp?type=node&node=4650084&i=4>
>
>
>
> --
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-wicket.1842946.n4.nabble.com/Properly-share-data-model-in-TabbedPanel-tp4650082p4650084.html
>  To unsubscribe from Properly share data model in TabbedPanel, click 
> here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4650082&code=bnVub2ZhcmlhMTFAZ21haWwuY29tfDQ2NTAwODJ8MzI4MDI5NzAw>
> .
> NAML<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



-- 
Nuno Faria


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Properly-share-data-model-in-TabbedPanel-tp4650082p4650085.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



Properly share data model in TabbedPanel

2012-06-19 Thread nunofaria11
Hi, I am trying to properly share a model between tabs in a TabbedPanel.
I've been trying to pass the model to the Panels returned in the getPanel
hook (below), but it seems not to work.



tabs.add(new AbstractTab(new Model("Title")) {


   @Override

   public WebMarkupContainer getPanel(String panelId) {

 return new MyPanel(panelId, model);
   }

});

TabbedPanel tabbedPanel = new TabbedPanel("tabs", tabs);



Can someone point me to an example where this is done?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Properly-share-data-model-in-TabbedPanel-tp4650082.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: CheckBoxMultipleChoice used in a Wizard Panel

2012-05-17 Thread nunofaria11
Hi there, 
I am having the same problem you had regarding a CheckBoxMultipleChoice used
in a Wizard Panel: the list within the model containing the chosen items is
always empty. Were you able to solve that problem? And if so, how?

Thanks
Nuno

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Adding-a-form-field-at-run-time-is-it-possible-tp1877626p4642679.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: Changing values by reference in child components... is it possible?

2012-05-16 Thread nunofaria11
Actually I was able to do it. It turned out to be pretty simple; very much
like the pseudocode Sven posted.
Thanks

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Changing-values-by-reference-in-child-components-is-it-possible-tp4635008p4641422.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: Changing values by reference in child components... is it possible?

2012-05-16 Thread nunofaria11
Great, Thanks for your reply.

I've looked into it but I didn't find any practical examples of this
specific case.
Can you point me some links or some code on how the model is used outside
and inside the panel.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Changing-values-by-reference-in-child-components-is-it-possible-tp4635008p4641021.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



Changing values by reference in child components... is it possible?

2012-05-15 Thread nunofaria11
Hi everyone,

I am fairly new to Wicket, and probably my question has more to do with Java
than with Wicket, but still I'd like to get some feedback if thats ok.

Lets say that I have a Panel "B" inside a Panel "A"; panel B receives a
parameter from A

PanelA(id){ ... add(new PanelB("B", someVar)) ... }

PanelB(id, someV) { ... someV = anotherValue ... }

what is the best way to communicate to A that the value was changed in B.

I though of using the following: Ajax and AtomicReferences.
Does anyone have any opinion?

Thanks


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Changing-values-by-reference-in-child-components-is-it-possible-tp4635008.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