cancel
Showing results for 
Search instead for 
Did you mean: 

TabStrip Not Woriking

Former Member
0 Kudos

Hi,

I have done the TabStrip example...

I have created

TabStrip > Tabs1 > Tabs1_Content > ViewElementUiContainer.

like this i have created another Tab...

while i am executing the application i am getting all fields in disble state.....

i have created tabs Edit and Display....

in Edit i have fileds like

Name

Country

Birthday...

and Save Button

in Display i have Fields like

Name

Country

Birthday

My requirement is once i click on the SAVE button in edit view the data will be displayed on Display Tab view....

So i need what code i have to written in SAVE button action method for displaying data on Display View...

please help me

Thanks & Regards

Ravi Shankar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ravi,

About the fields being in disable state:

Are they bound to context attributes that are part of a value node? if so try to set the cardinality property of the value node to 1..1

About the Save button:

you can create a value attribute of type String, lets call it "selectedTab"

and bind it to the property selectedTab of the TabStrip.

now - on the action bound to the save button in order to display the other tab write:

wdContext.currentContextElement().setSelectedTab("Display");

When Display is the name of the second tab.

Hope it answers your questions, Adi

Former Member
0 Kudos

can u please tell me what is the use of Cardinality

Former Member
0 Kudos

Hi Ravi,

A value node is a collection of records.

The cardinality of the node stends for the number of records possible in the collection.

It can be either 0..1,0..n,1..1 or 1..n.

If for example we use the node to populate a table we would use cardinality 1..n or 0..n

If we use the node for displaying only one record (like your example) we can use 0..1 or 1..1

Regards, Adi.

Answers (3)

Answers (3)

former_member193726
Active Participant
0 Kudos

Hi Ravi,

You must be having two tabs EDIT and DISPLAY in your tabstrip. Can you please note the ID for the same?

Lets say the ID's for EDIT is "Tabs0" and DISPLAY is "Tabs1".

CREATE AN ATTRIBUTE CALLED SELECTEDTAB IN UR COMPONENT CONTROLLER'S CONTEXT AND MAP IT TO YOUR VIEW CONTROLLER. BIND THE SELECTEDTAB CONTEXT ATTRIBUTE TO SELECTEDTAB PROPERTIES FOR YOUR TABSTRIP AND WRITE THE FOLLOWING CODE IN UR SUBMIT() METHOD:

if(wdContext.currentContextElement().getSelectedtab() == "Tabs0")

{

wdContext.currentContextElement().setSelectedtab("Tabs1");

}

else

{

wdContext.currentContextElement().setSelectedtab("Tabs0");

}

Hope this will solve you problem.

Regards,

Rekha Malavathu

Former Member
0 Kudos

Don't use == to compare strings.

Armin

Former Member
0 Kudos
sridhar_k2
Active Contributor
0 Kudos

Hi Ravi,

To Pass data (Name, Country..) to another view, you have to use data passing mechanism . Either a Portal Eventing or Passing data from Controller Mechanism.

In Save button from Edit View, you have fire to Display View.

Ex - Portal Eventing.

WDPortalEventing.fire("nameSpace","event",dataObject);

// write whatever you want to pass to other view.

dataObject - Contains Name + delim + Country + delim + ...

In the Display (Subscribe View) will get that data, it will display in the respective fields.

WDPortalEventing.subscribe("nameSpace","event", wdThis.actionMethod);

In the Action Method you assign it to individual values, by splitting using delimiters.

Regards,

Sridhar