• nobineko
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies

selectListの表示される内容を条件により、変更する方法はないでしょうか?

 

たとえば、分類テーブルが1つあり、

  フィールド  |区分|コード|名称|

                         1         1      AAA

                         1         2      BBB

                         1         3      CCC

                         2         1      KKK

                           ・

                           ・

区分の値で大分類、中分類、小分類を分けたいのですが、

区分の値を渡して、bunrui_listの内容を使い分ける方法はないでしょうか?

 

//Page

  <apex:outputText value="大分類 "/>
    <apex:selectList value="{!bunrui_cd}" size="1">
    <apex:selectOptions value="{!bunrui_list}" />
   </apex:selectList>

 

//Controller

  public List<Selectoption> getbunrui_list(){

          ・

          ・

          ・

Controller内で、List1にセットするSOQL文を動的に作成したいのですが、どうすればいいでしょうか?

 

イメージとしては、以下の様にしたいのですが、エラーになってしまいます。

List<Acount> List1 = [Select    Name From Acout Where TEL == :stmp];

     ↓

 String sSOQL =  ’[Select    Name From Acout Where TEL == :stmp]’ ;

 List<Acount> List1 = sSOQL;

 

よろしくお願いします。

関数に渡す引数の規定値を設定するにはどうすればいいでしょうか?

 

具体的にはvisualforceページでinputTextに値が入力されていない時は

規定値でデータを抽出したいのですが・・・

 

VB等では以下の様にすると思います。

call func(1,'aaa')

 

func(i as integer = 0,s as string = '')

 

 

visualforceで一覧表示ページを作成中です。

ページ上部に抽出条件を入力する項目を作り、検索ボタンクリックで条件に合う情報を

抽出表示したいのですが、controller側のdoFindの処理はどういう方法がベストでしょうか?

 

よろしくお願いします。

 

apex:page controller="ListController">
 <apex:form >
  <apex:pageBlock>
   <apex:outputText value="Code"/>
   <apex:inputText id="Code" value="{!Code}"/>
   <apex:commandButton action="{!doFind}" value="検索" />
  </apex:pageBlock>
 
   <apex:pageBlock >
   <apex:pageBlockSection title=""  showHeader="false">
    <apex:dataTable value="{!List1}" var="l1">
     <apex:column>

 

Controller内で、List1にセットするSOQL文を動的に作成したいのですが、どうすればいいでしょうか?

 

イメージとしては、以下の様にしたいのですが、エラーになってしまいます。

List<Acount> List1 = [Select    Name From Acout Where TEL == :stmp];

     ↓

 String sSOQL =  ’[Select    Name From Acout Where TEL == :stmp]’ ;

 List<Acount> List1 = sSOQL;

 

よろしくお願いします。

visualforceで一覧表示ページを作成中です。

ページ上部に抽出条件を入力する項目を作り、検索ボタンクリックで条件に合う情報を

抽出表示したいのですが、controller側のdoFindの処理はどういう方法がベストでしょうか?

 

よろしくお願いします。

 

apex:page controller="ListController">
 <apex:form >
  <apex:pageBlock>
   <apex:outputText value="Code"/>
   <apex:inputText id="Code" value="{!Code}"/>
   <apex:commandButton action="{!doFind}" value="検索" />
  </apex:pageBlock>
 
   <apex:pageBlock >
   <apex:pageBlockSection title=""  showHeader="false">
    <apex:dataTable value="{!List1}" var="l1">
     <apex:column>