Dynamic Controls

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

Dynamic Controls

Arjun
Hi

    I want to create input control dynamically form the response of a webservice in form-builder ? what need to be done to achieve this ?Any help please
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Controls

Alessandro  Vernet
Administrator
Hi Arjun,

What do you mean "create an input dynamically"? Do you need to populate an input based on the result? Or decide the type of the input based on the result?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Controls

Arjun
Hi Alex,
   
        Based on the response from web service I want to display a input control Dynamically,For example I have a response say as below

Sample.xml

<body>
 <result>
     <controls>
          <row1>
                 <col1>col1</col1>
                 <col2>col2</col2>
          </row1>

          <row2>
                 <col1>col1</col1>
                 <col2>col2</col2>
          </row2>

          <row2>
                 <col1>col1</col1>
                 <col2>col2</col2>
          </row2>
         
    </controls>
 </result>
<body>

So from the above response I want to have a repeat section which has the ability to dynamically create input controls and also ability to add the controls if we click on the '+' icon form the repeat section.



Regards
Arjun.
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Controls

Erik Bruchez
Administrator
With Form Builder, the first steps are:

1. Insert a New Repeat
2. Add your input controls to the repeat
3. Name the repeat and input controls

This will create a repeated grid with the +/- buttons.

The second part is to figure out how to fill-out the data in response
from the web service. I fear that you can't do this directly from the
form builder UI at this point. Form Builder actions don't handle
repeats yet.

So, you would then have to write a piece of XForms to do that.

-Erik

On Sun, Aug 18, 2013 at 10:58 PM, Arjun <[hidden email]> wrote:

> Hi Alex,
>
>         Based on the response from web service I want to display a input
> control Dynamically,For example I have a response say as below
>
> Sample.xml
>
> <body>
>  <result>
>      <controls>
>           <row1>
>                  <col1>col1</col1>
>                  <col2>col2</col2>
>           </row1>
>
>           <row2>
>                  <col1>col1</col1>
>                  <col2>col2</col2>
>           </row2>
>
>           <row2>
>                  <col1>col1</col1>
>                  <col2>col2</col2>
>           </row2>
>
>     </controls>
>  </result>
> <body>
>
> So from the above response I want to have a repeat section which has the
> ability to dynamically create input controls and also ability to add the
> controls if we click on the '+' icon form the repeat section.
>
> <http://discuss.orbeon.com/file/n4657181/dynamic.png>
>
> Regards
> Arjun.
>
>
> --
> View this message in context: http://discuss.orbeon.com/Dynamic-Controls-tp4657167p4657181.html
> Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.
>
> --
> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Controls

Arjun
Hi Erik,

        As you suggested me to use a piece of XForms to do this  Can you please help me on this with an example  where i need use a repeat control ?


Regards,
Arjun
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Controls

Arjun
Hi Erik,

             Whether i need to use xforms:repeat for solving the mentioned problem.can you please help me on this?
How can i see the response of a web-service in Orbeon form builder?



Regards,
Arjun  
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Controls

Erik Bruchez
Administrator
Arjun,

Here is a working example:

https://gist.github.com/ebruchez/6518825

The interesting bit is the XForms action starting with:

<xf:action ev:event="xforms-submit-done" observer="foo-submission">

-Erik