Sales, G. (Grant) wrote:
> So the if statement with 'inDecript' is basically saying if the fields
> are known show the output and if they are not show the form to get the
> input?
Yes. It will be wrong if the user goes to /YourPage?inDescript=something
If you want to prevent that, you can determine if the method is http post
$request is an HttpServeletRequest so you can google for it's methods.

> 
> I'm not familiar with velocity at all . . I kinda just got thrown into
> this task 
:)
If you like java better and you have programming permission on the server you
can use groovy (which accepts 99% of all java code.)

> and seem to be lost with xwiki and can't find good working
> examples of velocity code (other then little clips, but not a whole
> page) or xwiki templates.
The pattern which I use is to post back to the same page where you viewed
the form and run that test.

This page is good because it shows all of the APIs which are available to you.
http://platform.xwiki.org/xwiki/bin/view/DevGuide/Scripting

Caleb

> 
> 
> Thanks for the pointer though!
> ~grant 
> 
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf
> Of Caleb James DeLisle
> Sent: Wednesday, June 02, 2010 12:54 PM
> To: XWiki Developers
> Subject: Re: [xwiki-devs] Passing values in HTML
> 
> If the form is posted back to the view page, you can get the values from
> the form inputs using velocity code like so:
> 
> #if($request.getParameter('inDecript'))
>   ## This parameter is set, assume we have received a post, let's not
> show the view page.
>   #set($inDecript = $request.getParameter('inDecript'))
>   ## do some stuff with the parameters.
> #else
>   ## no post, lets show the form
>   {{html}}
>     <form ....
>   {{/html}}
> #end
> 
> Then you have to use velocity (or groovy/python/ruby/php) to process the
> information.
> 
> Caleb
> 
> 
> Sales, G. (Grant) wrote:
>>> _____________________________________________ 
>>> From:       Sales, G. (Grant)  
>>> Sent:       Friday, May 28, 2010 01:43 PM
>>> To: '[email protected]'
>>> Subject:    Passing values in HTML
>>>
>>> I need to create a form simmilar to what a FAQ does but with more 
>>> values.
>>> I've built my form in HTML but I can't seem to figure out how to pass
> 
>>> the values within my table to a newly created page under a specific 
>>> parent with all the values filled in and saved (users need to still 
>>> be able to edit).
>>>
>>> The table is simmilar to this. But I've cut out business related 
>>> information and made the form/table smaller (less fields)
>>>
>>>
>>> <html>
>>> <form>
>>>
>>> <table border = "1">
>>> <tr><th>Number:</th><td><input type = "text" name = 
>>> "inNum"></td></tr> <tr><th>Name:</th><td><input type = "text" name = 
>>> "inName"></td></tr> </table>
>>>
>>> <table border = "1">
>>> <TR><TH rowspan = "6">Requirments</th></tr> <td>Business Driver / 
>>> Need (Description of problem or opportunity)</td>
>>>   <td><input type = "text" name = "inDecript">
>>>   </td>
>>> </tr>
>>> <tr>
>>>   <td>Driving Organization</td>
>>>   <td><select name="selOrg" >
>>>       <option value= "1">Not Applicable</option>
>>>
>>>       </select>
>>>   </td>
>>> </tr>
>>> <tr>
>>>   <td> Regulations </td>
>>>   <td> <select name="selReg">
>>>        <option value= "1">Not Applicable</option>
>>>        </select>
>>>   </td>
>>> </tr>
>>> <tr>
>>>   <td>Policies </td>
>>>   <td> <select name="selPol">
>>>        <option value= "1">Not Applicable</option>
>>>        </select>
>>>   </td>
>>> </tr>
>>> <tr>
>>>   <td>Category </td>
>>>   <td><input type="text" name="inCat">
>>>   </td>
>>> </tr>
>>> </table>
>>> </from>
>>>
>>>
>>> Any help would be great, this Xwiki syntax, forms, tables, templates 
>>> and classes have been driving me nuts, there has to be an easy little
> 
>>> section of code that can let me pass the values off to a new page and
> 
>>> create the page with table I just made, (copy entire contents of page
> 
>>> besides the "make new page button" with the fields filled in and
>>> selected)
>>>
>>> Grant Sales
>>> Security Operations Analyst
>>> ING
>>> 20 Washington Ave South
>>> Minneapolis, MN 55401
>>> Tel: 612.342.7889
>>> Fax: 612.342.3428
>>> Cell: 320.761.0966
>>> Email: [email protected]
>>> www.ing-usa.com
>>> ING. Your future. Made easier. (r)
>>>
>>>
>> ---------------------------------------------------------
>>
>> NOTICE: The information contained in this electronic mail message is
> confidential and intended only for certain recipients.  If you are not
> an intended recipient, you are hereby notified that any disclosure,
> reproduction, distribution or other use of this communication and any
> attachments is strictly prohibited.  If you have received this
> communication in error, please notify the sender by reply transmission
> and delete the message without copying or disclosing it.
>> ======================================================================
>> ====================== _______________________________________________
>> devs mailing list
>> [email protected]
>> http://lists.xwiki.org/mailman/listinfo/devs
>>
> 
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
> 

_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to