cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

How to validate textbox, dropdown which are in the repeater widget?

DT
12-Amethyst
12-Amethyst

How to validate textbox, dropdown which are in the repeater widget?

Hi Everyone,

I have one repeater which contain textboxes(all are string base type) and dropdown but I am not able to validate those widget which are in the repeater. 

When I am using this repeater into another mashup where I want to validate all textbox and dropdown are mandatory filled.

I am using thingworx 8.1 version, Please help me if you have any solution on it.

9 REPLIES 9
slangley
23-Emerald II
(To:DT)

Hi @DT.

 

Is the validator set on the inner mashup?  If you run the inner mashup, does the validation work?

 

Note that you are running an extremely old version of ThingWorx that has not been supported in some time.  The repeater widget was replaced in the more recent versions of the product by the collector widget, which performs much better.

 

We recommend upgrading to one of the supported versions of the product (9.0, 9.1, and 9.2) due to the many security updates, bug fixes, and new features that are available.

 

Regards.

 

--Sharon

DT
12-Amethyst
12-Amethyst
(To:slangley)

Yes I know I am using too old version but as of now I have to manage all this requirement in this version only.

I attached image of my requirement you will get some idea.

Is the validator set on the inner mashup?  If you run the inner mashup, does the validation work?

-I have applied validator on inner mashup but it failed because outer mashup submit button click event I have to sent to inner mashup which I don't know how to do it.

Description:

  1. Inner mashup having one row which include textboxes and drop down
  2. As you can see there is add line button which will add the row in the inner mashup as I have already added two rows.
  3. So when I will click on submit button which are present in the outer mashup I want to validate all the filed in inner mashup which is filled or not.
    • If all fields all filled then submit button will click the service which add all entries in the data table
    • If all fields are not filled I want show the error symbol which are in the image as you can see.
  4. Can you please tell how to achieve this in thing Worx.

 

slangley
23-Emerald II
(To:slangley)

Hi @Dhiraj28.

 

This information was helpful but we're not understanding why you would need the use of the repeater widget in this case.  Also, since you have the functions located in the outer mashup, instead of where the data is located, it doesn't know what to do with them.  You can pass parameters between the two, but for this scenario it doesn't sound like it's needed.

 

Regards.

 

--Sharon

DT
12-Amethyst
12-Amethyst
(To:slangley)

Hi @slangley  

I need to add multiple row according to the requirement and Repeater is the one widget by using I can add multiple textboxes, dropdown as a one row.
So when I click on submit button I need to validate all the textboxes and dropdown should be mandatory.

Please help me how we can validate textboxes and dropdown which are in the repeater.

 

Hi,

 

In the repeater or the newer collection widget you will need to use a session variable to accomplish this task.  The session variable will hold the data which can be modified in each row.  This is also where you can indicate if the row is "valid" or not using the validator in the inner mashup.  Once the submit button is clicked the data in the session variable is processed checking the validation flag before calling the next service or displaying an error message.

 

Thanks,

 

Travis

DT
12-Amethyst
12-Amethyst
(To:TravisPickett)

For one row I have done the validation part but when I add multiple row it will not working for multiple row.
For one row it is working but for more row it is not working.
steps:

  • I am passing inner mashup validator result to session and get that result in the outer mashup.
  • Taking that result to validator I am passing opposite result to same session variable.
  • Again when I click on submit I am passing that result to this session variable to trigger inner mashup validator.
  • Then finally if the all fields are filled then I am passing inner mashup result to other session variable and that result I have pass to outer mashup other validator which calculate that all fields are filled or not.

From above steps I have done validation for only one row but how I can validate for multiple row.

I am struggling to do that?

Or Please let me know if I can do this adding multiple row by using any other widgets or any other grids so it will easy to validate.

Or
Should I do it using Grid widget but in the grid widget how can i add dropdown?

Should I display a multiple row which are given in the attachment by using grid apart from repeater widget?

Please refer attachment.

Hello,

 

For the session variable you will have to use an infotable with one row per data row or you can use a JSON variable with the row identifiers as keys.  Please note there is a bug related to JSON session variables where you can not provide a default value on the thingShape.  This has been fixed in later versions I am just not sure which version it started in.

 

This will also require you to manage the session variable when you are adding a deleting rows.

 

In a recent implementation I just did we used the incoming datas row number as the unique identifier into the session variable.

 

Thanks,

 

Travis

DT
12-Amethyst
12-Amethyst
(To:TravisPickett)

Hi @TravisPickett ,

Is it possible to show multiple row using grid table on the mashup as shown in attachment.
or Any other way to show multiple row without using repeater widget

 

Hi @DT,

 

It is not possible to have drop downs in the advanced grid or even the new grid in 9.2 and 9.3.  So to achieve your goal the repeater/collection widget is the only option at this time with out writing a custom widget.

 

I am still waiting on clarification but I am being told that the 9.3 SDK does support the ability for dropdowns, but this would still lead to a custom widget I believe.

 

Thanks,

 

Travis

Top Tags