problem in using xforms:show and xforms:setvalue in xforms:trigger

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

problem in using xforms:show and xforms:setvalue in xforms:trigger

Phani S
Hi all,

       I have an edit option. Which shows a dialog box. Edit instance looks like

<xforms:instance id="edit-instance">
    <edit-des xmlns="">
        <recordId />
        <description />
        <tmp/>
    </edit-des>
</xforms:instance>

I declared edit trigger like
  

  <xforms:trigger id="show-dialog-center1" class="xforms-trigger1">
    <xforms:label>Edit</xforms:label>
      <xforms:action ev:event="DOMActivate">
        <xforms:setvalue ref="instance('edit-instance')/symptomId" value="<%=record.getRecordId()%>" >
         </xforms:setvalue>
        <xforms:setvalue ref="instance('edit-instance')/description" value="<%=record.getDescription()%>">
          </xforms:setvalue>
       <xxforms:show dialog="editDialog" ev:event="DOMActive"/>
     </xforms:action>
   </xforms:trigger>

and the dialog declaration

<xxforms:dialog id="editDialog" level="modeless" close="true" draggable="true" appearance="full">
           <xforms:setvalue ev:event="xxforms-dialog-open" ref="context()/tmp" value="instance('edit-instance')/description"/>
           <xforms:label>Edit Symptom Description</xforms:label>
           <h5>Edit Symptom Description.</h5>
           <xforms:textarea ref="instance('edit-instance')/tmp" />
           <p>
                  <xforms:group>
                       <xxforms:hide ev:event="DOMActivate" dialog="editDialog"/>
                       <xforms:trigger>
                             <xforms:label>Update</xforms:label>
                <xforms:action ev:event="DOMActivate">
                                   <xforms:setvalue ref="instance('edit-instance')/description" value="context()/tmp" ev:event="DOMActivate"/>
                    <xforms:send submission="description-submission"/>
                </xforms:action>
                       </xforms:trigger>
                   </xforms:group>
           </p>
</xxforms:dialog>

It is showing the dialog fine. Before that it is not setting the values in instance. What is the problem in it. Please help me.
--
Regards
Phani. S



--
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: problem in using xforms:show and xforms:setvalue in xforms:trigger

Alessandro  Vernet
Administrator
Phani,

I don't see a <symptomId/> in your edit-instance, which could explain
why at least the first setvalue doesn't work. Also (unless what
record.getRecordId() returns is an XPath expression), instead of:

    <xforms:setvalue ref="instance('edit-instance')/symptomId"
value="<%=record.getRecordId()%>" >

You should write:

    <xforms:setvalue
ref="instance('edit-instance')/symptomId"><%=record.getRecordId()%></xforms:setvalue>

Alex

On Wed, Mar 10, 2010 at 3:45 AM, Phani Sajja <[hidden email]> wrote:

> Hi all,
>
>        I have an edit option. Which shows a dialog box. Edit instance looks
> like
>
> <xforms:instance id="edit-instance">
>     <edit-des xmlns="">
>         <recordId />
>         <description />
>         <tmp/>
>     </edit-des>
> </xforms:instance>
>
> I declared edit trigger like
>
>
>   <xforms:trigger id="show-dialog-center1" class="xforms-trigger1">
>     <xforms:label>Edit</xforms:label>
>       <xforms:action ev:event="DOMActivate">
>         <xforms:setvalue ref="instance('edit-instance')/symptomId"
> value="<%=record.getRecordId()%>" >
>          </xforms:setvalue>
>         <xforms:setvalue ref="instance('edit-instance')/description"
> value="<%=record.getDescription()%>">
>           </xforms:setvalue>
>        <xxforms:show dialog="editDialog" ev:event="DOMActive"/>
>      </xforms:action>
>    </xforms:trigger>
>
> and the dialog declaration
>
> <xxforms:dialog id="editDialog" level="modeless" close="true"
> draggable="true" appearance="full">
>            <xforms:setvalue ev:event="xxforms-dialog-open"
> ref="context()/tmp" value="instance('edit-instance')/description"/>
>            <xforms:label>Edit Symptom Description</xforms:label>
>            <h5>Edit Symptom Description.</h5>
>            <xforms:textarea ref="instance('edit-instance')/tmp" />
>            <p>
>                   <xforms:group>
>                        <xxforms:hide ev:event="DOMActivate"
> dialog="editDialog"/>
>                        <xforms:trigger>
>                              <xforms:label>Update</xforms:label>
>                 <xforms:action ev:event="DOMActivate">
>                                    <xforms:setvalue
> ref="instance('edit-instance')/description" value="context()/tmp"
> ev:event="DOMActivate"/>
>                     <xforms:send submission="description-submission"/>
>                 </xforms:action>
>                        </xforms:trigger>
>                    </xforms:group>
>            </p>
> </xxforms:dialog>
>
> It is showing the dialog fine. Before that it is not setting the values in
> instance. What is the problem in it. Please help me.
> --
> Regards
> Phani. S
>
>
>
> --
> 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
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet