You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by metalotus <me...@hotmail.com> on 2008/10/03 03:11:53 UTC
URL to fetch one component
Hi,
I would like to return the markup of a rendered wicket component when
accessing a certain URL. I do not want to return a page, only one single
component in that page (like how AJAX works, kinda).
Here is my plan:
- Handle the Request
- Create a new component
- Add it to the page
- Call component.renderComponent();
- Somehow get a stream from MarkupContainer.getMarkupStream()
- Use Response.write(InputStream) to return the component markup.
Will that work in your experience?
--
View this message in context: http://www.nabble.com/URL-to-fetch-one-component-tp19790610p19790610.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
DefaultDataTable attached to a model in a form
Posted by "Pablo S." <ps...@hotmail.com>.
Hi, I have a form with some fields attached to some properties of a model,
so when I change the model all the fields also changes. Up to that
everything goes perfect, the problem I'm having is that I need to maintain a
DefaultDataTable in the form with the data of a list that the model has. I
don't know how to fill that table with the list property of the model.
Here I paste the code:
public InvoiceForm(String name, InvoiceModel model){
super(name, new CompoundPropertyModel<InvoiceModel>(model));
TextField<String> orderNumber = new TextField<String>("number", new
PropertyModel<String>(model, "number"));
add(orderNumber);
TextField<String> customerTxt = new TextField<String>("customerStr",
new PropertyModel<String>(model, "customerStr"));
add(customerTxt);
TextField<String> totalTxt = new TextField<String>("total", new
PropertyModel<String>(model, "total"));
add(totalTxt);
List<IColumn<?>> columns = new ArrayList<IColumn<?>>();
columns.add(new PropertyColumn(new Model<String>("Name"), "name")); columns.add(new DateColumn(new Model<String>("Upload Date"), "uploadDate", "uploadDate"));
columns.add(new PropertyColumn(new Model<String>("Quote"), "quote",
"quote"));
List<Document> docs = model.getDocuments();
DefaultDataTable table = new DefaultDataTable("items", columns, new
SortableDocumentDataProvider(docs), 8);
add(table);
}
The way I'm linking the table with the form is wrong, I would like to know
how I can solved this
Thanks
Pablo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: URL to fetch one component
Posted by metalotus <me...@hotmail.com>.
ok, thanks for the tip
igor.vaynberg wrote:
>
> much easier to create a generic page that can contain any component,
> add it to there, and render the page
>
> -igor
>
> On Thu, Oct 2, 2008 at 6:11 PM, metalotus <me...@hotmail.com> wrote:
>>
>> Hi,
>>
>> I would like to return the markup of a rendered wicket component when
>> accessing a certain URL. I do not want to return a page, only one single
>> component in that page (like how AJAX works, kinda).
>>
>> Here is my plan:
>> - Handle the Request
>> - Create a new component
>> - Add it to the page
>> - Call component.renderComponent();
>> - Somehow get a stream from MarkupContainer.getMarkupStream()
>> - Use Response.write(InputStream) to return the component markup.
>>
>> Will that work in your experience?
>> --
>> View this message in context:
>> http://www.nabble.com/URL-to-fetch-one-component-tp19790610p19790610.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/URL-to-fetch-one-component-tp19790610p19790766.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: URL to fetch one component
Posted by Igor Vaynberg <ig...@gmail.com>.
much easier to create a generic page that can contain any component,
add it to there, and render the page
-igor
On Thu, Oct 2, 2008 at 6:11 PM, metalotus <me...@hotmail.com> wrote:
>
> Hi,
>
> I would like to return the markup of a rendered wicket component when
> accessing a certain URL. I do not want to return a page, only one single
> component in that page (like how AJAX works, kinda).
>
> Here is my plan:
> - Handle the Request
> - Create a new component
> - Add it to the page
> - Call component.renderComponent();
> - Somehow get a stream from MarkupContainer.getMarkupStream()
> - Use Response.write(InputStream) to return the component markup.
>
> Will that work in your experience?
> --
> View this message in context: http://www.nabble.com/URL-to-fetch-one-component-tp19790610p19790610.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org