PDA

View Full Version : Designing a Form



J.Raju83
26 Feb 2008, 2:32 AM
Hi All,
I am new Ext.nd. I am designing a sample form which will have the Ext.nd's HTML Header and Ext.onReady() method renders a default form.
Now i want to place some fields and get user's input on the fields and how do i save the form using Ext.nd?
Sorry, that i am asking a very simple thing as i do not know the classes and its properties available in Ext.nd.
Also can i write my own javascript to generate dynamic fields?

Thanks in Advance!!!

galdaka
26 Feb 2008, 4:17 AM
http://extjs.com/forum/showthread.php?t=18802&highlight=save+document

jratcliff
26 Feb 2008, 9:49 PM
Well, we now support some common @Commands and one is "FileSave" so, with Domino Designer try putting an action button in the actionbar and make the formula:


@Command([FileSave])

RWaters
27 Feb 2008, 9:09 AM
Hi All,
Also can i write my own javascript to generate dynamic fields?


As Jack mentioned we do some simple translation of @formulas to deal with submitting the form. The issue I see with this part of the question is it sounds like you want to generate fields in JavaScript that aren't currently fields within the form in notes. In my experience it takes creating/updating the document through an agent to accomplish this.

jratcliff
27 Feb 2008, 10:31 AM
As Jack mentioned we do some simple translation of @formulas to deal with submitting the form. The issue I see with this part of the question is it sounds like you want to generate fields in JavaScript that aren't currently fields within the form in notes. In my experience it takes creating/updating the document through an agent to accomplish this.

Rich is right, if you add fields dynamically via JavaScript and then submit back to the form via the @Command([FileSave]) or your own document.forms[0].submit() then the Domino server will throw an error (at least with versions 5 and 6, not sure about 7 or 8) and not save the form. To work around this you have 2 options:

Option 1
Do as Rich suggests and post your data back to an Agent and have the agent parse the data and write to the document

Option 2
If you can know in advanced the names of the dynamic fields you will be creating, then create these same fields on the form in Domino Designer and then just hide them with a hide/when formula. Then, you can do a normal submit or @Command([FileSave]) and since the fields you added dynamically are now on the form, the server won't throw and error and will continue with your save.

J.Raju83
27 Feb 2008, 8:27 PM
Rich is right, if you add fields dynamically via JavaScript and then submit back to the form via the @Command([FileSave]) or your own document.forms[0].submit() then the Domino server will throw an error (at least with versions 5 and 6, not sure about 7 or 8) and not save the form. To work around this you have 2 options:

Option 1
Do as Rich suggests and post your data back to an Agent and have the agent parse the data and write to the document

Option 2
If you can know in advanced the names of the dynamic fields you will be creating, then create these same fields on the form in Domino Designer and then just hide them with a hide/when formula. Then, you can do a normal submit or @Command([FileSave]) and since the fields you added dynamically are now on the form, the server won't throw and error and will continue with your save.

Yes. As Mr. RWaters suggestion they are not really fields. Now I have implemented the 1st Option.

As i do not know the number of fields that are going to be generated in the form, i wrote a small agent which will run on some event and keeps updating the document in the background.

But now i need to handle the Delete/Edit options of the dynamic fields.
Also is there a way in Ext.nd to create a grid to implement the same?

Thanks!!

RWaters
28 Feb 2008, 2:28 PM
Also is there a way in Ext.nd to create a grid to implement the same?

Not sure I fully understand the question. You want to create a grid without knowing the columns ahead of time? Ext.nd has UIView which takes a standard domino view and maps everything into an Ext.grid.GridPanel. Technically again you could go through an agent that lets you pass in parameters to get a collection of documents and tell it what fields you want back. The easiest way at that point though would probably be just to use a standard Ext.data.JsonStore and Ext.grid.GridPanel.