You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Derek Hohls <DH...@csir.co.za> on 2008/05/08 12:34:08 UTC

Re: Processing dynamically-created forms

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 <48...@tuffmail.com>, Grzegorz Kossakowski <gr...@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 <48...@csir.co.za>, "Derek Hohls" <DH...@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