find records after submitting FORM

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

find records after submitting FORM

Jad El Omeiri
Hi all,

to describe my problem I though that showing a snapshot would be the best.

That is actually what I have:
-one FORM widget in the upper part, where the user can input text & select dropdowns
-another FORM (of type list) in the second part of the screen, which shows values in my DB

Currently, all the values in the 2nd FORM are static

What I would ideally like to do is: according to the user's inputs, have different queries triggered and show the results.

For that, I tried using events to work on the processing of the 1st form (thing I used to do for simple forms)

But after working a lot on that, I finally found that using services would be probably better than events. As I would be able to deal with delegator in my service.

The problem, is that I am still facing issues with that, and I am still a little bit confused about how to work.

Note: I can provide code and explain more if needed
PS: I wasn't able to find any source that is really clear about how to use services for making queries...

Thank you!

Jad
Jad El Omeiri
Reply | Threaded
Open this post in threaded view
|

Re: find records after submitting FORM

Jacques Le Roux
Administrator
Too small, can't read

Jacques

On Tuesday, January 14, 2014 5:59 PM, [hidden email] wrote

> Hi all,
>
> to describe my problem I though that showing a snapshot would be the best.
> <http://ofbiz.135035.n4.nabble.com/file/n4647193/Untitled.png>
> That is actually what I have:
> -one FORM widget in the upper part, where the user can input text & select
> dropdowns
> -another FORM (of type list) in the second part of the screen, which shows
> values in my DB
>
> Currently, all the values in the 2nd FORM are static
>
> What I would ideally like to do is: according to the user's inputs, have
> different queries triggered and show the results.
>
> For that, I tried using events to work on the processing of the 1st form
> (thing I used to do for simple forms)
>
> But after working a lot on that, I finally found that using services would
> be probably better than events. As I would be able to deal with delegator in
> my service.
>
> The problem, is that I am still facing issues with that, and I am still a
> little bit confused about how to work.
>
> Note: I can provide code and explain more if needed
> PS: I wasn't able to find any source that is really clear about how to use
> services for making queries...
>
> Thank you!
>
> Jad
>
>
>
> -----
> Jad El Omeiri
Reply | Threaded
Open this post in threaded view
|

Re: find records after submitting FORM

Jad El Omeiri
Untitled.png

I uploaded the snapshot. But anyway the snapshot was just to show the concept. as the values shown in the FORM (list) at bottom of the screen, were only for testing & taken from the entities related to component party

Do I provide you with code and more explanation?
Jad El Omeiri
Reply | Threaded
Open this post in threaded view
|

Re: find records after submitting FORM

Jad El Omeiri
BTW I know I'm asking a lot! But did you see my previous post about JOINs? To be honest, I thought you would be the only one giving me an answer

(respect to all :P )
Jad El Omeiri
Reply | Threaded
Open this post in threaded view
|

Re: find records after submitting FORM

Jad El Omeiri
So in fact I have the following form:

<form name="PlanetDropDown" type="single"  target="processDropdown">
   
  <field name="planetId" title="LoanVehicle" map-name="mechMap.postalAddress">
    <drop-down allow-empty="false" current="selected">
      <option key="parameterValue1" description="All"/>
      <option key="parameterValue2" description="Yes"/>
      <option key="parameterValue3" description="No"/>
    </drop-down>
  </field>
 
  <field name="planetId2" title="HireVehicle" map-name="mechMap.postalAddress">
    <drop-down allow-empty="false" current="selected">
      <option key="parameterValue1" description="All"/>
      <option key="parameterValue2" description="Yes"/>
      <option key="parameterValue3" description="No"/>
    </drop-down>
  </field>

  <field name="planetId3" title="Type" map-name="mechMap.postalAddress">
    <drop-down allow-empty="false" current="selected">
      <entity-options description="${planetName}" entity-name="Planet" key-field-name="planetId" filter-by-date="true">
        <entity-order-by field-name="planetName"/>
      </entity-options>
    </drop-down>
  </field>

  <field name="planetId4" title="Status" map-name="mechMap.postalAddress">
    <drop-down allow-empty="false" current="selected">
      <entity-options description="${planetName}" entity-name="Planet" key-field-name="planetId" filter-by-date="true">
        <entity-order-by field-name="planetName"/>
      </entity-options>
    </drop-down>
  </field>
 
  <field name="ContractStart"><date-time type="date" default-value="${bsh: org.ofbiz.base.util.UtilDateTime.nowTimestamp()}"/></field> 
  <field name="ContractEnd"><date-time type="date" default-value="${bsh: org.ofbiz.base.util.UtilDateTime.nowTimestamp()}"/></field> 
 
  <field name="make"><text/></field>
  <field name="model"><text/></field>       
  <field name="registrationNumber"><text/></field>
  <field name="search"><submit/></field> 
   
</form>


which is included in a screen.

I then created an event like this:

        public static String processDropdown(HttpServletRequest request,HttpServletResponse response)
        {
                String make = request.getParameter("make");
                String model = request.getParameter("model");
                String registrationNumber = request.getParameter("registrationNumber");
                String resultMsg = make + " " + model + " " + registrationNumber;  
                if( make==null || model==null || registrationNumber==null || make=="" || model=="" || registrationNumber==""  )
                {return "error";}
                request.setAttribute("resultMsg", resultMsg);
                request.setAttribute("allParams", UtilHttp.getParameterMap(request));
                request.setAttribute("submit", "Submitted");
                request.setAttribute("_EVENT_MESSAGE_", resultMsg);
               
       
                return "success";
               
        }
       

note: a lot is there just for testing. + I also wrote a lot of other screens, forms, ...for testing

Question:

How would I, from within the event shown above, trigger a query which would have conditions the make, model & other parameters that I am getting from my FORM.
And I would like to show the results of this query in another scree. Would having a FORM of type list in that screen be the best way to show the query results?

Jad El Omeiri
Reply | Threaded
Open this post in threaded view
|

Re: find records after submitting FORM

Jacques Le Roux
Administrator
Did you look at how it's done in OFBiz OOTB? There are plenty of cases where you enter/set values for a search and a have a result list underneath.
There are several ways to do this. Using a couple of widget forms (find a list forms) with the performFind service in the list form is the easiet, when possible
This is for instance a common pattern in lookups fields

Jacques

On Wednesday, January 15, 2014 12:12 PM, [hidden email] wrote

> So in fact I have the following form:
>
> /<form name="PlanetDropDown" type="single"  target="processDropdown">
>
>  <field name="planetId" title="LoanVehicle"
> map-name="mechMap.postalAddress">
>    <drop-down allow-empty="false" current="selected">
>      <option key="parameterValue1" description="All"/>
>      <option key="parameterValue2" description="Yes"/>
>      <option key="parameterValue3" description="No"/>
>    </drop-down>
>  </field>
>
>  <field name="planetId2" title="HireVehicle"
> map-name="mechMap.postalAddress">
>    <drop-down allow-empty="false" current="selected">
>      <option key="parameterValue1" description="All"/>
>      <option key="parameterValue2" description="Yes"/>
>      <option key="parameterValue3" description="No"/>
>    </drop-down>
>  </field>
>
>  <field name="planetId3" title="Type" map-name="mechMap.postalAddress">
>    <drop-down allow-empty="false" current="selected">
>      <entity-options description="${planetName}" entity-name="Planet"
> key-field-name="planetId" filter-by-date="true">
>        <entity-order-by field-name="planetName"/>
>      </entity-options>
>    </drop-down>
>  </field>
>
>  <field name="planetId4" title="Status" map-name="mechMap.postalAddress">
>    <drop-down allow-empty="false" current="selected">
>      <entity-options description="${planetName}" entity-name="Planet"
> key-field-name="planetId" filter-by-date="true">
>        <entity-order-by field-name="planetName"/>
>      </entity-options>
>    </drop-down>
>  </field>
>
>  <field name="ContractStart"><date-time type="date" default-value="${bsh:
> org.ofbiz.base.util.UtilDateTime.nowTimestamp()}"/></field>
>  <field name="ContractEnd"><date-time type="date" default-value="${bsh:
> org.ofbiz.base.util.UtilDateTime.nowTimestamp()}"/></field>
>
>  <field name="make"><text/></field>
>  <field name="model"><text/></field>
>  <field name="registrationNumber"><text/></field>
>  <field name="search"><submit/></field>
>
> </form>/
>
> which is included in a screen.
>
> I then created an event like this:
>
> / public static String processDropdown(HttpServletRequest
> request,HttpServletResponse response)
> {
> String make = request.getParameter("make");
> String model = request.getParameter("model");
> String registrationNumber = request.getParameter("registrationNumber");
> String resultMsg = make + " " + model + " " + registrationNumber;
> if( make==null || model==null || registrationNumber==null || make=="" ||
> model=="" || registrationNumber==""  )
> {return "error";}
> request.setAttribute("resultMsg", resultMsg);
> request.setAttribute("allParams", UtilHttp.getParameterMap(request));
> request.setAttribute("submit", "Submitted");
> request.setAttribute("_EVENT_MESSAGE_", resultMsg);
>
>
> return "success";
>
> }/
>
> note: a lot is there just for testing. + I also wrote a lot of other
> screens, forms, ...for testing
>
> Question:
>
> How would I, from within the event shown above, trigger a query which would
> have conditions the make, model & other parameters that I am getting from my
> FORM.
> And I would like to show the results of this query in another scree. Would
> having a FORM of type list in that screen be the best way to show the query
> results?
>
>
>
>
>
> -----
> Jad El Omeiri
Reply | Threaded
Open this post in threaded view
|

Re: find records after submitting FORM

Lei Wu
Jad,

I listed one example for you, with details

In the widget section of your some screen, add:
                  <decorator-screen name="FindScreenDecorator"
location="component://common/widget/CommonScreens.xml">
                    <decorator-section name="search-options">
                      <include-form name="FindCourses"
location="component://curricula/widget/curricula/Forms.xml"/>
                    </decorator-section>
                    <decorator-section name="search-results">
                      <include-form name="ListCourses"
location="component://curricula/widget/curricula/Forms.xml"/>
                    </decorator-section>
                  </decorator-screen>

In my example, in form FindCourses, it's just a simple form with type
'single', as shown below,
    <form name="FindCourses" type="single" target="courses"
default-entity-name="VCourses">
        <field name="noConditionFind"><hidden value="Y"/><!-- if this isn't
there then with all fields empty no query will be done --></field>
        <field name="courseId"
title="${uiLabelMap.CourseId}"><text-find></text-find></field>
        <field name="courseName"
title="${uiLabelMap.CourseName}"><text-find></text-find></field>
        <field name="searchButton" title="${uiLabelMap.CommonFind}"
widget-style="smallSubmit"><submit button-type="button"
image-location="/images/icons/magnifier.png"/></field>
    </form>

In my example, in form ListCourses, note you must have list-name with value
'listIt', and the only thing left to do is to provide your entityName with
interest, in my example, it's 'VCourses',
    <form name="ListCourses" type="list" list-name="listIt" target=""
paginate-target="courses" default-entity-name="VCourses"
separate-columns="true"
        odd-row-style="alternate-row" header-row-style="header-row-2"
default-table-style="basic-table hover-bar">
        <actions>
            <service service-name="performFind" result-map="result"
result-map-list="listIt">
                <field-map field-name="inputFields"
from-field="parameters"/>
                <field-map field-name="entityName" value="VCourses"/>
                <field-map field-name="orderBy"
from-field="parameters.sortField"/>
                <field-map field-name="viewIndex" from-field="viewIndex"/>
                <field-map field-name="viewSize" from-field="viewSize"/>
            </service>
        </actions>
    /* ... other specific contents that your form requires ... */
    </form>

Hope it helps.


On Sun, Jan 19, 2014 at 6:53 PM, Jacques Le Roux <
[hidden email]> wrote:

> Did you look at how it's done in OFBiz OOTB? There are plenty of cases
> where you enter/set values for a search and a have a result list underneath.
> There are several ways to do this. Using a couple of widget forms (find a
> list forms) with the performFind service in the list form is the easiet,
> when possible
> This is for instance a common pattern in lookups fields
>
> Jacques
>
> On Wednesday, January 15, 2014 12:12 PM, [hidden email]
> > So in fact I have the following form:
> >
> > /<form name="PlanetDropDown" type="single"  target="processDropdown">
> >
> >  <field name="planetId" title="LoanVehicle"
> > map-name="mechMap.postalAddress">
> >    <drop-down allow-empty="false" current="selected">
> >      <option key="parameterValue1" description="All"/>
> >      <option key="parameterValue2" description="Yes"/>
> >      <option key="parameterValue3" description="No"/>
> >    </drop-down>
> >  </field>
> >
> >  <field name="planetId2" title="HireVehicle"
> > map-name="mechMap.postalAddress">
> >    <drop-down allow-empty="false" current="selected">
> >      <option key="parameterValue1" description="All"/>
> >      <option key="parameterValue2" description="Yes"/>
> >      <option key="parameterValue3" description="No"/>
> >    </drop-down>
> >  </field>
> >
> >  <field name="planetId3" title="Type" map-name="mechMap.postalAddress">
> >    <drop-down allow-empty="false" current="selected">
> >      <entity-options description="${planetName}" entity-name="Planet"
> > key-field-name="planetId" filter-by-date="true">
> >        <entity-order-by field-name="planetName"/>
> >      </entity-options>
> >    </drop-down>
> >  </field>
> >
> >  <field name="planetId4" title="Status" map-name="mechMap.postalAddress">
> >    <drop-down allow-empty="false" current="selected">
> >      <entity-options description="${planetName}" entity-name="Planet"
> > key-field-name="planetId" filter-by-date="true">
> >        <entity-order-by field-name="planetName"/>
> >      </entity-options>
> >    </drop-down>
> >  </field>
> >
> >  <field name="ContractStart"><date-time type="date" default-value="${bsh:
> > org.ofbiz.base.util.UtilDateTime.nowTimestamp()}"/></field>
> >  <field name="ContractEnd"><date-time type="date" default-value="${bsh:
> > org.ofbiz.base.util.UtilDateTime.nowTimestamp()}"/></field>
> >
> >  <field name="make"><text/></field>
> >  <field name="model"><text/></field>
> >  <field name="registrationNumber"><text/></field>
> >  <field name="search"><submit/></field>
> >
> > </form>/
> >
> > which is included in a screen.
> >
> > I then created an event like this:
> >
> > / public static String processDropdown(HttpServletRequest
> > request,HttpServletResponse response)
> > {
> > String make = request.getParameter("make");
> > String model = request.getParameter("model");
> > String registrationNumber = request.getParameter("registrationNumber");
> > String resultMsg = make + " " + model + " " + registrationNumber;
> > if( make==null || model==null || registrationNumber==null || make=="" ||
> > model=="" || registrationNumber==""  )
> > {return "error";}
> > request.setAttribute("resultMsg", resultMsg);
> > request.setAttribute("allParams", UtilHttp.getParameterMap(request));
> > request.setAttribute("submit", "Submitted");
> > request.setAttribute("_EVENT_MESSAGE_", resultMsg);
> >
> >
> > return "success";
> >
> > }/
> >
> > note: a lot is there just for testing. + I also wrote a lot of other
> > screens, forms, ...for testing
> >
> > Question:
> >
> > How would I, from within the event shown above, trigger a query which
> would
> > have conditions the make, model & other parameters that I am getting
> from my
> > FORM.
> > And I would like to show the results of this query in another scree.
> Would
> > having a FORM of type list in that screen be the best way to show the
> query
> > results?
> >
> >
> >
> >
> >
> > -----
> > Jad El Omeiri
>
Reply | Threaded
Open this post in threaded view
|

Re: find records after submitting FORM

Jad El Omeiri
Thanks Jaques for suggesting to see how it is done OOTB.
I actually didn't know about performFind. In fact I was writing it from scratch. It's finally great to be able to use it directly.

Jacques Le Roux wrote
Did you look at how it's done in OFBiz OOTB? There are plenty of cases where you enter/set values for a search and a have a result list underneath.
There are several ways to do this. Using a couple of widget forms (find a list forms) with the performFind service in the list form is the easiet, when possible
This is for instance a common pattern in lookups fields

Jacques

On Wednesday, January 15, 2014 12:12 PM, [hidden email] wrote
> So in fact I have the following form:
>
> /<form name="PlanetDropDown" type="single"  target="processDropdown">
>
>  <field name="planetId" title="LoanVehicle"
> map-name="mechMap.postalAddress">
>    <drop-down allow-empty="false" current="selected">
>      <option key="parameterValue1" description="All"/>
>      <option key="parameterValue2" description="Yes"/>
>      <option key="parameterValue3" description="No"/>
>    </drop-down>
>  </field>
>
>  <field name="planetId2" title="HireVehicle"
> map-name="mechMap.postalAddress">
>    <drop-down allow-empty="false" current="selected">
>      <option key="parameterValue1" description="All"/>
>      <option key="parameterValue2" description="Yes"/>
>      <option key="parameterValue3" description="No"/>
>    </drop-down>
>  </field>
>
>  <field name="planetId3" title="Type" map-name="mechMap.postalAddress">
>    <drop-down allow-empty="false" current="selected">
>      <entity-options description="${planetName}" entity-name="Planet"
> key-field-name="planetId" filter-by-date="true">
>        <entity-order-by field-name="planetName"/>
>      </entity-options>
>    </drop-down>
>  </field>
>
>  <field name="planetId4" title="Status" map-name="mechMap.postalAddress">
>    <drop-down allow-empty="false" current="selected">
>      <entity-options description="${planetName}" entity-name="Planet"
> key-field-name="planetId" filter-by-date="true">
>        <entity-order-by field-name="planetName"/>
>      </entity-options>
>    </drop-down>
>  </field>
>
>  <field name="ContractStart"><date-time type="date" default-value="${bsh:
> org.ofbiz.base.util.UtilDateTime.nowTimestamp()}"/></field>
>  <field name="ContractEnd"><date-time type="date" default-value="${bsh:
> org.ofbiz.base.util.UtilDateTime.nowTimestamp()}"/></field>
>
>  <field name="make"><text/></field>
>  <field name="model"><text/></field>
>  <field name="registrationNumber"><text/></field>
>  <field name="search"><submit/></field>
>
> </form>/
>
> which is included in a screen.
>
> I then created an event like this:
>
> / public static String processDropdown(HttpServletRequest
> request,HttpServletResponse response)
> {
> String make = request.getParameter("make");
> String model = request.getParameter("model");
> String registrationNumber = request.getParameter("registrationNumber");
> String resultMsg = make + " " + model + " " + registrationNumber;
> if( make==null || model==null || registrationNumber==null || make=="" ||
> model=="" || registrationNumber==""  )
> {return "error";}
> request.setAttribute("resultMsg", resultMsg);
> request.setAttribute("allParams", UtilHttp.getParameterMap(request));
> request.setAttribute("submit", "Submitted");
> request.setAttribute("_EVENT_MESSAGE_", resultMsg);
>
>
> return "success";
>
> }/
>
> note: a lot is there just for testing. + I also wrote a lot of other
> screens, forms, ...for testing
>
> Question:
>
> How would I, from within the event shown above, trigger a query which would
> have conditions the make, model & other parameters that I am getting from my
> FORM.
> And I would like to show the results of this query in another scree. Would
> having a FORM of type list in that screen be the best way to show the query
> results?
>
>
>
>
>
> -----
> Jad El Omeiri
and thank you Lei for the example showing how to use performFind

Lei Wu wrote
Jad,

I listed one example for you, with details

In the widget section of your some screen, add:
                  <decorator-screen name="FindScreenDecorator"
location="component://common/widget/CommonScreens.xml">
                    <decorator-section name="search-options">
                      <include-form name="FindCourses"
location="component://curricula/widget/curricula/Forms.xml"/>
                    </decorator-section>
                    <decorator-section name="search-results">
                      <include-form name="ListCourses"
location="component://curricula/widget/curricula/Forms.xml"/>
                    </decorator-section>
                  </decorator-screen>

In my example, in form FindCourses, it's just a simple form with type
'single', as shown below,
    <form name="FindCourses" type="single" target="courses"
default-entity-name="VCourses">
        <field name="noConditionFind"><hidden value="Y"/></field>
        <field name="courseId"
title="${uiLabelMap.CourseId}"><text-find></text-find></field>
        <field name="courseName"
title="${uiLabelMap.CourseName}"><text-find></text-find></field>
        <field name="searchButton" title="${uiLabelMap.CommonFind}"
widget-style="smallSubmit"><submit button-type="button"
image-location="/images/icons/magnifier.png"/></field>
    </form>

In my example, in form ListCourses, note you must have list-name with value
'listIt', and the only thing left to do is to provide your entityName with
interest, in my example, it's 'VCourses',
    <form name="ListCourses" type="list" list-name="listIt" target=""
paginate-target="courses" default-entity-name="VCourses"
separate-columns="true"
        odd-row-style="alternate-row" header-row-style="header-row-2"
default-table-style="basic-table hover-bar">
        <actions>
            <service service-name="performFind" result-map="result"
result-map-list="listIt">
                <field-map field-name="inputFields"
from-field="parameters"/>
                <field-map field-name="entityName" value="VCourses"/>
                <field-map field-name="orderBy"
from-field="parameters.sortField"/>
                <field-map field-name="viewIndex" from-field="viewIndex"/>
                <field-map field-name="viewSize" from-field="viewSize"/>
            </service>
        </actions>
    /* ... other specific contents that your form requires ... */
    </form>

Hope it helps.


On Sun, Jan 19, 2014 at 6:53 PM, Jacques Le Roux <
[hidden email]> wrote:

> Did you look at how it's done in OFBiz OOTB? There are plenty of cases
> where you enter/set values for a search and a have a result list underneath.
> There are several ways to do this. Using a couple of widget forms (find a
> list forms) with the performFind service in the list form is the easiet,
> when possible
> This is for instance a common pattern in lookups fields
>
> Jacques
>
> On Wednesday, January 15, 2014 12:12 PM, [hidden email]
> > So in fact I have the following form:
> >
> > /<form name="PlanetDropDown" type="single"  target="processDropdown">
> >
> >  <field name="planetId" title="LoanVehicle"
> > map-name="mechMap.postalAddress">
> >    <drop-down allow-empty="false" current="selected">
> >      <option key="parameterValue1" description="All"/>
> >      <option key="parameterValue2" description="Yes"/>
> >      <option key="parameterValue3" description="No"/>
> >    </drop-down>
> >  </field>
> >
> >  <field name="planetId2" title="HireVehicle"
> > map-name="mechMap.postalAddress">
> >    <drop-down allow-empty="false" current="selected">
> >      <option key="parameterValue1" description="All"/>
> >      <option key="parameterValue2" description="Yes"/>
> >      <option key="parameterValue3" description="No"/>
> >    </drop-down>
> >  </field>
> >
> >  <field name="planetId3" title="Type" map-name="mechMap.postalAddress">
> >    <drop-down allow-empty="false" current="selected">
> >      <entity-options description="${planetName}" entity-name="Planet"
> > key-field-name="planetId" filter-by-date="true">
> >        <entity-order-by field-name="planetName"/>
> >      </entity-options>
> >    </drop-down>
> >  </field>
> >
> >  <field name="planetId4" title="Status" map-name="mechMap.postalAddress">
> >    <drop-down allow-empty="false" current="selected">
> >      <entity-options description="${planetName}" entity-name="Planet"
> > key-field-name="planetId" filter-by-date="true">
> >        <entity-order-by field-name="planetName"/>
> >      </entity-options>
> >    </drop-down>
> >  </field>
> >
> >  <field name="ContractStart"><date-time type="date" default-value="${bsh:
> > org.ofbiz.base.util.UtilDateTime.nowTimestamp()}"/></field>
> >  <field name="ContractEnd"><date-time type="date" default-value="${bsh:
> > org.ofbiz.base.util.UtilDateTime.nowTimestamp()}"/></field>
> >
> >  <field name="make"><text/></field>
> >  <field name="model"><text/></field>
> >  <field name="registrationNumber"><text/></field>
> >  <field name="search"><submit/></field>
> >
> > </form>/
> >
> > which is included in a screen.
> >
> > I then created an event like this:
> >
> > / public static String processDropdown(HttpServletRequest
> > request,HttpServletResponse response)
> > {
> > String make = request.getParameter("make");
> > String model = request.getParameter("model");
> > String registrationNumber = request.getParameter("registrationNumber");
> > String resultMsg = make + " " + model + " " + registrationNumber;
> > if( make==null || model==null || registrationNumber==null || make=="" ||
> > model=="" || registrationNumber==""  )
> > {return "error";}
> > request.setAttribute("resultMsg", resultMsg);
> > request.setAttribute("allParams", UtilHttp.getParameterMap(request));
> > request.setAttribute("submit", "Submitted");
> > request.setAttribute("_EVENT_MESSAGE_", resultMsg);
> >
> >
> > return "success";
> >
> > }/
> >
> > note: a lot is there just for testing. + I also wrote a lot of other
> > screens, forms, ...for testing
> >
> > Question:
> >
> > How would I, from within the event shown above, trigger a query which
> would
> > have conditions the make, model & other parameters that I am getting
> from my
> > FORM.
> > And I would like to show the results of this query in another scree.
> Would
> > having a FORM of type list in that screen be the best way to show the
> query
> > results?
> >
> >
> >
> >
> >
> > -----
> > Jad El Omeiri
>
It wasn't just useful. But very very useful! Thanks!
Jad El Omeiri
Reply | Threaded
Open this post in threaded view
|

Re: find records after submitting FORM

Jad El Omeiri
Hi again,

that's a really quick one.
How can I easily check for "listIt" value (the result of the performFind service) from within a screen?
I am able to check its value from within my form. But I also need to do it from a screen if possible.

Thanks guys,
Jad El Omeiri
Reply | Threaded
Open this post in threaded view
|

Re: find records after submitting FORM

Jacques Le Roux
Administrator
Screen and form widgets share the <actions in common. So you can use performFind inside a <screen.
I guess you already found that by yourself since there is at last 1 example OOTB: FindArInvoices screen.

Now if your question is only about "checking" the value of  listIt as a result of performFind, then there are many ways, it depends on your imagination.
You may use the <set action and groovy inside of it to print in the log, or even use the <script action if you need something more sophisticated.
Though the easiet way is to show it on screen (web page) using <label in the <widget section. Something like:
<label>result.listIt=========${result.listIt}</label>

There are other possiblities, but that's the easiest

HTH

Jacques

On Tuesday, January 28, 2014 10:21 AM, [hidden email] wrote

> Hi again,
>
> that's a really quick one.
> How can I easily check for "listIt" value (the result of the performFind
> service) from within a screen?
> I am able to check its value from within my form. But I also need to do it
> from a screen if possible.
>
> Thanks guys,
>
>
>
> -----
> Jad El Omeiri