How to customize error message in SignInPanel

2008-09-23 Thread wiki

Does any one knows how to customize error message "login failed" to our own
message using SignInPanel.
In my project  I am using acegi so I want two different messages 
1 for user whose account is locked 
2 for user whose account is active but password or email entered wrong

Thanks 

-- 
View this message in context: 
http://www.nabble.com/How-to-customize-error-message-in-SignInPanel-tp19624142p19624142.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



How to get Image with Hibernate Spring Based Application

2008-08-10 Thread wiki

Hi I have this code for getting property list from database but I don't know
how to display Image property  [CODE prop.hbm.xml]   [CODE]with ListView using
compound property model. I got some code from Kent Tong book but don't know
how to use compound property model for images.
Thanks in Advance to Igor If you could give some idea.
 ListView view=new ListView("propertyViews",list)
{
protected void populateItem(ListItem item)
{
final Property property=(Property)item.getModelObject();
item.setModel(new CompoundPropertyModel(property));
item.add(new Label("city"));
item.add(new Label("propertyAddress"));
item.add(new Label("price"));
item.add(new Label("bedrooms"));

/*Resource resource = new WebResource()
{
public IResourceStream getResourceStream()
{
IResourceStream stream = new FileResourceStream(new
File(
"" + "null id" + ".png"));
return stream;
}
};
add(new Image("propImage", resource));*/

-- 
View this message in context: 
http://www.nabble.com/How-to-get-Image-with-Hibernate-Spring-Based-Application-tp18912816p18912816.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



http://wicketstuff.org/wicket13/repeater/ doesn't open

2008-03-01 Thread wiki

Could u please give some other solution
-- 
View this message in context: 
http://www.nabble.com/http%3A--wicketstuff.org-wicket13-repeater--doesn%27t-open-tp15778240p15778240.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



How to view Set like ListView uses List

2008-03-01 Thread wiki

Hi I have a set of questionaires
I know how to display List of Quesitonaires
{
  List a=user.getQuestionaire(); 
  ListView v=new ListView()
   implementedabstract methods
};
  but don't know if i have Set q=user.getQuestionaire();
how to display them.
Thanks
-- 
View this message in context: 
http://www.nabble.com/How-to-view-Set%3CQuestionaire%3E-like-ListView-uses-List-tp15773242p15773242.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Problem to nest list within data DefaultDataTable which already have data provider

2008-02-14 Thread wiki

I want to nest list of answers in Data Table which already have data provider
.Below code  gives error
IColumn[] columns= { new PropertyColumn(new Model("ID"),"questiontext"),
new AbstractColumn(new Model("Answer Body"))
{
public void populateItem(Item cell,String componentId,IModel
rowmodel)
{
MCSSQuestion q=(MCSSQuestion)rowmodel.getObject();
List a=q.getMcssans();
ListView view=new ListView("lists",a)
{
protected void populateItem(ListItem item)
{
final MCSSAns ans=(MCSSAns)item.getModelObject();

item.setModel(new CompoundPropertyModel(ans));
item.add(new Label("ansbody"));

}
};
   cell.add(view);
}

igor.vaynberg wrote:
> 
> see ListDataProvider
> 
> -igor
> 
> On Feb 13, 2008 7:44 AM, wiki <[EMAIL PROTECTED]> wrote:
>>
>> Hi I have a little problem with displaying list inside datatable.
>> I have a list of questions and each question has a list of answers.My
>> design
>> requirement is to  display one question per page(that's why used Data
>> Provider) and within that page I have to display list of relevant
>> answers.I
>> have a java classes(User,Questionaire,Questions,Answers) User class has
>> List
>> of Questionaire and that(Questionaire) has list of questions Then
>> Question
>> class has a list of Answers.So from Lecturer  WebPage I can click a
>> questionaire link to go to questionaire Page which display list of
>> questionaire(using ListView).From questionaire I did manage to display
>> Questions.Could anybody   know how to embed list in Data Table to display
>> answers.
>>
>> Thanks
>>
>> public class ShowQuestions extends WebPage
>>
>> {
>>
>> //
>> ///** Creates a new instance of ShowQuestions */
>> //List questions=qaire.getMcssquestion();
>> //ListView list=new ListView("questionaire",questions)
>> //{
>> //protected void populateItem(ListItem item)
>> //{
>> //final MCSSQuestion
>> mcssquestion=(MCSSQuestion)item.getModelObject();
>> //
>> //item.setModel(new CompoundPropertyModel(mcssquestion));
>> //item.add(new Label("questiontext"));
>> //item.add(new Label("questionaire.Title"));
>> //
>> //
>> //}
>> //
>> //};
>> //add(list);
>> //}
>> public ShowQuestions(final Questionaire qaire)
>> {
>>
>> SortableDataProvider provider= new SortableDataProvider()
>> {
>> // Return how many rows there are
>> public int size()
>> {
>> return qaire.getMcssquestion().size();
>> }
>> // convert each row object as a model
>> public IModel model(Object object)
>> {
>> MCSSQuestion mcss=(MCSSQuestion)object;
>> return new Model((Serializable) mcss);
>> }
>> public Iterator iterator(int first, int count)
>> {
>> return qaire.selectEntries(first,count).iterator();
>> }
>> };
>> IColumn[] columns= { new PropertyColumn(new
>> Model("ID"),"questiontext")
>> };
>>
>> DefaultDataTable datatable=new
>> DefaultDataTable("eachentry",columns,provider,1);
>> add(datatable);
>> }
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-Display-List-in-DataTable-tp15459611p15459611.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-Display-List-in-DataTable-tp15459611p15480790.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



How to Display List in DataTable

2008-02-13 Thread wiki

Hi I have a little problem with displaying list inside datatable.
I have a list of questions and each question has a list of answers.My design
requirement is to  display one question per page(that's why used Data
Provider) and within that page I have to display list of relevant answers.I
have a java classes(User,Questionaire,Questions,Answers) User class has List
of Questionaire and that(Questionaire) has list of questions Then Question
class has a list of Answers.So from Lecturer  WebPage I can click a
questionaire link to go to questionaire Page which display list of
questionaire(using ListView).From questionaire I did manage to display
Questions.Could anybody   know how to embed list in Data Table to display
answers.

Thanks 

public class ShowQuestions extends WebPage

{

//
///** Creates a new instance of ShowQuestions */
//List questions=qaire.getMcssquestion();
//ListView list=new ListView("questionaire",questions)
//{
//protected void populateItem(ListItem item)
//{
//final MCSSQuestion
mcssquestion=(MCSSQuestion)item.getModelObject();
//
//item.setModel(new CompoundPropertyModel(mcssquestion));
//item.add(new Label("questiontext"));
//item.add(new Label("questionaire.Title"));
//
//
//}
//
//};
//add(list);
//}
public ShowQuestions(final Questionaire qaire)
{

SortableDataProvider provider= new SortableDataProvider()
{
// Return how many rows there are
public int size()
{
return qaire.getMcssquestion().size();
}
// convert each row object as a model
public IModel model(Object object)
{
MCSSQuestion mcss=(MCSSQuestion)object;
return new Model((Serializable) mcss);
}
public Iterator iterator(int first, int count)
{
return qaire.selectEntries(first,count).iterator();
}
};
IColumn[] columns= { new PropertyColumn(new
Model("ID"),"questiontext")
};

DefaultDataTable datatable=new
DefaultDataTable("eachentry",columns,provider,1);
add(datatable);
}

-- 
View this message in context: 
http://www.nabble.com/How-to-Display-List-in-DataTable-tp15459611p15459611.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



how to save CheckBoxMultipleChoice values into database

2008-02-07 Thread wiki

Hi I have a class of MultipleChoiceSingleSelectquestion which has one to many
relationship with Answers in Hibernate 
here is the code to display questions with list of answers 
public class ViewQuestions extends AuthenticatedWebPage {
private static final int ITEM_PER_PATE = 1;

/**
 * Creates a new instance of ViewBooks
 */
public ViewQuestions(Questionaire qaire) {
Border border = new QuestionaireBorder("questionBorder");
add(border);
final QuestionsDataProvider dataProvider = new
QuestionsDataProvider(qaire);
DataView questionView = new QuestionDataView("questions",
dataProvider);
questionView.setItemsPerPage(ITEM_PER_PATE);
border.add(questionView);









border.add(new CustomPagingNavigator("navigator", questionView));
}

class QuestionDataView extends DataView {
public QuestionDataView(String id, IDataProvider dataProvider) {
super(id, dataProvider);
}

protected void populateItem(Item item) {
MCSSQuestion question = (MCSSQuestion) item.getModelObject();

item.setModel(new CompoundPropertyModel(question));
item.add(new Label("mcssquestionid"));
item.add(new Label("questiontext"));
item.add(new Label("questionaire.Title"));

   
List a=question.getMcssans();
ChoiceRenderer renderer= new ChoiceRenderer("ansbody");




Form form=new Form("form");

   

form.add(new CheckBoxMultipleChoice("mcssans",new
PropertyModel(question,"mcssans"),a,renderer));


item.add(form);


}

@Override

protected Item newItem(final String id, int index, final IModel
model) {
return new OddEvenItem(id, index, model);
}

}


The problem is How to select an answer from lists of answer and save it to
the database class.I have a class Selected answer in database but don't know
how wicket will save to the database.I went through wicket stuff examples
but I couldn't find List with one to Many relationship 
-- 
View this message in context: 
http://www.nabble.com/how-to-save-CheckBoxMultipleChoice-values-into-database-tp15337939p15337939.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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