Dynamic insertion of controlls

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Dynamic insertion of controlls

Prameela R

Hello,

 

I am trying to add date dynamically i.e. multiple dates again for each date iam trying to have multiple time fields.

But fallowing code is not working as I expected.

When I say extend date date row along with time is added dynamically but having the same time fileds as that of the first row.  When I select extend time time fields are getting added for all date row.

What is the solution for this. Why      

 

                 <xforms:setvalue ref="instance('event-instance')/EventDate[index('list')]/EventTime[index('timelist')]/StartTime" value="instance('time-instance')/newstarttime" />

Is not working properly?

 

 

 

           <table align="center" >

                <th></th>< > Start Date</th><th > End Date</th><th>Start Time</th><th >End Time</th><th >Time description</th>

                <xforms:repeat id="list" nodeset="instance('event-instance')/EventDate">

            <tr bgcolor="#FFFFFF">

            <td align="right"><xforms:trigger appearance="minimal">

            <xforms:label><xforms:output value="concat('&lt;img src=''', instance('date-instance')/removeimage, '''>')" mediatype="text/html"/></xforms:label>

            <xforms:action ev:event="DOMActivate" if="count(instance('event-instance')/EventDate) != 1">

            <xforms:delete context="instance('event-instance')" nodeset="EventDate"

               at="index('list')"/>

            </xforms:action>

                        </xforms:trigger>

            </td>

            <td><xforms:input ref="StartDate">

            </xforms:input></td>

            <td><xforms:input ref="EndDate">

            </xforms:input></td>

 

<xforms:variable name="datelistnum" value="index('list')"/>

 

            <td><!--*********Multiple Times***********--><xforms:output value="index('list')"/><xforms:output name="pos" value="position()"/>

                <xforms:trigger appearance="minimal">

                <xforms:label>Extend time</xforms:label>

                <xforms:message ref="url" ev:event="DOMActivate" level="modal"/>

                <xforms:action ev:event="DOMActivate">

                <xforms:insert nodeset="instance('event-instance')/EventDate[index('list')]/EventTime[index('timelist')]" at="last()" position="after" />

                <xforms:setvalue ref="instance('event-instance')/EventDate[index('list')]/EventTime[index('timelist')]/StartTime" value="instance('time-instance')/newstarttime" />

                <xforms:setvalue ref="instance('event-instance')/EventDate[index('list')]/EventTime[index('timelist')]/EndTime" value="instance('time-instance')/newendtime" />

                <xforms:setvalue ref="instance('event-instance')/EventDate[index('list')]/EventTime[index('timelist')]/Description" value="instance('time-instance')/newdes" />

               </xforms:action>

            </xforms:trigger>

                   

            <table>

            <xforms:repeat id="timelist" nodeset="instance('event-instance')/EventDate[index('list')]/EventTime">

            <tr> <td><xforms:input ref="StartTime">

            </xforms:input> </td>

            <td><xforms:input ref="EndTime">

            </xforms:input></td><td>

            <xforms:textarea ref="Description" style="width:100px;height:28px">

            </xforms:textarea></td></tr>

            </xforms:repeat>

            </table>

          

            <!--********************--></td>

           

            </tr>

            </xforms:repeat>

      

           </table>

Thanks & Regards

Prameela R

Software Engineer

Prodigy Systems & Services

Ph: +91 40 2001 6080 | +91 9052368989

Web: www.prodigygroupindia.com

 



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic insertion of controlls

Vinith Gowda1
I am not very clear about your requirement but

<xforms:setvalue
ref="instance('event-instance')/EventDate[index('list')]/EventTime[index('ti
melist')]/StartTime" value="instance('time-instance')/newstarttime" />

As per the above setvalue would set  value of instance('time-instance')/newstarttime to all its repeat elements as this is out of loop.

be more clear about your requirement thread lacks in info.

Vinith Gowda.

Prameela R wrote
Hello,

 

I am trying to add date dynamically i.e. multiple dates again for each date
iam trying to have multiple time fields.

But fallowing code is not working as I expected.

When I say extend date date row along with time is added dynamically but
having the same time fileds as that of the first row.  When I select extend
time time fields are getting added for all date row.

What is the solution for this. Why      

 

                 <xforms:setvalue
ref="instance('event-instance')/EventDate[index('list')]/EventTime[index('ti
melist')]/StartTime" value="instance('time-instance')/newstarttime" />

Is not working properly?

 

 

 

           
                < > Start Date
                <xforms:repeat id="list"
nodeset="instance('event-instance')/EventDate">

           
           
           
           
 

<xforms:variable name="datelistnum" value="index('list')"/>

 

           
           

           
            </xforms:repeat>

       

           
 End DateStart
Time
End TimeTime description
<xforms:trigger appearance="minimal">

            <xforms:label><xforms:output value="concat('&lt;img src=''',
instance('date-instance')/removeimage, '''>')"
mediatype="text/html"/></xforms:label>

            <xforms:action ev:event="DOMActivate"
if="count(instance('event-instance')/EventDate) != 1">

            <xforms:delete context="instance('event-instance')"
nodeset="EventDate"

               at="index('list')"/>

            </xforms:action>

                        </xforms:trigger>

           
<xforms:input ref="StartDate">

            </xforms:input>
<xforms:input ref="EndDate">

            </xforms:input>
<xforms:output
value="index('list')"/><xforms:output name="pos" value="position()"/>

                <xforms:trigger appearance="minimal">

                <xforms:label>Extend time</xforms:label>

                <xforms:message ref="url" ev:event="DOMActivate"
level="modal"/>

                <xforms:action ev:event="DOMActivate">

                <xforms:insert
nodeset="instance('event-instance')/EventDate[index('list')]/EventTime[index
('timelist')]" at="last()" position="after" />

                <xforms:setvalue
ref="instance('event-instance')/EventDate[index('list')]/EventTime[index('ti
melist')]/StartTime" value="instance('time-instance')/newstarttime" />

                <xforms:setvalue
ref="instance('event-instance')/EventDate[index('list')]/EventTime[index('ti
melist')]/EndTime" value="instance('time-instance')/newendtime" />

                <xforms:setvalue
ref="instance('event-instance')/EventDate[index('list')]/EventTime[index('ti
melist')]/Description" value="instance('time-instance')/newdes" />

               </xforms:action>

            </xforms:trigger>

                   

           
            <xforms:repeat id="timelist"
nodeset="instance('event-instance')/EventDate[index('list')]/EventTime">

             
           
            </xforms:repeat>

           
<xforms:input ref="StartTime">

            </xforms:input> 
<xforms:input ref="EndTime">

            </xforms:input>

            <xforms:textarea ref="Description"
style="width:100px;height:28px">

            </xforms:textarea>

           

           

Thanks & Regards

Prameela R

Software Engineer

Prodigy Systems & Services

Ph: +91 40 2001 6080 | +91 9052368989

Web:  <http://www.prodigygroupindia.com/> www.prodigygroupindia.com

 



--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws