myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Volker Weber" <v.we...@inexso.de>
Subject Re: [Tobago] Multiple defaultCommands in the same Tobago Page
Date Thu, 14 Jun 2007 15:07:16 GMT
Which version of tobago? Or what is in line 1199 in tobago.js?

This solution is not compatible with input suggest, because there is
already a keyup handler.

for the inputs in the sheet this could work, just the setup is more complicated.

omit the "page:" in the init fuction call, but add the sheetId and
iterate the rows
e.g.

function initOnEnter(sheetId, inputId, actionId) {
   var row = 0;
   var input = Tobago.element(sheetId + ":" + row + ":" + inputId);
   while (input) {
     input.actionId = actionId;
     Tobago.addEventListener(input, "keyup", "submitOnEnter(event)");
     row++;
     input = Tobago.element(sheetId + ":" + row + ":" + inputId);
   }
}

change the submitAction part in the submitOnEnter function to

  if (keyCode == 13) {
    var input = Tobago.element(event);
    var idPrefix = input.id.substring(0, input.id.lastIndexOf(":") + 1);
    Tobago.submitAction(idPrefix +  input.actionId);
  }

if your sheet is loaded via ajax or has paging/sorting enabled you
must invoke the init function via tc:out escape=false.
Also the initial value for row needs  to passed to the init function then.


Regards,
    Volker



2007/6/14, Madan Narra <madan.tobago@gmail.com>:
> Hi Volker ..
>
> Placed the same code as specified by you in previous mails...
>
> When working in FF with FireBug in it, saw this error
>
> uncaught exception: [Exception... "Could not convert JavaScript argument"
> nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame ::
> http://localhost:8080/XXX/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
> :: anonymous :: line 1199"  data: no]
>
> Line 0
> And one more thing,
>
> The First Textbox has an inputSuggest feature and the seacond textbox as
> described in previous mail is a column in sheet with multiple textboxs and
> has an renderPartially set to it.
>
> Will your solution work for my case ?
>
> Regards,
> Madan N

Mime
View raw message