Change elements of a nodeset repeater (XForms/betterFORM)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Change elements of a nodeset repeater (XForms/betterFORM)

Felix Maas
Dear Sir or Madame,
 
I use XForms with the betterFORM processor and I have the following problem. I want to change the content of an element of a selected entry in a nodeset repeat and one entry of the following element by clicking a button.
That does work as long as I do not add a condition (e.g. by adding the tag <xf:group>). The path is definitely correct. Is the problem known and is there a solution for that?
The following code snippet shows the relevant part. As I said: if I delete the <xf:group> tag it works!
 
   <xf:trigger>
        <xf:label>Change state</xf:label>
        <xf:group ref=".[//project[index('project-repeat')]/activity[index('activity-repeat')]/state eq 'in process']">
            <xf:action>
                <xf:setvalue ref="//project[index('project-repeat')]/activity[index('activity-repeat')]/state">finished</xf:setvalue>
            </xf:action>
            <xf:action>
                <xf:setvalue ref="//project[index('project-repeat')]/activity[index('activity-repeat') + 1]/state">in process</xf:setvalue>
            </xf:action>
        </xf:group>
    </xf:trigger>
 
Best regards,
Felix

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Change elements of a nodeset repeater (XForms/betterFORM)

Joern Turner-4
no,

no general problem known here but a snippet of a form is hardly enough to tell. E.g. what is the '.' context node here.

For a better answer please always provide a complete (probably broken down) form - otherwise it's hard to tell what the problem is.

Joern

On Sun, Mar 12, 2017 at 12:02 PM, Felix Maas <[hidden email]> wrote:
Dear Sir or Madame,
 
I use XForms with the betterFORM processor and I have the following problem. I want to change the content of an element of a selected entry in a nodeset repeat and one entry of the following element by clicking a button.
That does work as long as I do not add a condition (e.g. by adding the tag <xf:group>). The path is definitely correct. Is the problem known and is there a solution for that?
The following code snippet shows the relevant part. As I said: if I delete the <xf:group> tag it works!
 
   <xf:trigger>
        <xf:label>Change state</xf:label>
        <xf:group ref=".[//project[index('project-repeat')]/activity[index('activity-repeat')]/state eq 'in process']">
            <xf:action>
                <xf:setvalue ref="//project[index('project-repeat')]/activity[index('activity-repeat')]/state">finished</xf:setvalue>
            </xf:action>
            <xf:action>
                <xf:setvalue ref="//project[index('project-repeat')]/activity[index('activity-repeat') + 1]/state">in process</xf:setvalue>
            </xf:action>
        </xf:group>
    </xf:trigger>
 
Best regards,
Felix

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Threads in eXist-db

Felix Maas
In reply to this post by Felix Maas

Hello everyone,

I impement a webbased database application with eXist-db (by using the restxq module). Within this application projects are managed. Now I want to make the creating and editing processes of a project thread safe. Did not really found something in the eXist literature and in the web so I would like to ask you here if there are solutions in eXist/XQuery.

Best regards, Felix


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Threads in eXist-db

Adam Retter
Hi Felix,

eXist itself should be threadsafe. However if you need to coordinate
exclusive access to resources between your users, then you can use the
XQuery functions util:exclusive-lock and util:shared-lock

On 10 April 2017 at 04:01, Felix Maas <[hidden email]> wrote:

> Hello everyone,
>
> I impement a webbased database application with eXist-db (by using the
> restxq module). Within this application projects are managed. Now I want to
> make the creating and editing processes of a project thread safe. Did not
> really found something in the eXist literature and in the web so I would
> like to ask you here if there are solutions in eXist/XQuery.
>
> Best regards, Felix
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open
>



--
Adam Retter

eXist Developer
{ United Kingdom }
[hidden email]
irc://irc.freenode.net/existdb

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Loading...