Hi Alain,

See attached for a sample xforms.

I will have to change select1 to read from an xml file ... what i want to
know is how does the dropdown get refreshed once the xml file has been
updated and making the newly created record visible in the dropdown.

I appreciate your assistance - only my day 2 on xforms thus far!

Take care

On Fri, Jan 18, 2013 at 8:58 AM, COUTHURES Alain <[email protected]>wrote:

> Hi Fatima,
>
> You need to use a dialog to be able to enter a new entry. Do you have seen
> some examples about dialogs already?
>
> You're talking about a database table: would you like to use the CSV
> support or are you converting the table into XML already?
>
> Did you try to write some form already?
>
> -Alain
>
> Le 18/01/2013 07:48, Fatima a écrit :
>
>  Hi All,
>> I have a select1 based on an external resource (database table). I want
>> to be able to add a new entry to the select list by allowing the user to
>> click an 'add new' button beside the select list, open a modal window, add
>> the new entry, save it (to the database), then on closing the page the
>> select list is updated with the new entry included.
>> Can anyone assist?
>> Thanks!
>>
>>
>
<?xml version="1.0" encoding="UTF-8"?>
<data xmlns="">
    <vessel/>
	<newvessel>
		<newvesselname/>
	</newvessel>
</data>
<?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?>
<html
 xmlns="http://www.w3.org/1999/xhtml";
 xmlns:xf="http://www.w3.org/2002/xforms";
 xmlns:ev="http://www.w3.org/2001/xml-events";>
	<head>
		<title/>
		<style type="text/css">
    #details {
     width: 250px;
     height: 100px;
    }
		</style>
		<xf:model>
			<xf:instance src="test1_data.xml"/>
			<xf:setfocus ev:event="xforms-ready" control="vessel"/>
		</xf:model>
	</head>
	<body>
	   <xf:group>
		<xf:select1 ref="vessel" appearance="minimal" incremental="true">  
			<xf:label>Vessel:</xf:label>
			<xf:item>
				<xf:label>Sally May</xf:label>
				<xf:value>1</xf:value> 
			</xf:item>
			<xf:item>
				<xf:label>June bug</xf:label>
				<xf:value>2</xf:value>
			</xf:item>
			<xf:item>
				<xf:label>Oasis Blue</xf:label>
				<xf:value>3</xf:value>
			</xf:item>
			<xf:item>
				<xf:label>Rub a dub dub</xf:label>
				<xf:value>4</xf:value>
			</xf:item>
		</xf:select1>
			<xf:trigger>
				<xf:label>Add new</xf:label>
				<xf:action ev:event="DOMActivate">
					<xf:show dialog="details"/>
					<xf:setfocus control="vessel"/>
				</xf:action>
			</xf:trigger>
		</xf:group>
		<br/>
		<xf:dialog id="details">
			<xf:input id="newvesselname" ref="newvessel/newvesselname">
				<xf:label>Vessel Name : </xf:label>
			</xf:input>
			<br/>
			<br/>
			<xf:trigger>
				<xf:label>Close</xf:label>
				<xf:action ev:event="DOMActivate">
					<xf:hide dialog="details"/>
					<xf:setfocus control="vessel"/>
				</xf:action>
			</xf:trigger>
		</xf:dialog>
	</body>
</html>
------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
Xsltforms-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xsltforms-support

Reply via email to