Re: dynamic markup and components

2012-02-08 Thread Alinoor
Hi Sven,

I came across this stackeroverflow link and tried it but couldn't get the
markupcontainer to load the markup. I'll give it another go...

Alinoor

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-markup-and-components-tp4366970p4368873.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: dynamic markup and components

2012-02-08 Thread Alinoor
Hi,

Managed to get this working by using a Panel instead of a
WebMarkupContainer. Here's the code.


import org.apache.wicket.MarkupContainer;
import org.apache.wicket.markup.IMarkupResourceStreamProvider;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.util.resource.AbstractResourceStream;
import org.apache.wicket.util.resource.IResourceStream;
import org.apache.wicket.util.resource.ResourceStreamNotFoundException;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;

public class WicketHtmlContainer extends Panel implements
IMarkupResourceStreamProvider {
  public WicketHtmlContainer(String id) {
super(id);
Form form = new Form(form);
form.add(new TextField(myinput));
add(form);
  }

  public IResourceStream getMarkupResourceStream(MarkupContainer container,
Class? containerClass) {
System.out.println(calling getMarkupResourceStream());

return new AbstractResourceStream() {

  public InputStream getInputStream() throws
ResourceStreamNotFoundException {
return new ByteArrayInputStream(getHtml().getBytes());
  }

  public void close() throws IOException {
  }
};
  }
  
  private static String getHtml() {
String html =
wicket:panelform wicket:id=\form\ +
my text +
input wicket:id=\myinput\ type=\text\ / +
input type=\submit\ value=\submit\/ +
/form/wicket:panel;
return html;
  }
}

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-markup-and-components-tp4366970p4369176.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: dynamic markup and components

2012-02-08 Thread Alinoor
Andrea, yes, I'm sure I would have come across this problem, so thanks for
the tip.

Alinoor

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-markup-and-components-tp4366970p4370161.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



dynamic markup and components

2012-02-07 Thread Alinoor
Hi everyone,

I want to load some markup stored in a string, this markup also has
references to wicket components that I need to create and then add to
whatever will contain the markup. Is this possible and how can I do this?

  private static String getHtml() {
String html =
form wicket:id=\form\ +
my text +
input wicket:id=\myinput\ type=\input\ / +
input type=\submit\ value=\submit\/ +
/form;
return html;
  }

Cheers,
Alinoor

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-markup-and-components-tp4366970p4366970.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: Generating Dynamic PDF using AjaxFallbackButton

2012-01-07 Thread Alinoor
Hi,

Thanks, the link was helpful.

The difference seems to be that, for ajax requests, a
ResourceStreamRequestHandler needs to be used instead of a
ResourceRequestHandler e.g. 

RequestCycle.get().scheduleRequestHandlerAfterCurrent(new
ResourceStreamRequestHandler(new AResourceStream(), foo.pdf));


Thanks,
Alinoor

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Generating-Dynamic-PDF-using-AjaxFallbackButton-tp4272343p4272422.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: Generating Dynamic PDF using AjaxFallbackButton

2012-01-07 Thread Alinoor
The link helped, thanks!
Alinoor

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Generating-Dynamic-PDF-using-AjaxFallbackButton-tp4272343p4272545.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