cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <DHo...@csir.co.za>
Subject Re: Processing dynamically-created forms
Date Thu, 08 May 2008 10:34:08 GMT
Grzegorz
 
I finally managed to find the answer - its mentioned here:
http://mail-archives.apache.org/mod_mbox/cocoon-users/200708.mbox/%3C46B12CD0.60000@lojjic.net%3E


Basically you need to use:
var myWidgets = myForm.getWidget().getChildren();

So, for the record, my complete code looks like:

if (myForm.getWidget().getSubmitWidget().getId().equals("ok")) {
 var it = myForm.getWidget().getChildren();
 if ( it != null ) {
  var fwidget = null;
  var ID  = null;
  var val = null;  
  while ( it.hasNext() ) {  
   fwidget = it.next() ; 
   ID = fwidget.getId();
   if ( (ID!=null) && (ID!="ok") && (ID!="cancel") && (ID!="message")
) {
    val = fwidget.getValue();
    if ( val!=null ) { 
     //process a widget that has a value...
    } 
   }
  }   
 }
}

HTH someone!

Derek


>>> On 2008/04/27 at 03:39, in message <48148229.4090405@tuffmail.com>, Grzegorz
Kossakowski <grek@tuffmail.com> wrote:
Derek Hohls pisze:
> Can anyone help with this?! - 
> I am sure its a simple syntax issue...
> 
>>>> On 2008/04/21 at 12:40, in message <480C8B40.5CE9.00D4.0@csir.co.za>,
"Derek Hohls" <DHohls@csir.co.za> wrote:
> Gregorz
> 
> Unfortunately, when I try:
> 
> var it = model.children;
> 
> it has an "undefined" (null) result, not an iterator.
> 
> I also tried:
> 
> var it = myform.getChildren();
> 
> but without success.
> 
> Any ideas  how to get this to work?  I have tried this in 
> different flowscripts for different forms; all have the
> same problem.

Hi Derek,

Thanks for reminding me. I'm just developing some Forms so I'll try my suggestion and see
why it's 
not working. Stay tuned.

-- 
Best regards,
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org 
For additional commands, e-mail: users-help@cocoon.apache.org 



-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice,
and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message