Re: AJAXIFY Palette: Can't get to the Recorder

2010-03-30 Thread wicketnewuser

Hi i tried doing this it doesn't like adding
AjaxFormComponentUpdatingBehavior . I thought when you meant
AjaxFormComponentUpdatingBehavior by whateverbehaviour. i even added
onupdate method that didn't help too. still getting null when doing
pallet.getRecorderComponent. Please help
new PropertyModel(model,"allSids"), 
renderer, 12, false){
   protected Recorder 
newRecorderComponent() {
Recorder 
r=super.newRecorderComponent(); 
r.add(new  
AjaxFormComponentUpdatingBehavior("onchange")); 
return r;
}

};


Edvin Syse wrote:
> 
> Thanks! Will you update the javadoc as well?
> 
> -- Edvin
> 
> Den 28. juli. 2008 kl. 16.37 skrev "Igor Vaynberg"
>   >:
> 
>> override newrecorder() { recorder r=super.newrecorder(); r.add(new
>> whateverbehavior()); return r; }
>>
>> -igor
>>
>> On Mon, Jul 28, 2008 at 12:33 AM, Edvin Syse   
>> wrote:
>>> The javadocs for the Palette says to add  
>>> AjaxFormComponentUpdatingBehaviour
>>> to the Recorder like this:
>>>
>>>   Form form=new Form(...);
>>>   Palette palette=new Palette(...);
>>>   palette.getRecorderComponent().add(new
>>> AjaxFormComponentUpdatingBehavior("onchange") {...});
>>>
>>> getRecorderComponent() is null, because it isn't populated in the  
>>> Palette's
>>> constructor, it is populated
>>> in the private initFactories() method, which is called from  
>>> onBeforeRender.
>>>
>>> How am I supposed to get to the Recorder-component from the  
>>> constructor of
>>> my pageclass? :)
>>>
>>>
>>> -- Edvin
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/AJAXIFY-Palette%3A-Can%27t-get-to-the-Recorder-tp18685475p28090539.html
Sent from the Wicket - User 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: Using email in SignInPanel Username

2010-02-11 Thread wicketnewuser

Hi as suggested I made my own signinpanel and cookiepersister which encodes
and decodeswhen saving and retrieving cookies.

jthomerson wrote:
> 
> May be a bug.  Please file a JIRA.  In the meantime, the signinpanel is
> pretty generic and not meant for every usecase.  You can easily create
> your
> own - even copying the code and modifying it.
> 
> --
> Jeremy Thomerson
> http://www.wickettraining.com
> 
> 
> 
> On Thu, Oct 29, 2009 at 1:43 AM, wicketnewuser 
> wrote:
> 
>>
>> Any one know what the solution for this is
>>
>> wicketnewuser wrote:
>> >
>> >
>> > I'm trying to use wicket signinpanel . When and choose remember me
>> > checkbox and use email address in username  (eg@ttt.com , next time
>> > when i come it it just remembers abc as user name instead of
>> a...@ttt.com
>> ).
>> > It seems when storing and retreving value from cookies we need to
>> encode
>> > and decode the value . It doesn't look like wicket is doing this by
>> > default which is why this is happening. Does any one know what is the
>> > solution for this.
>> >
>> > 
>> > 
>> > Sign In
>> > 
>> > 
>> > body { background-image: none; }
>> > 
>> > 
>> > 
>> > Sign In
>> >
>> >
>> > 
>> > 
>> >
>> > thank you
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Using-email-in-SignInPanel-Username-tp26085468p26107531.html
>> Sent from the Wicket - User 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
>>
>>
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Using-email-in-SignInPanel-Username-tp26085468p27547261.html
Sent from the Wicket - User 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: not addding componet in case of error

2009-12-14 Thread wicketnewuser

never mind please. it did work. I just forgot to set the visibility to false
for he container

wicketnewuser wrote:
> 
> It looks like you still have to add all the componet in my case
> reportresultpanel and others to  tableAddChart . In my case if error
> condition and i'm just adding tableAndChartContainer.  If complains about
> reportresultpanel being in the markup not being added. 
> Unable to find component with id 'reportresultpanel' 
> 
> here is the part where i'm handling 
> if (originalRowSet.size() < 1){
>   //just insert empty lable to the container
>   error("No data returned for this report. ");
>WebMarkupContainer tableAndChartContainer  = new
> WebMarkupContainer("tableAndCharts");
>   add(tableAndChartContainer);
>   } else {
> here is the html markup
> 
>   Report Results for 
>   
>   
>   
>   [[ feedback ]]
>   
>   
>   
>   
>   
>   
>   
>   
>
>   
>   
>/>
>   
>   
>   
>   
> 
>   
>   
>   
>   
>
>   
>   
>/>
>   
>   
>   
>   
>   
>   
>   
>   
> 
> 
> 
> vineet semwal wrote:
>> 
>> toggling visibility will always do,
>> my idea was creating the actual component only if data is available .
>> 
>> 
>> On Mon, Dec 14, 2009 at 2:05 AM, Martijn Dashorst <
>> martijn.dasho...@gmail.com> wrote:
>> 
>>> Or just set visibility based on error
>>>
>>> On Saturday, December 12, 2009, vineet semwal
>>>  wrote:
>>> > add empty webmarkupcontainers as your components,if no error,replace
>>> the
>>> > containers with your components
>>> > else
>>> > you don't need to replace.
>>> >
>>> >
>>> > On Sat, Dec 12, 2009 at 8:02 AM, Swarnim Ranjitkar
>>> >> >wrote:
>>> >
>>> >>
>>> >> I have a case where I check some error condition at the beginning of
>>> the
>>> >> code. If there is error I just want to display error message so
>>> >> basically it is
>>> >> if (error == true){
>>> >> display message
>>> >> } else {
>>> >> //render regular page
>>> >> add(component1)
>>> >> add(compnent2)
>>> >> }
>>> >>
>>> >> if there is error I don't have any data to generate my component. Is
>>> there
>>> >> a clean way to do this. I'm getting
>>> >>  Unable to find component with id 'chart1image' exception. Appreciate
>>> your
>>> >> feedback
>>> >> thank you
>>> >>
>>> >>
>>> >>
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > regards,
>>> > Vineet Semwal
>>> >
>>>
>>> --
>>> Become a Wicket expert, learn from the best: http://wicketinaction.com
>>> Apache Wicket 1.4 increases type safety for web applications
>>> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>> 
>> 
>> -- 
>> regards,
>> Vineet Semwal
>> 
>> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/not-addding-componet-in-case-of-error-tp26754430p26779967.html
Sent from the Wicket - User 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: not addding componet in case of error

2009-12-14 Thread wicketnewuser

It looks like you still have to add all the componet in my case
reportresultpanel and others to  tableAddChart . In my case if error
condition and i'm just adding tableAndChartContainer.  If complains about
reportresultpanel being in the markup not being added. 
Unable to find component with id 'reportresultpanel' 

here is the part where i'm handling 
if (originalRowSet.size() < 1){
//just insert empty lable to the container
error("No data returned for this report. ");
 WebMarkupContainer tableAndChartContainer  = new
WebMarkupContainer("tableAndCharts");
add(tableAndChartContainer);
} else {
here is the html markup

Report Results for 



[[ feedback ]]








 












 














vineet semwal wrote:
> 
> toggling visibility will always do,
> my idea was creating the actual component only if data is available .
> 
> 
> On Mon, Dec 14, 2009 at 2:05 AM, Martijn Dashorst <
> martijn.dasho...@gmail.com> wrote:
> 
>> Or just set visibility based on error
>>
>> On Saturday, December 12, 2009, vineet semwal
>>  wrote:
>> > add empty webmarkupcontainers as your components,if no error,replace
>> the
>> > containers with your components
>> > else
>> > you don't need to replace.
>> >
>> >
>> > On Sat, Dec 12, 2009 at 8:02 AM, Swarnim Ranjitkar
>> > >wrote:
>> >
>> >>
>> >> I have a case where I check some error condition at the beginning of
>> the
>> >> code. If there is error I just want to display error message so
>> >> basically it is
>> >> if (error == true){
>> >> display message
>> >> } else {
>> >> //render regular page
>> >> add(component1)
>> >> add(compnent2)
>> >> }
>> >>
>> >> if there is error I don't have any data to generate my component. Is
>> there
>> >> a clean way to do this. I'm getting
>> >>  Unable to find component with id 'chart1image' exception. Appreciate
>> your
>> >> feedback
>> >> thank you
>> >>
>> >>
>> >>
>> >
>> >
>> >
>> >
>> > --
>> > regards,
>> > Vineet Semwal
>> >
>>
>> --
>> Become a Wicket expert, learn from the best: http://wicketinaction.com
>> Apache Wicket 1.4 increases type safety for web applications
>> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
> 
> 
> -- 
> regards,
> Vineet Semwal
> 
> 

-- 
View this message in context: 
http://old.nabble.com/not-addding-componet-in-case-of-error-tp26754430p26779962.html
Sent from the Wicket - User 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: Listview in a listview refresh with AjaxLink don't work

2009-11-15 Thread wicketnewuser

I don't see your up link in the html markup. Doesn't look like you have
enough info here. If you are moving your question row up are you updating
the list for the listview. Also you are updating questionpanel with ajax
target . I think it would have to be your listview. I would use
ajaxsubmitlink as you might want to save the content or questionpanel when
moving your question up or down. Can you please post all relevent code if
this doesn't help

pieter claassen-2 wrote:
> 
> I am trying to follow wicket in action advice P263 but
> 
> I have a ListView in a ListView with a panel added to my inner
> listview. On that panel, I have  an AjaxLink and I want to move items
> in the order of the listview around. But to display them, I need to
> refresh my "matrix". Nothing seems to work. Any tips or references.
> 
> QuestionEditPanel.html
> =
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> QuestionEditPanel.java
> ==
> 
> final WebMarkupContainer parent=new WebMarkupContainer("parent");
> add(parent);
> parent.setOutputMarkupId(true);
> List> rows =
> QuestionProcessor.getQuestionMatrix(templateWebModel.getEntity().getQuestions(),true);
> ListView rowslistview = new ListView("rows", rows) {
> 
> @Override
> protected void populateItem(ListItem item) {
> List row = (List)
> item.getModelObject();
> ListView rowlistview = new ListView("row", row) {
> 
> @Override
> protected void populateItem(ListItem item) {
> final QuestionBase question = (QuestionBase)
> item.getModelObject();
> item.setModel(new
> CompoundPropertyModel(question));
> EditableQuestionPanel questionpanel=new
> EditableQuestionPanel("question", new
> QuestionBaseWebModel(question),templateWebModel,parent);
> item.add(questionpanel);
> 
> 
> 
> and then on my EditableQuestionPanel.java I have :
> 
> AjaxLink up = new AjaxLink("up") {
> 
> @Override
> public void onClick(AjaxRequestTarget target) {
> target.addComponent(parent);
> Template template = templatemodel.getEntity();
> template.moveQuestionUp(question);
> tf.store(template);
> }
> };
> -- 
> Pieter Claassen
> musmato.com
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Listview-in-a-listview-refresh-with-AjaxLink-don%27t-work-tp26354774p26362678.html
Sent from the Wicket - User 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: Updating a Dynamic Image with AJAX (and JFreeChart)

2009-11-13 Thread wicketnewuser

I have same situation. I'm not able to refresh my image. But if i view the
image i do get refreshed image
Here is my code. Based on my dropdownchoice it should make new Jfreechart
and the image should refresh. I couldn't get it working so i wrapped the
image with in a span but it still doesn't work. TugboatChartImage extends
NonCachingImage . Can any one point out what I'm doing wrong
Chart chart1 = new Chart(this.getString(column1.toString()), "Date",
"Dollars");
final String yAxisType = "linear";
final int smallChartWidth=400;
final int smallChartHeight=200;
JFreeChart jfChartOne = chart1.render(chartOneCollection, null, 
yAxisType,
smallChartWidth, smallChartHeight);


// make an image
final TugboatChartImage imageOne = new 
TugboatChartImage("chart1image",
jfChartOne, smallChartWidth, smallChartHeight);
final WebMarkupContainer chart1Span = new
WebMarkupContainer("chart1Span");
chart1Span.add(imageOne);
add(chart1Span);

// draw chart 2
Chart chart2 = new Chart(this.getString(column2.toString()), 
"Date",
"Count");
JFreeChart jfChartTwo = chart2.render(chartTwoCollection, null, 
yAxisType,
smallChartWidth, smallChartHeight);

// make an image
TugboatChartImage imageTwo = new 
TugboatChartImage("chart2image",
jfChartTwo, smallChartWidth, smallChartHeight);
add(imageTwo);
String filterStringList ="";
if (filterStringList!= null){
filterStringList =
report.getFilterParameterList().toString().replaceAll("\\[", "");
filterStringList = filterStringList.replaceAll("\\]", 
"");
}
final DropDownChoice chart1Select 
= new
DropDownChoice("chart1Select" ,new
PropertyModel(this, "column1"), TugboatReportData.trafficColumns,new
IChoiceRenderer() {
public Object getDisplayValue(Object obj) {
//this.getString give you value from the 
propertyfile
return
ReportResultsPage.this.getString(((TugboatReportData.ColumnName)
obj).toString());
}

public String getIdValue(Object obj, int index) {
return obj.toString();
}
});
chart1Select.add(new  
AjaxFormComponentUpdatingBehavior("onchange") {
protected void onUpdate(AjaxRequestTarget target) {
sortByColumn(displayRowSetFinal, column1);
Chart chart1R = new
Chart(ReportResultsPage.this.getString(column1.toString()), "Date",
"Dollars");

SwishTimeSeriesCollection chartOneCollectionR =
createChartCollection(report, originalRowSet, displayRowSetFinal.subList(0,
(originalRowSet.size() > 10) ? 9 : originalRowSet.size() - 1), column1);
logger.error(displayRowSetFinal);
JFreeChart jfChartOneR = 
chart1R.render(chartOneCollectionR, null,
yAxisType, smallChartWidth, smallChartHeight);
imageOne.setDefaultModelObject(jfChartOneR);
imageOne.modelChanged();
chart1Span.modelChanged();
chart1Span.setOutputMarkupId(true);
imageOne.setOutputMarkupId(true);
target.addComponent(imageOne);
target.addComponent(chart1Span);
}
});

Jason Mihalick wrote:
> 
> I am integrating JFreeChart into my application and I've followed the
> JFreeChart example on the wiki.  That works very nicely.  I was impressed. 
> What I want to do now is update the graph that I display based on the
> selection from a drop down list.  I've successfully added the
> DropDownChoice component and added a AjaxFormComponentUpdatingBehavior to
> it.  I've verified that my onUpdate( AjaxRequestTarget ) method is being
> invoked and I'm receiving the updated value, which is very cool.  Here is
> my onUpdate implementation for the DropDownChoice control:
> 
> protected void onUpdate( AjaxRequestTarget target ) {
>   log.debug( "graphStyles onUpdate invoked! SelectedGraphStyle = " +  
>  FieldResultsPanel.this.getSelectedGraphStyle() );
>   FieldResultsPanel.this.updateGraph();  // Update the model and re-create
> the JFreeChart Image
> 
>   // fieldGraph is my JFreeChartImage instance (derived from Image)
>   // This is supposed to indicate back to the browser that the image needs
> updated.  I think this
>   // is working properly
>   target.addComponent( FieldResultsPanel.this.fieldGraph );  
> }
> 
> Even though I am updating the model of my J

Re: Datepicker model change problem

2009-11-12 Thread wicketnewuser

Hi Anyone has any idea about this

wicketnewuser wrote:
> 
> 
> I have a page with date picker that picks the date, DropdownChoice for
> hour and minute. When I click "today" button I change the model in
> onsubmit method. It is suppose to change the form value in datepicker,
> hour and minute to today/now.This changes hour and minute but doesn't
> change the value in the
> datepicker. Is there something that I need to do to make this work. Here
> is the partial code
> 
> 
>   public void onSubmit() {
> 
> Calendar startDate = Calendar.getInstance();
> 
> 
> 
> // initialize end date
> 
> Calendar endDate = Calendar.getInstance();
> 
> 
> 
> model.getObject().setStartDate(startDate);
> 
> model.getObject().setEndDate(endDate);
> 
> getForm().modelChanged();
> 
> super.onSubmit();
> 
> }
> 
> Here is the whole code.
> 
> public final class DateTimeSelectionModel implements IClusterable {
>
> private Calendar startDate;
> private Calendar endDate;
> 
> public DateTimeSelectionModel() {
> 
> // initialize start date
> startDate = Calendar.getInstance();
> startDate.add(Calendar.DATE, -5);
> startDate.set(Calendar.HOUR_OF_DAY, 0);
> startDate.set(Calendar.MINUTE, 0);
> startDate.set(Calendar.SECOND, 0);
> 
> // initialize end date
> endDate = Calendar.getInstance();
> endDate.add(Calendar.DATE, -5);
> endDate.set(Calendar.HOUR_OF_DAY, 23);
> endDate.set(Calendar.MINUTE, 59);
> endDate.set(Calendar.SECOND, 59);
> 
> System.out.println("hello");
> }
> 
> public void setStartDate(Calendar startDate) {
> this.startDate = startDate;
> }
> 
> public void setEndDate(Calendar endDate) {
> this.endDate = endDate;
> }
> 
> // this method is called to get the default for the form.
> public Date getStartDate() {
> return startDate.getTime();
> }
> public void setStartDate(Date date) {
> //we want to set only year month and day here not the whole date
> Calendar cal = Calendar.getInstance();
> cal.setTime(date);
> this.startDate.set(cal.get(Calendar.YEAR),
> cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH));
> }
> 
> public SelectOption getStartHour() {
> SelectOption option = new SelectOption("Unknown", new String("" +
> startDate.get(Calendar.HOUR_OF_DAY)));
> return option;
> }
> public void setStartHour(SelectOption hour) {
> startDate.set(Calendar.HOUR_OF_DAY,
> Integer.valueOf(hour.getValue()));
> }
> 
> public void setStartMinute(String minute) {
> startDate.set(Calendar.MINUTE, Integer.valueOf(minute));
> }
> public void setStartMinute(int minute) {
> startDate.set(Calendar.MINUTE, minute);
> }
> public int getStartMinute() {
> return startDate.get(Calendar.MINUTE);
> }
> 
> 
> public Date getEndDate() {
> return endDate.getTime();
> }
> public void setEndDate(Date date) {
> //we want to set only year month and day here not the whole date
> Calendar cal = Calendar.getInstance();
> cal.setTime(date);
> this.endDate.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH),
> cal.get(Calendar.DAY_OF_MONTH));
> }
> 
> public SelectOption getEndHour() {
> SelectOption option = new SelectOption("Unknown", new String("" +
> endDate.get(Calendar.HOUR_OF_DAY)));
> return option;
> }
> public void setEndHour(SelectOption hour) {
> endDate.set(Calendar.HOUR_OF_DAY,
> Integer.valueOf(hour.getValue()));
> }
> 
> public void setEndMinute(String minute) {
> endDate.set(Calendar.MINUTE, Integer.valueOf(minute));
> }
> public void setEndMinute(int minute) {
> endDate.set(Calendar.MINUTE, minute);
> }
> public int getEndMinute() {
> return endDate.get(Calendar.MINUTE);
> }
> 
> 
> 
> }
> 
> 
> public class DateTimeSelectionForm extends Form {
> 
> public DateTimeSelectionForm(String id, final
> IModel model) {
> //super(id);
> super(id, model);
> 
> final DateTextField dateStartField = new
> DateTextField("startDate",new PropertyModel(model, "startDate"), new
> P

Re: model update in moveuplink and movedownlink onclick

2009-11-08 Thread wicketnewuser

I solved the problem. I was't putting target.addComponent. Just for
reference,here is how it looks now .
public final AjaxSubmitLink moveDownMasterChainLink(final String id, 
final
ListItem item, MasterChainListForm form)
{
return new AjaxSubmitLink(id)
{
private static final long serialVersionUID = 1L;


   @Override

protected void onSubmit(AjaxRequestTarget target, 
Form form) {
// TODO Auto-generated method stub
final int index = 
getList().indexOf(item.getModelObject());
if (index != -1)
{   
addStateChange(new Change()
{
private static final long 
serialVersionUID = 1L;

final int oldIndex = index;

@Override
public void undo()
{
Collections.swap(getList(), 
oldIndex + 1, oldIndex);
}

});

// Swap list items and invalidate listView
Collections.swap(getList(), index, index + 1);
MyListView.this.removeAll();
}
target.addComponent(form);


}

/**
 * @see org.apache.wicket.Component#onBeforeRender()
 */
@Override
protected void onBeforeRender()
{
super.onBeforeRender();
//setAutoEnable(false);
if (getList().indexOf(item.getModelObject()) == 
(getList().size() - 1))
{
setEnabled(false);
}
}




};
    }


wicketnewuser wrote:
> 
> 
> Is there anyway that you can update model before you move the item up or
> down using moveuplink and movedownlink in listview. My goal is to save the
> input data to the model so that I don't loose use input on the item before
> moving the item. I did try to extend the ListView and added my own
> moveuplink and downlink code called form's updateFormComponentModels() 
> method but that didn't really help. Does anyone have any idea how this can
> be done.
> 
> LeadTransnodeChain lc = new LeadTransnodeChain(1, 2, 3, 4, 5,
> LeadTransnodeChain.MODE.ASYNC);
> masterChainList.add(lc);
> masterChainList.add(new LeadTransnodeChain(11, 12, 13, 14, 15,
> LeadTransnodeChain.MODE.SYNC));
> masterChainList.add(new LeadTransnodeChain(21, 22, 23, 24, 25,
> LeadTransnodeChain.MODE.SYNC));
> 
> ListView propertiesList = new MyListView("masterChainList",
> masterChainList) {
> 
> @Override
> protected void populateItem(ListItem item) {
> LeadTransnodeChain leadTransnodeChain =
> (LeadTransnodeChain) item.getModelObject();
> 
>   
> item.add(new Label("masterChain", new
> PropertyModel(leadTransnodeChain, "m_masterChainID")));
> item.add(new DropDownChoice("runAs", new
> PropertyModel(leadTransnodeChain, "m_mode"),
> Arrays.asList(LeadTransnodeChain.MODE.values()), new IChoiceRenderer() {
> public Object getDisplayValue(Object mode) {
> return ((LeadTransnodeChain.MODE)
> mode).toString();
> }
> 
> public String getIdValue(Object obj, int index) {
> return obj.toString();
> }
> }
>
> ));
> item.add(moveMyUpLink("moveUp", item, form));
> item.add(moveMyDownLink("moveDown", item, form)); 
> 
> 
> }
> };
> add(new Button("submitButton"));
> 
> propertiesList.setReuseItems(true);
> add(propertiesList);
> }public void updateComponentModels(){
> super.updateFormComponentModels();
> }
> 
> 
> public abstract class MyListView extends ListView {
> 

Re: Using email in SignInPanel Username

2009-10-28 Thread wicketnewuser

Any one know what the solution for this is

wicketnewuser wrote:
> 
> 
> I'm trying to use wicket signinpanel . When and choose remember me
> checkbox and use email address in username  (eg@ttt.com , next time
> when i come it it just remembers abc as user name instead of a...@ttt.com).
> It seems when storing and retreving value from cookies we need to encode
> and decode the value . It doesn't look like wicket is doing this by
> default which is why this is happening. Does any one know what is the
> solution for this. 
> 
> 
> 
> Sign In
> 
> 
> body { background-image: none; }
> 
> 
> 
> Sign In
> 
> 
> 
> 
> 
> thank you
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Using-email-in-SignInPanel-Username-tp26085468p26107531.html
Sent from the Wicket - User 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: Component parent null after replace

2009-10-22 Thread wicketnewuser

Hi I have similiar situation but i'm using autonomous  inner class
final AjaxFallbackDefaultDataTable datatable = new
AjaxFallbackDefaultDataTable("trafficreportlistdatatable", columns, new
ReportListProvider("Traffic", include), 8);
add(datatable);
final WebMarkupContainer showMineSpan = new
WebMarkupContainer("showMineSpan");
final WebMarkupContainer showAllSpan = new
WebMarkupContainer("showAllSpan");
  final Link showAllLink = new
AjaxFallbackLink("trafficreportlistshowall") { 
public void onClick(AjaxRequestTarget target) {
AjaxFallbackDefaultDataTable 
replacement = new
AjaxFallbackDefaultDataTable("trafficreportlistdatatable", columns, new
ReportListProvider("Traffic", "all"), 8);
//this.replaceWith(replacement);
replacement.setOutputMarkupId(true);

datatable.replaceWith(replacement);

I can't do datatable = replacement as datatable has to be final in my case
as i'm using it in the anonymous  inner class. Do you know if there is any
solution to this. Would appreciate your help



igor.vaynberg wrote:
> 
> heh, seems a lot of people run into it. the short is that you have to do
> this:
> 
> lets say you have a ref to the panel: private Panel panel;
> 
> what you do is this:
> panel.replaceWith(new Panel());
> 
> and then later again
> panel.replaceWith(new Panel());
> 
> ^ the second time will fail beause you have removed panel from hierarchy
> already - you replaced it with another panel.
> 
> the proper way to do it is to keep the reference up to date, so
> Panel temp=new Panel();
> panel.replaceWith(temp);
> panel=temp;
> 
> that way when it happens the second time it will properly act on the new
> panel that is inside the hierarchy now.
> 
> -igor
> 
> 
> 
> 
> On 9/9/07, Anthony Schexnaildre  wrote:
>>
>> I am trying to create a link that will replace one panel with another
>> on the page. This seems as though it should be an easy task but after
>> many attempts and searching the net for examples I have yet to get it
>> working so the replacement can happen more than one without the
>> component becoming orphaned. On the second replace attempt i get the
>> following exception. Anyone have the solution?
>>
>> Thank you,
>>
>> Anthony
>>
>>
>> java.lang.IllegalStateException: This method can only be called on a
>> component that has already been added to its parent.
>>   at org.apache.wicket.Component.replaceWith(Component.java:2266)
>>   at com.pinwise.pinbase.web.components.links.SecurePanelLink
>> $4.onClick(SecurePanelLink.java:142)
>>   at org.apache.wicket.markup.html.link.Link.onLinkClicked
>> (Link.java:222)
>>   at java.lang.reflect.Method.invoke(Method.java:585)
>>   at org.apache.wicket.RequestListenerInterface.invoke
>> (RequestListenerInterface.java:186)
>>
>>
>> =
>>
>> =
>>
>> public UserPanel(String id) {
>> super(id);
>>
>>
>> UserFormPanel userFormPanel = new
>> UserFormPanel("userFormPanel");
>> add( userFormPanel );
>>
>> List columns = new ArrayList();
>> final Model m = new Model(userFormPanel);
>>  columns.add(new PropertyColumn(new Model("Actions"), "id")
>>  {
>> public void populateItem(Item cellItem, String
>> componentId, final
>> IModel model)
>>  {
>> EditActionPanel panel = new
>> EditActionPanel(componentId, model);
>> panel.add(
>> SecurePanelLink.createSecurePanelLink( "edit", m,
>> UserFormPanel.class, model ) );
>>cellItem.add( panel );
>>  }
>>  });
>>
>>  columns.add(new PropertyColumn(new Model("Username"),
>> "username", "username"));
>>  columns.add(new PropertyColumn(new Model("First Name"),
>> "firstName", "firstName"));
>>  columns.add(new PropertyColumn(new Model("Last Name"),
>> "lastName", "lastName"));
>>
>>  add(new DefaultDataTable("table", columns, new
>> SortableUserDataProvider(), 10));
>> }
>>
>>
>> 
>> SecurePanelLink
>> 
>> public class SecurePanelLink extends Link implements ISecureComponent {
>>
>> /**
>>  *
>>  */
>> private static final long serialVersionUID = 1L;
>>
>> protected IPanelLink panelLink;
>>
>> /**
>>  * @param id
>>  * @param c
>>  */
>> public SecurePanelLink(String id, final Class c)
>> {
>> super(id);
>> // Ensure that c is a subclass of Panel
>> if (!Panel

Re: AjaxFallbackLink problem on Internet Explorer 6

2009-10-22 Thread wicketnewuser

It's suppose to hide Show All and show Show Mine when I click on Show All but
that doesn't happen. on the onclick of showmine it is supposed to be
showMineSpan.setVisible(false);
showAllSpan.setVisible(true);
instead of  what I listed earlier as
showMineSpan.setVisible(true);
showAllSpan.setVisible(false); 


wicketnewuser wrote:
> 
> Hi tried to follow this and having problem with it . Could someone please
> let me know what I'm doing wrong
> Here is the code
> package com.swishmark.tugboat;
> 
> import java.util.ArrayList;
> import java.util.HashMap;
> import java.util.List;
> 
> import org.apache.wicket.PageParameters;
> import org.apache.wicket.Session;
> import org.apache.wicket.markup.html.WebMarkupContainer;
> import org.apache.wicket.markup.html.basic.Label;
> import org.apache.wicket.markup.html.link.Link;
> import org.apache.wicket.markup.html.panel.Panel;
> import org.apache.wicket.markup.repeater.Item;
> import org.apache.wicket.ajax.AjaxRequestTarget;
> import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
> import
> org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
> import
> org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
> import
> org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn; 
> import
> org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn; 
> import org.apache.wicket.model.IModel;
> import org.apache.wicket.model.Model;
> 
> import com.swishmark.tugboat.util.DateTimePropertyColumn;
> import com.swishmark.tugboat.util.LinkPropertyColumn;
> import com.swishmark.tugboat.util.ReportListProvider;
> import com.swishmark.tugboat.util.TugboatReport;
> 
> // http://cwiki.apache.org/WICKET/simple-sortable-datatable-example.html
> // AJAX:
> http://www.wicket-library.com/wicket-examples/repeater/?wicket:bookmarkablePage=:org.apache.wicket.examples.repeater.AjaxDataTablePage
> 
> public class TrafficReportListPanel extends Panel {
> 
>   Integer contactId;
>   
>   public TrafficReportListPanel(String id, final String include) {
>   super(id);
>   
>   final List> columns = new ArrayList>();
>   
>   columns.add(new PropertyColumn(new Model("Report ID"), 
> "reportId",
> "reportId"));
>   columns.add(new PropertyColumn(new Model("Contact Name"), 
> "contactName",
> "contactName"));
>   
> //http://www.mail-archive.com/wicket-u...@lists.sourceforge.net/msg16575.html
>   if (include != null && include.equals("running")){
>   columns.add(new PropertyColumn(new Model("Report 
> Name"), "reportName",
> "reportName"));
>   } else {
>   columns.add(new LinkPropertyColumn(new Model("Report Name"),
> "reportName", "reportName") {
> 
>   @Override
>   public void onClick(Item item, String componentId, 
> IModel model) {
>HashMap params = new 
> HashMap();
>TugboatReport selectedReport = (TugboatReport) 
> model.getObject();
>params.put("reportId", 
> selectedReport.getReportId());
> 
>
>setResponsePage( ReportResultsPage.class, new
> PageParameters(params));
>   
>   }
>
> });
>   }
>   columns.add(new DateTimePropertyColumn(new Model("Start Time"),
> "startTime", "startTime"));
>   columns.add(new DateTimePropertyColumn(new Model("End Time"), 
> "endTime",
> "endTime"));
>   columns.add(new PropertyColumn(new Model("Duration"), 
> "duration",
> "duration"));
>   
>   
>   final AjaxFallbackDefaultDataTable datatable = new
> AjaxFallbackDefaultDataTable("trafficreportlistdatatable", columns, new
> ReportListProvider("Traffic", include), 8);
>   add(datatable);
>   final WebMarkupContainer showMineSpan = new
> WebMarkupContainer("showMineSpan");
>   final WebMarkupContainer s

Re: AjaxFallbackLink problem on Internet Explorer 6

2009-10-22 Thread wicketnewuser

Hi tried to follow this and having problem with it . Could someone please let
me know what I'm doing wrong
Here is the code
package com.swishmark.tugboat;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.apache.wicket.PageParameters;
import org.apache.wicket.Session;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
import
org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
import
org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn; 
import
org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn; 
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;

import com.swishmark.tugboat.util.DateTimePropertyColumn;
import com.swishmark.tugboat.util.LinkPropertyColumn;
import com.swishmark.tugboat.util.ReportListProvider;
import com.swishmark.tugboat.util.TugboatReport;

// http://cwiki.apache.org/WICKET/simple-sortable-datatable-example.html
// AJAX:
http://www.wicket-library.com/wicket-examples/repeater/?wicket:bookmarkablePage=:org.apache.wicket.examples.repeater.AjaxDataTablePage

public class TrafficReportListPanel extends Panel {

Integer contactId;

public TrafficReportListPanel(String id, final String include) {
super(id);

final List> columns = new ArrayList>();

columns.add(new PropertyColumn(new Model("Report ID"), 
"reportId",
"reportId"));
columns.add(new PropertyColumn(new Model("Contact Name"), 
"contactName",
"contactName"));

//http://www.mail-archive.com/wicket-u...@lists.sourceforge.net/msg16575.html
if (include != null && include.equals("running")){
columns.add(new PropertyColumn(new Model("Report 
Name"), "reportName",
"reportName"));
} else {
columns.add(new LinkPropertyColumn(new Model("Report Name"), 
"reportName",
"reportName") {

@Override
public void onClick(Item item, String componentId, 
IModel model) {
 HashMap params = new 
HashMap();
 TugboatReport selectedReport = (TugboatReport) 
model.getObject();
 params.put("reportId", 
selectedReport.getReportId());

 
 setResponsePage( ReportResultsPage.class, new 
PageParameters(params));

}
   
});
}
columns.add(new DateTimePropertyColumn(new Model("Start Time"),
"startTime", "startTime"));
columns.add(new DateTimePropertyColumn(new Model("End Time"), 
"endTime",
"endTime"));
columns.add(new PropertyColumn(new Model("Duration"), 
"duration",
"duration"));


final AjaxFallbackDefaultDataTable datatable = new
AjaxFallbackDefaultDataTable("trafficreportlistdatatable", columns, new
ReportListProvider("Traffic", include), 8);
add(datatable);
final WebMarkupContainer showMineSpan = new
WebMarkupContainer("showMineSpan");
final WebMarkupContainer showAllSpan = new
WebMarkupContainer("showAllSpan");
  final Link showAllLink = new
AjaxFallbackLink("trafficreportlistshowall") { 
public void onClick(AjaxRequestTarget target) {
AjaxFallbackDefaultDataTable 
replacement = new
AjaxFallbackDefaultDataTable("trafficreportlistdatatable", columns, new
ReportListProvider("Traffic", "all"), 8);
//this.replaceWith(replacement);
replacement.setOutputMarkupId(true);
datatable.replaceWith(replacement);
showMineSpan.setVisible(true);
showAllSpan.setVisible(false);
target.addComponent(replacement);

}
};
final Link showMineLink =new 
AjaxFallbackLink("trafficreportlistmine") { 
public void onClick(AjaxRequestTarget target) {
AjaxFallbackDefaultDataTable 
replacement = new
AjaxFallbackDefaultDataTable("t