How to write unicode in Response.write(unidcode)?

2008-03-02 Thread Kevin Liu
Hi£¡
Can I write unicode in Respose?
just like, Response response = request.getResponse();
response.write(UNICODE here...);
Thanks a lot! :-


-Kevin Liu
   
-
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

Re: How to write Json response in the AbstractDefaultAjaxBehavior.response(ajaxtarget)

2008-01-14 Thread Kevin Liu
Thank you , it works!

Igor Vaynberg [EMAIL PROTECTED] wrote: getrequestcycle().setrequesttarget(new 
irequesttarget() {
respond(response r) { r.write(...); }});

-igor


On Jan 14, 2008 6:43 PM, Kevin Liu  wrote:
 Hi guys!
  could you tell me how to write json response in the 
 AbstractDefaultAjaxBehavior.response(ajaxtarget) method?
  my code :
 ...
 Response response = getResponse(); 
 response.write({totalProperty:100,root:[{id:0,name:'name0',descn:'descn0'},]});
 ...
 but the response is like this:

 {totalProperty:100,root:[{id:0,name:'name0',descn:'descn0'},]}

 
 how can I remove the
 





 -Kevin Liu

 -
 Never miss a thing.   Make Yahoo your homepage.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-Kevin Liu
   
-
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

DataProvider.size() problem

2007-11-12 Thread Kevin Liu
Hi! guys
   
  I have a defaultDataTable in a form,   and the dataTable uses 
SortableDataProvider,  
   
   when the submit button clicked, the selected rows will be deleted. 
   
  The problem is the  sortableDataProvider.size() excute before button.submit()
   
  as a result
   
   the total number of the data that navigationlabel displays is wrong..  
   


-Kevin Liu
   
-
Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how.

Re: how to use LinkTree in frame

2007-10-16 Thread Kevin Liu
Thank Igor :-)
  But if I wanna change the tree behavior, such as expanding the Node when the 
node is clicked as the junction link is clicked. So  I have to invoke 
updateTree(target); The ajaxLink seems to be the only choice.:-(
   
   
  
Igor Vaynberg [EMAIL PROTECTED] wrote:
  you have to override the method that generates the link and replace it with
a BookmarkablePageLink

-igor


On 10/15/07, Kevin Liu wrote:

 The question may be how ajaxLink be bookmarkable:
 the code below absolutely does not work fine:

 pageLink = new AjaxLink(id){
 private static final long serialVersionUID = 3332246227467032288L;
 public void onClick(AjaxRequestTarget target){
 //..
 setResponsePage(Destination.class);
 updateTree(target);

 }

 };
 pageLink.add(new AttributeModifier(target,true,new
 Model(right)));

 Kevin Liu wrote:
 Could someone tell me how to use LinkTree in the left frame and the
 target of the links in the tree is the right frame??
 Thanks a lot~


 -Kevin Liu

 -
 Be a better Heartthrob. Get better relationship answers from someone who
 knows.
 Yahoo! Answers - Check it out.


 -Kevin Liu

 -
 Looking for a deal? Find great prices on flights and hotels with Yahoo!
 FareChase.



-Kevin Liu
   
-
Building a website is a piece of cake. 
Yahoo! Small Business gives you all the tools to get online.

Session Time out after Adding RadioGroup column to DataTable

2007-09-23 Thread Kevin Liu
After I succeed in adding RadioGroup column to DataTable,  something causes 
session 
   
  time out. But it haven't happend when I used CheckBox instead of Radio. Thank 
you for your help.
   
  wicket:panel
 span wicket:id=radioGroup
  table class=dataview cellspacing=0 wicket:id=dataview[table]/table
 /span
/wicket:panel
   
  public class RadioChoiceTablePanel extends Panel {
   private static final long serialVersionUID = -7634745013490186318L;

 private Object object = new Object();

 private RadioGroup radioGroup = new RadioGroup(radioGroup, new 
PropertyModel(this, object));
 
 protected ListAbstractColumn tableColumns = new ArrayListAbstractColumn();
  
 public RadioChoiceTablePanel(String id, ListAbstractColumn columns,
   ISortableDataProvider dataProvider, Form form,
   ListAbstractAction actions, int pageSize) {
super(id);
  
  if (form != null) {
   tableColumns.add(makeChoiceColumns());
  }
tableColumns.addAll(columns);
if (actions != null) {
   tableColumns.add(makeActionsColumn(actions));
  }
this.addComponenets(dataProvider, pageSize);
  
 } 
   /* 
  * @see 
com.cmip.web.components.AbstractTablePanel#makeActionsColumn(java.util.List)
  */
 protected AbstractColumn makeActionsColumn(final ListAbstractAction actions) 
{
  return new AbstractColumn(new Model(Choices)) {
 private static final long serialVersionUID = -8344906560719618815L;
 public void populateItem(Item cellItem, String componentId, final IModel 
model) {
cellItem.add(new ActionsPanel(componentId, actions, model
  .getObject()));
   }
  };
 }
   protected void onBeforeRender() {
  super.onBeforeRender();
 }
 /*  
  * @see com.cmip.web.components.AbstractTablePanel#makeChoiceColumns()
  */
 protected AbstractColumn makeChoiceColumns() {
  return new AbstractColumn(new Model(Actions)) {
   private static final long serialVersionUID = -8344906560719618814L;
 public void populateItem(Item cellItem, String componentId, IModel model) {
RadioPanel radio = new RadioPanel(componentId, model);
radioGroup.add(radio);
cellItem.add(radio);
   }
  };
 }
   /*  
  * @see 
com.cmip.web.components.AbstractTablePanel#addComponenets(org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider,
 int)
  */
 protected void addComponenets(ISortableDataProvider dataProvider, int 
pageSize) {
  radioGroup.add(new DefaultDataTable(dataview, tableColumns,
dataProvider, pageSize));
  this.add(radioGroup);
 }
   /*  
  * @see com.cmip.web.components.AbstractTablePanel#getSelectedItem()
  */
 public Object getSelectedItem(){
//  Object returnValue = this.radioGroup.getModelObject();
  return getObject();
 }
 
 /**
  * @return object
  */
 public Object getObject() {
  return object;
 }
   /**
  * @param object
  */
 public void setObject(Object object) {
  this.object = object;
 }
 
}



-Kevin Liu
   
-
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, 
photos  more. 

How to add RadioGroup column to DataTable?

2007-09-20 Thread Kevin Liu
Hi!
   
  Could you tell me how to add RadioGroup column to DataTable ?
   
  Thank you very much!


-Kevin Liu
   
-
Be a better Heartthrob. Get better relationship answers from someone who knows.
Yahoo! Answers - Check it out. 

Re: How to add RadioGroup column to DataTable?

2007-09-20 Thread Kevin Liu
Hi! Igor 
  There is something wrong with The Radios:
   
  RadioPanel.java:
  import org.apache.wicket.markup.html.form.Radio;
import org.apache.wicket.markup.html.form.RadioGroup;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
  public class RadioPanel extends Panel {
 
 private static final long serialVersionUID = 4309638869668046608L;
   public RadioPanel(String id, IModel model){
  super(id);
  RadioGroup radioGroup = new RadioGroup(radioGroup);
  Radio radio = new Radio(radio, model);
  radioGroup.add(radio);
  this.add(radioGroup);
 }
}
   
  Html:
  wicket:panel
 span wicket:id=radioGroup
  input type=radio wicket:id=radio/
 /span
/wicket:panel

   
  and I use it in this way:
  private AbstractColumn makeChioceColumn() {
  return new AbstractColumn(new Model(Choice))){
   private static final long serialVersionUID = -8344906560719618814L;
 public void populateItem(Item cellItem, String componentId, IModel model){
RadioPanel radioPanel = new RadioPanel(componentId, model);

cellItem.add(radioPanel);

   }
  };
 }
   
  Thank you!
Igor Vaynberg [EMAIL PROTECTED] wrote:
  create a panel, and put the radiogroup in to it. then extend abstractcolumn
and in populatecolumn create the instance of your panel and add it.

-igor


On 9/20/07, Kevin Liu wrote:

 Hi!

 Could you tell me how to add RadioGroup column to DataTable ?

 Thank you very much!


 -Kevin Liu

 -
 Be a better Heartthrob. Get better relationship answers from someone who
 knows.
 Yahoo! Answers - Check it out.



-Kevin Liu
   
-
Yahoo! oneSearch: Finally,  mobile search that gives answers, not web links. 

How to create my own components with HiddenFiled and TextField

2007-09-13 Thread Kevin Liu
Hi!
  I wanna create my own components with HiddenField and TextField
  This is HTML:
  wicket:panel
input type=hidden wicket:id=hiddenFiled/input
input type=text wicket:id=displayField/input
/wicket:panel
   
  But I have no idea about which kind of IModel to use to bind a POJO. 
  Thank you~


-Kevin Liu
   
-
Moody friends. Drama queens. Your life? Nope! - their life, your story.
 Play Sims Stories at Yahoo! Games. 

Re: How to handle these nested table tags

2007-09-10 Thread Kevin Liu
Thank you for your help!  But the major problem is The Label Is Not at the same 
level as the form , the Label is deep inside those table tags. Is there any 
solution to this kind of problem.  
Thanks again~
Kevin Liu [EMAIL PROTECTED] wrote:  I have a html page that displays welcome 
,XXX ,or something like that, the XXX is the current user name, and I use 
Label to display it. But there is an exception when it runs.

Unable to find component with id 'userName' in [MarkupContainer [Component id = 
_relative_path_prefix_14, page = com.cmip.web.pages.TopFrame, path = 
3:topForm:_relative_path_prefix_13:_relative_path_prefix_14.WebMarkupContainer, 
isVisible = true, isVersioned = true]]. This means that you declared 
wicket:id=userName in your markup, but that you either did not add the 
component to your page at all, or that the hierarchy does not match.


The code:
public TopFrame(){
super();
String name = ((CMIPSession)this.getSession()).getUser().getUserName();
Label userName = new Label(userName,new Model(name));
Form topForm = new Form(topForm);
topForm.add(userName);
this.add(topForm);


html:


  
  

  
   
  
  

  °æ±¾ºÅ£ºV1.0

  
  
  






  

  

  
  

  
  

  


  
  


   
  
¡¡ Welcome 







  
   updateTime();
  




-Kevin Liu

-
Pinpoint customers who are looking for what you sell. 


-Kevin Liu
   
-
Pinpoint customers who are looking for what you sell.