Validation not working in Model Window on Dynamic rows addition

2014-03-18 Thread wicket_new_user
Hi,

I've a requirement where, the rows needs to be added dynamically on click of
a button/hyperlink. If a new Row needs to be added, then the previous rows
needs to be filled by the user.
Also on Click of Submit button, have to check all the rows are filled or
not.

The above case is working fine in regular Page, but failing in Modal dialog
box.
Whats happening is, 
  when the new row is added, form is available. 
  Once try to add new row or click submit button, the form is getting as
null and unable to get any validations if exists or the form is not getting
submitted.


Thanks in advance

Best regards
Venky

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Validation-not-working-in-Model-Window-on-Dynamic-rows-addition-tp4665011.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: Validation not working in Model Window on Dynamic rows addition

2014-03-18 Thread wicket_new_user
ReportFiltersPanel.html
http://apache-wicket.1842946.n4.nabble.com/file/n4665013/ReportFiltersPanel.html
  
ReportFiltersPanel.java
http://apache-wicket.1842946.n4.nabble.com/file/n4665013/ReportFiltersPanel.java
  

Martin,
Uploaded both the Java and HTML files for complete reference.

New row is added between 161 - 192 lines of code which is called at line 118
in the uploaded file.

Thanks
Venky

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Validation-not-working-in-Model-Window-on-Dynamic-rows-addition-tp4665011p4665013.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



Expandable section in ListView

2014-03-18 Thread Entropy
I have a list view that will have a button on the left to expand or contract
a section that starts out hidden.  this section will have some additional
details.  Code and HTML below.  

When I click the button, the event arrives in my onActivityLogExpansion, and
the wicket ajax debug control turns red.  The log says the following, that I
did not setOutputMarkupdId to true.  But I did as you can see in the code.

INFO: focus set on ui-id-3
INFO: focus removed from ui-id-3
INFO: focus set on btnExpander8
INFO: focus removed from btnExpander8
INFO: Received ajax response (771 characters)
INFO: 
?xml version=1.0 encoding=UTF-8?ajax-responsecomponent
id=expandable17 /component/ajax-response
ERROR: Wicket.Ajax.Call.processComponent: Component with id [[expandable17]]
was not found while trying to perform markup update. Make sure you called
component.setOutputMarkupId(true) on the component whose markup you are
trying to update.
INFO: Response processed successfully.
INFO: refocus last focused component not needed/allowed
INFO: focus set on btnExpander8
INFO: focus removed from btnExpander8
INFO: focus set on wicketDebugLink
INFO: focus removed from wicketDebugLink


CODE:
PropertyListViewShareActivityPlusDecode activityLog = new
PropertyListViewShareActivityPlusDecode(activityLog, activities) {
private static final long serialVersionUID = 1L;

@Override
protected void populateItem(ListItemShareActivityPlusDecode 
item)
{
ShareActivityPlusDecode activity = 
(ShareActivityPlusDecode)
item.getDefaultModelObject();
item.add(new Label(CREATION_TIMESTAMP));
item.add(new Label(ACTIVITY_DC));
item.add(new ExternalLink(mailTo, mailto:; +
activity.getEMAIL_ADR()).add(new Label(CREATED_BY_USER_ID)));
item.add(new Label(USER_PH));
item.add(new AjaxButton(btnExpander){
private static final long 
serialVersionUID = 1L;
public void onSubmit(AjaxRequestTarget 
target, Form form) {
WebMarkupContainer wmc = 
(WebMarkupContainer)
this.getParent().get(expandable);
onActivityLogExpansion(target, 
wmc, this);
}
}).setOutputMarkupId(true);

WebMarkupContainer expandable = new 
WebMarkupContainer(expandable, new
ModelShareActivityPlusDecode((ShareActivityPlusDecode)
item.getDefaultModel().getObject()));
expandable.add(new 
Label(EMAIL_ADR).setOutputMarkupId(true));
expandable.add(new 
Label(COMMENT).setOutputMarkupId(true));
boolean reject =
item.getModelObject().getACTIVITY_CD().equals(ACTIVITY_REJECT) ||
item.getModelObject().getACTIVITY_CD().equals(ACTIVITY_PENDING_AMENDMENT);
expandable.add(new Label(rejectionReasons, new
ModelString()).setVisible(reject).setEnabled(reject).setOutputMarkupId(true));
expandable.setVisible(false);
expandable.setOutputMarkupId(true);
item.add(expandable);
}
};
logForm.add(activityLog);

[...]

private void onActivityLogExpansion(AjaxRequestTarget target,
WebMarkupContainer wmc, AjaxButton invokingButton) {
Label rejectionReasons = (Label) wmc.get(rejectionReasons);
ShareActivityPlusDecode activity = (ShareActivityPlusDecode)
wmc.getDefaultModelObject();
if(rejectionReasons.isEnabled() 
rejectionReasons.getDefaultModelObjectAsString().length()==0) {
//populate rejection reasons as this is a rejection 
activity and the
value isn't set yet
ListString reasonDecodes =
this.sharingService.fetchRejectionReasons(activity.getACTIVITY_CD());
StringBuilder sb = new StringBuilder();
for(String reason:reasonDecodes)
sb.append(reason).append(, );
if(sb.length()=2)
sb.delete(sb.length()-2, sb.length());
ModelString model = (ModelString) 
rejectionReasons.getDefaultModel();
model.setObject(sb.toString());
}
wmc.setVisible(!wmc.isVisible());
target.add(wmc);
if(wmc.isVisible())
invokingButton.setLabel(new ModelString(-));
else
invokingButton.setLabel(new ModelString(+));
}



HTML:


   

Re: Expandable section in ListView

2014-03-18 Thread Stefan Renz
Hi,

try to setOutputMarkupPlaceholderTag(true) on your expandable, otherwise
your component doesn't render at all when setVisible(false)...


Bye
   Stef

Entropy wrote:
 I have a list view that will have a button on the left to expand or contract
 a section that starts out hidden.  this section will have some additional
 details.  Code and HTML below.  
 
 When I click the button, the event arrives in my onActivityLogExpansion, and
 the wicket ajax debug control turns red.  The log says the following, that I
 did not setOutputMarkupdId to true.  But I did as you can see in the code.
 
 INFO: focus set on ui-id-3
 INFO: focus removed from ui-id-3
 INFO: focus set on btnExpander8
 INFO: focus removed from btnExpander8
 INFO: Received ajax response (771 characters)
 INFO: 
 ?xml version=1.0 encoding=UTF-8?ajax-responsecomponent
 id=expandable17 /component/ajax-response
 ERROR: Wicket.Ajax.Call.processComponent: Component with id [[expandable17]]
 was not found while trying to perform markup update. Make sure you called
 component.setOutputMarkupId(true) on the component whose markup you are
 trying to update.
 INFO: Response processed successfully.
 INFO: refocus last focused component not needed/allowed
 INFO: focus set on btnExpander8
 INFO: focus removed from btnExpander8
 INFO: focus set on wicketDebugLink
 INFO: focus removed from wicketDebugLink
 
 
 CODE:
   PropertyListViewShareActivityPlusDecode activityLog = new
 PropertyListViewShareActivityPlusDecode(activityLog, activities) {
   private static final long serialVersionUID = 1L;
 
   @Override
   protected void populateItem(ListItemShareActivityPlusDecode 
 item)
 {
   ShareActivityPlusDecode activity = 
 (ShareActivityPlusDecode)
 item.getDefaultModelObject();
   item.add(new Label(CREATION_TIMESTAMP));
   item.add(new Label(ACTIVITY_DC));
   item.add(new ExternalLink(mailTo, mailto:; +
 activity.getEMAIL_ADR()).add(new Label(CREATED_BY_USER_ID)));
   item.add(new Label(USER_PH));
   item.add(new AjaxButton(btnExpander){
   private static final long 
 serialVersionUID = 1L;
   public void onSubmit(AjaxRequestTarget 
 target, Form form) {
   WebMarkupContainer wmc = 
 (WebMarkupContainer)
 this.getParent().get(expandable);
   onActivityLogExpansion(target, 
 wmc, this);
   }
   }).setOutputMarkupId(true);
   
   WebMarkupContainer expandable = new 
 WebMarkupContainer(expandable, new
 ModelShareActivityPlusDecode((ShareActivityPlusDecode)
 item.getDefaultModel().getObject()));
   expandable.add(new 
 Label(EMAIL_ADR).setOutputMarkupId(true));
   expandable.add(new 
 Label(COMMENT).setOutputMarkupId(true));
   boolean reject =
 item.getModelObject().getACTIVITY_CD().equals(ACTIVITY_REJECT) ||
 item.getModelObject().getACTIVITY_CD().equals(ACTIVITY_PENDING_AMENDMENT);
   expandable.add(new Label(rejectionReasons, new
 ModelString()).setVisible(reject).setEnabled(reject).setOutputMarkupId(true));
   expandable.setVisible(false);
   expandable.setOutputMarkupId(true);
   item.add(expandable);
   }
   };
   logForm.add(activityLog);
 
 [...]
 
   private void onActivityLogExpansion(AjaxRequestTarget target,
 WebMarkupContainer wmc, AjaxButton invokingButton) {
   Label rejectionReasons = (Label) wmc.get(rejectionReasons);
   ShareActivityPlusDecode activity = (ShareActivityPlusDecode)
 wmc.getDefaultModelObject();
   if(rejectionReasons.isEnabled() 
 rejectionReasons.getDefaultModelObjectAsString().length()==0) {
   //populate rejection reasons as this is a rejection 
 activity and the
 value isn't set yet
   ListString reasonDecodes =
 this.sharingService.fetchRejectionReasons(activity.getACTIVITY_CD());
   StringBuilder sb = new StringBuilder();
   for(String reason:reasonDecodes)
   sb.append(reason).append(, );
   if(sb.length()=2)
   sb.delete(sb.length()-2, sb.length());
   ModelString model = (ModelString) 
 rejectionReasons.getDefaultModel();
   model.setObject(sb.toString());
   }
   wmc.setVisible(!wmc.isVisible());
   target.add(wmc);
   if(wmc.isVisible())
   invokingButton.setLabel(new 

Re: Extending the DataTable class doesnt work

2014-03-18 Thread chathuraka.waas
Hi,

i'm still trying to fix my issue. Even though most of the issues are fixed
there is one small glitch i cant get my way around. 

Given my business scenario i need to be able to add a empty row to the table
after its been rendered by wicket. 

In wicket 1.4 this was achieved by, 





[cell]



div class=last-row-bottom-border/div


but with wicket 6.14 i'm unable to do this. when i place wicket elements
inside the table it complains telling that only row html elements are
allowed inside a table component. 

my current table mark up is this,

 
 


how can i achieve to add a empty column after the rows are being rendered in
wicket 6.14. 

Thanks in advance. 

Regards, 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Extending-the-DataTable-class-doesnt-work-tp4664952p4665018.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